Skip to content

Commit

Permalink
Test require indent after colon at EOL in REPL (#17452)
Browse files Browse the repository at this point in the history
Follow-up #16466

with test from #14092

which was sadly ignored.

Co-authored-by: Gagandeep kalra <gagandeepkalra1994@gmail.com>
  • Loading branch information
som-snytt and gagandeepkalra committed May 12, 2023
1 parent 5c4e597 commit 01e7c73
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions compiler/test/dotty/tools/repl/ReplCompilerTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 01e7c73

Please sign in to comment.