Skip to content

Allow classes inside functions #307

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

Closed
ComFreek opened this issue Jul 30, 2014 · 1 comment
Closed

Allow classes inside functions #307

ComFreek opened this issue Jul 30, 2014 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@ComFreek
Copy link

ES 6 allows class expressions inside functions (source 1, source 2 (first comment)).

Suggestion: TypeScript should allow classes inside functions.

function test() { 
   // Throws "Unexpected token; 'statement' expected." 
   class ABC { 
   } 
}

Original CodePlex issue: http://typescript.codeplex.com/workitem/136

@sophiajt
Copy link
Contributor

Thanks for the suggestion. There's a bug tracking ES6 class expressions work (#239) and has some of the design notes if you want to comment.

@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

2 participants