Skip to content

Error message not helpful when val definition contains extra '()' #6564

Closed as not planned
@scabug

Description

@scabug

If a val definition contains an extra set of parenthesis, like if not correctly transforming a def into a val, the error reported by the compiler is not really helpful.

$ scalac test.scala 
test.scala:5: error: not found: value a
  val a(): String = ""
      ^
one error found

It would be better if the error was something like: expected ':' or '=', found '('

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)usability

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions