-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make enums interop with Java enums #4088
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
Comments
We already implement exhaustivity checking for Java enums, not sure if there's anything else we need to do?
The JVMS defines the classfile flag ACC_ENUM but does not ascribe any semantic to it. The JLS states that an enum public static E[] values();
public static E valueOf(String name); It also describes various limitations of enums, and here things are less clear: what happens if you have an enum that does not respect these limitations? Does javac crash? Do we get runtime errors when using |
@anatoliykmetyuk what is the current status of Java enums interop? |
The current status is best described by this test. Basically, everything that you can do with Java enums can be done with Scala enums from Java. The only two known incompatibilities are #6663 which will be solved while solving #6620 (which implies that Scala enums require Scala library on classpath). I'm closing this issue since the interop works in general and all the minor issues are discussed in separate tickets. |
There are two directions:
See #1970 for comments about how this might be achieved.
The text was updated successfully, but these errors were encountered: