-
Notifications
You must be signed in to change notification settings - Fork 1.1k
remove scala.runtime.EnumValues #9628
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
remove scala.runtime.EnumValues #9628
Conversation
22f8dd4
to
f9207e2
Compare
b201183
to
9790f98
Compare
9790f98
to
bb0cc13
Compare
That is disappointing. Is it intended? If yes, I'm afraid you'll have to revert to the the code that generates the |
bb0cc13
to
7303278
Compare
@sjrd looks like phase |
4dbc6e8
to
11a582c
Compare
I think it would make sense to support pickling/unpickling JavaSeqLiteral. |
11a582c
to
c36af53
Compare
c36af53
to
5dfcd6d
Compare
@smarter @sjrd not sure what to do here for this example: class Outer {
val thunk = { () =>
enum E { case A }
E.A
}
}
@main def Test =
assert(Outer().thunk().toString == "A") if I create the |
I guess you could make it a |
I'll make it lazy when the owner of the enum is not static |
this works and can be merged, but should be updated in the future based on how #9664 is resolved |
This patches a regression introduced in scala#9628, instead of checking if the owner of an enum is static before making values lazy, the enum itself is checked to be static.
This patches a regression introduced in scala#9628 where defining an enum local to a method can cause an infinite loop at initialisation of its companion. Instead, we select enum values from "this" and not the companion, which avoids forcing initialisation of the companion. We then ascribe the values array with unchecked annotation to avoid complaints from the init checker.
generates an array of the constants immediately after the last enum case