Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
kubukoz opened this issue Mar 7, 2025 · 1 comment · May be fixed by #23080
Open

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

kubukoz opened this issue Mar 7, 2025 · 1 comment · May be fixed by #23080

Comments

@kubukoz
Copy link
Contributor

kubukoz commented Mar 7, 2025

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]        ^
@kubukoz kubukoz added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 7, 2025
@som-snytt
Copy link
Contributor

I thought I had a forward port of Scala 2 improved "missing members"; I'll try to find it and incorporate this test.

@Gedochao Gedochao added area:enums and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 7, 2025
@som-snytt som-snytt linked a pull request Apr 30, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants