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 19e47b7 + 0c314fa commit 4bb1004Copy full SHA for 4bb1004
compiler/src/dotty/tools/dotc/parsing/Parsers.scala
@@ -1282,9 +1282,11 @@ object Parsers {
1282
def possibleTemplateStart(isNew: Boolean = false): Unit =
1283
in.observeColonEOL()
1284
if in.token == COLONEOL then
1285
- in.nextToken()
1286
- if in.token != INDENT then
1287
- syntaxErrorOrIncomplete(i"indented definitions expected")
+ if in.lookahead.isIdent(nme.end) then in.token = NEWLINE
+ else
+ in.nextToken()
1288
+ if in.token != INDENT then
1289
+ syntaxErrorOrIncomplete(i"indented definitions expected, ${in}")
1290
else
1291
newLineOptWhenFollowedBy(LBRACE)
1292
tests/pos/i10080.scala
@@ -0,0 +1,5 @@
1
+trait Foo:
2
+end Foo
3
+
4
+trait Bar
5
+end Bar
0 commit comments