We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8cddc66 + 0fc2752 commit 96413a5Copy full SHA for 96413a5
compiler/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -3534,7 +3534,9 @@ object Parsers {
3534
newLinesOpt()
3535
val noParams = tparams.isEmpty && vparamss.isEmpty
3536
if !(name.isEmpty && noParams) then accept(COLON)
3537
- val parents = constrApp() :: withConstrApps()
+ val parents =
3538
+ if isSimpleLiteral then toplevelTyp() :: Nil
3539
+ else constrApp() :: withConstrApps()
3540
val parentsIsType = parents.length == 1 && parents.head.isType
3541
if in.token == EQUALS && parentsIsType then
3542
accept(EQUALS)
tests/pos/i11102.scala
@@ -0,0 +1,3 @@
1
+given s: "literal" = "literal" // compile error
2
+given "foo" = "foo"
3
+given x: 1 = 1
0 commit comments