Skip to content

Defining an enum in typeCheckErrors always returns errors #22968

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
eejbyfeldt opened this issue Apr 11, 2025 · 2 comments · May be fixed by #22978
Open

Defining an enum in typeCheckErrors always returns errors #22968

eejbyfeldt opened this issue Apr 11, 2025 · 2 comments · May be fixed by #22978
Assignees
Labels
area:enums area:metaprogramming:compiletime The scala.compiletime package itype:bug regression This worked in a previous version but doesn't anymore

Comments

@eejbyfeldt
Copy link

Compiler version

3.6.4

Minimized code

import scala.compiletime.testing.typeCheckErrors

object Test {
  def main(args: Array[String]): Unit = {
    println(typeCheckErrors("enum Foo { case A }"))
  }
}

Output

List(Error(object creation impossible, since def ordinal: Int in trait Enum in package scala.reflect is not defined ,enum Foo { case A },11,Typer))

Expectation

The code should not have any type check errors and just print

List()
@eejbyfeldt eejbyfeldt added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 11, 2025
@eejbyfeldt
Copy link
Author

Works correctly in 3.3.5 and still fails in 3.7.0-RC1

@Gedochao Gedochao added area:enums regression This worked in a previous version but doesn't anymore stat:needs bisection Need to use nightly builds and git bisect to find out the commit where this issue was introduced and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Apr 11, 2025
@Gedochao
Copy link
Contributor

Last good release: 3.6.4-RC1-bin-20250108-285cd40-NIGHTLY
First bad release: 3.6.4-RC1-bin-20250109-a50a1e4-NIGHTLY
dcc66c9 is the first bad commit (#21185)
cc @jchyb

@Gedochao Gedochao removed the stat:needs bisection Need to use nightly builds and git bisect to find out the commit where this issue was introduced label Apr 11, 2025
@jchyb jchyb self-assigned this Apr 11, 2025
@jchyb jchyb added the area:metaprogramming:compiletime The scala.compiletime package label Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:enums area:metaprogramming:compiletime The scala.compiletime package itype:bug regression This worked in a previous version but doesn't anymore
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants