Skip to content

Confusing error message for abstract method without return type #871

@smarter

Description

@smarter

The following is legal in scalac and creates a method with return type Unit:

trait Message {
  def first(x: Int)
}

In Dotty, it's illegal, I agree with that, but the error message should tell you that you're missing a return type, instead you get:

confusing.scala:3: error: '=' expected but '}' found.
 }
 ^
one error found

which is hard to diagnose.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions