Skip to content

TypeScript keyword in ES6 export list causes a parse error #2005

Closed
@pygy

Description

@pygy

type is a valid ES6 identifier yet the Closure compiler will refuse to compile files that try to use it as a variable.

It would be nice if the restriction was either lifted in ES6 input mode or at least documented. The docs currently say:

  • The Compiler only recognizes ECMAScript.

    ECMAScript 5 is the version of JavaScript supported almost everywhere. However the compiler also supports many of the features in ECMAScript 6. The compiler only supports official language features.

Searching for "TypeScript" doesn't return any page that mentions the language.

Edit: This bug may have a narrower scope than I initially thought... The problematic construct is

export {type};

I'll check later today if there are other issues but right now I must leave.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions