Skip to content

Incorrect position on "object creation impossible" error in enums #22734

Open
@kubukoz

Description

@kubukoz

Compiler version

3.7.0-RC1-bin-20250304-bef520f-NIGHTLY / 3.6.3

Minimized code

enum Foo {
  case Empty
  case NonEmpty(item: String)

  def item: String
}

Output

[error] ./Demo.scala:3:30
[error] object creation impossible, since def item: String in class Foo is not defined 
[error]   case NonEmpty(item: String)
[error]                              ^

Expectation

[error] ./Demo.scala:2:7
[error] object creation impossible, since def item: String in class Foo is not defined 
[error]   case Empty
[error]        ^

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