-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Allow enums in interface #4087
Labels
language design
Any changes to the language, e.g. new features
Comments
I think it is fine to allow both enums and structs in interfaces. |
I was never aware of any problem, we just wanted to restrict interfaces as much as possible. |
I think it was rather lack of time to properly evaluate the implications and to get a basic version of interfaces out. |
We should also allow structs. |
I am working on this now. |
Documentation change is missing. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I believe this was raised previously a couple of times and it is handled as part of the inheritance discussion (#3729).
I'd however propose to make an exception and allow this simple change outside of concluding that discussion, right now.
Are there any reasons for disallowing it? I remember we disallowed it out of fear something might break (or rather lack of time to check everything) and probably
enum
s weren't supported to be used from a foreign contract making it less useful.However, as of today this should be working (granted
bool TypeChecker::visit(EnumDefinition const& _enum)
is removed in the type checker):It also seems the output has the proper enum values after compilation.
The text was updated successfully, but these errors were encountered: