enhanced enums - back from the dead?
Liam Miller-Cushon
cushon at google.com
Mon Dec 10 21:27:59 UTC 2018
I did some corpus analysis for the following question from your doc:
There is a question on how broadly we want to affect typing rules for raw
> types; one option is to alter the rules for all type references; another,
> more conservative option, would be to use the refined rules only for enum
> raw type references (on the basis that generic enums and raw types will be
> frequently used together). The latter path has the clear advantage of
> avoiding all kinds of source compatibility issues, but it is more
> inconsistent - refactoring a generic enum into a class might lead to
> surprises.
I found roughly one breaking change per 55000 files.
For context that's about four times as many as the fix that was discussed
recently for JDK-8207224. Less quantitatively, in the corpus I looked at it
is noticeable but wouldn't be very difficult to work around, especially
because there's usually a trivial semantics-preserving fix of adding an
explicit unchecked cast.
(For the analysis I applied only the changes to Types from the
enhanced-enums branch, and commented out all of the `isEnum` checks.)
More information about the amber-spec-observers
mailing list