Skip to content

Report a clearer error message for unexpected final modifier #17579

Closed
@som-snytt

Description

@som-snytt
Welcome to Scala 3.3.1-RC1-bin-SNAPSHOT-git-5262680 (20.0.1, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.

scala> final val x = 42
-- [E088] Syntax Error: ------------------------------------------------------------------------------------------------
1 |final val x = 42
  |      ^^^
  |      Expected start of definition
  |
  | longer explanation available when compiling with `-explain`

Expectation

That seems like a natural thing to do in the REPL.

Metadata

Metadata

Assignees

Labels

SpreeSuitable for a future Spreearea:replarea:reportingError reporting including formatting, implicit suggestions, etcitype:enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions