Skip to content
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

SIP: Enums #5373

Closed
odersky opened this issue Nov 2, 2018 · 3 comments
Closed

SIP: Enums #5373

odersky opened this issue Nov 2, 2018 · 3 comments
Assignees

Comments

@odersky
Copy link
Contributor

odersky commented Nov 2, 2018

  1. It should be possible that an enum trait extends java.lang.Enum. The compiler should check in this case that the restrictions imposed by Java are followed and generate the necessary code.

  2. We should harmonize the method names between Scala and Java enums:

  enumTag --> ordinal
  enumValueNamed --> valueOf
  enumValues --> values

values has to be a field to work with Java reflection (static valueOf method in java.lang.Enum).

@sjrd sjrd self-assigned this Nov 2, 2018
@smarter
Copy link
Member

smarter commented Nov 3, 2018

For point 1, see #4088.
Also just looking at all issues mentioning enum is a good way to see what more things might need to be speced: https://github.com/lampepfl/dotty/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+enum

@dwijnand
Copy link
Member

@smarter
Copy link
Member

smarter commented Sep 5, 2019

Yep.

@smarter smarter closed this as completed Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants