From 3e43598dd9a5d0b316f5f45bc0f9118a3af01725 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Wed, 10 May 2023 01:56:48 -0700 Subject: [PATCH] Test require indent after colon at EOL in REPL Co-authored-by: Gagandeep kalra --- compiler/test/dotty/tools/repl/ReplCompilerTests.scala | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/test/dotty/tools/repl/ReplCompilerTests.scala b/compiler/test/dotty/tools/repl/ReplCompilerTests.scala index bcb08cd232d7..ecdfeb512e1b 100644 --- a/compiler/test/dotty/tools/repl/ReplCompilerTests.scala +++ b/compiler/test/dotty/tools/repl/ReplCompilerTests.scala @@ -347,6 +347,12 @@ class ReplCompilerTests extends ReplTest: assertEquals("java.lang.AssertionError: assertion failed", all.head) } + @Test def `i13097 expect lambda after colon` = contextually: + assert(ParseResult.isIncomplete("val x = List(42).foreach:")) + + @Test def `i13097 expect template after colon` = contextually: + assert(ParseResult.isIncomplete("class C:")) + object ReplCompilerTests: private val pattern = Pattern.compile("\\r[\\n]?|\\n");