-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Use some enums in compiler #6733
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
Use some enums in compiler #6733
Conversation
There are actually surprisingly few opportunities to use enums. The problem is that most simple enumerations we use in the compiler have bitset structure. So an enum does not work for them, at least |
The last one that could be a Scala enum is |
Is it not possible to add |
We also need stable IDs which an ordering would not give. |
I was hoping it would use the enum's ordinal? still doesn't know how |
We could use a derived ordering for these. But for the moment using a couple |
The remaining failures have to do with -Ytest-pickler instabilities of positions of Child annotations (fixed in #6752). I'm putting this PR on hold until the next bootstrap compiler is out that fixes the problem. |
a29edc4
to
f54266b
Compare
@@ -217,7 +213,7 @@ object desugar { | |||
val meth @ DefDef(_, tparams, vparamss, tpt, rhs) = transformQuotedPatternName(meth0) | |||
val methName = normalizeName(meth, tpt).asTermName | |||
val mods = meth.mods | |||
val epbuf = new ListBuffer[ValDef] | |||
val epbuf = ListBuffer[ValDef]() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ListBuffer[ValDef]
is unambiguous. Meaning there is no question whether it is a reference to an object or a constructor call here because of the type parameters. Can we drop ()
here in future?
No description provided.