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

Feature request: Java-like local inner classes? #1807

Closed
qc00 opened this issue Jan 26, 2015 · 2 comments
Closed

Feature request: Java-like local inner classes? #1807

qc00 opened this issue Jan 26, 2015 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@qc00
Copy link

qc00 commented Jan 26, 2015

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.

@NoelAbrahams
Copy link

Class expressions should cover this requirement (#497)

@qc00
Copy link
Author

qc00 commented Jan 26, 2015

Yes, it should indeed.

@DanielRosenwasser DanielRosenwasser added Duplicate An existing issue was already created ES6 Relates to the ES6 Spec labels Jan 26, 2015
@RyanCavanaugh RyanCavanaugh removed the ES6 Relates to the ES6 Spec label Jan 26, 2015
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

4 participants