Skip to content

REPL syntax error on incomplete catch #14313

Closed
@som-snytt

Description

@som-snytt

Compiler version

Scala 3.1.2-RC1-bin-SNAPSHOT

Minimized code

scala> def f[A](x: => Any) =
     |   try x
     |   catch {
-- [E040] Syntax Error: -------------------------------------------------------------------------------------------------------------------------
3 |  catch {
  |         ^
  |         '}' expected, but eof found

scala> try 42 catch {
-- [E040] Syntax Error: -------------------------------------------------------------------------------------------------------------------------
1 |try 42 catch {
  |              ^
  |              '}' expected, but eof found

Output

Errored instead of consuming more user input.

Expectation

Open brace is an easy signal that output is incomplete.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions