Skip to content

Commit 01e7c73

Browse files
Test require indent after colon at EOL in REPL (#17452)
Follow-up #16466 with test from #14092 which was sadly ignored. Co-authored-by: Gagandeep kalra <[email protected]>
1 parent 5c4e597 commit 01e7c73

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/test/dotty/tools/repl/ReplCompilerTests.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,12 @@ class ReplCompilerTests extends ReplTest:
347347
assertEquals("java.lang.AssertionError: assertion failed", all.head)
348348
}
349349

350+
@Test def `i13097 expect lambda after colon` = contextually:
351+
assert(ParseResult.isIncomplete("val x = List(42).foreach:"))
352+
353+
@Test def `i13097 expect template after colon` = contextually:
354+
assert(ParseResult.isIncomplete("class C:"))
355+
350356
object ReplCompilerTests:
351357

352358
private val pattern = Pattern.compile("\\r[\\n]?|\\n");

0 commit comments

Comments
 (0)