Skip to content

Allow classes inside functions #307

Closed
@ComFreek

Description

@ComFreek

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions