-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
Feature request: Java-like local inner classes? #1807
Labels
Duplicate
An existing issue was already created
Comments
Class expressions should cover this requirement (#497) |
Yes, it should indeed. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Since functions can be defined in and returned from function bodies, it seems inconsistent to not support the definition of classes in functions. It would be very useful in applications where explicit typing of ad-hoc return value is preferred over duck typing.
The syntax and semantics could be the same as defining a class in a module (since a module is compiled to a function) with different lexical scope. Java-specific features like anonymous inner class is probably not useful due to duck typing.
The text was updated successfully, but these errors were encountered: