We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In 1.8, if you declare two empty enums with the same local name in different modules, they are assignable, in violation of the spec ("different enum types are not assignable to each other"):
module A { export declare enum Id {} } module B { export declare enum Id {} } var a: A.Id; var b: B.Id; a = b; // TypeScript 1.7 caught the error here, 1.8 does not.
This bug will not occur (i.e. the error will be correctly reported) if
const
The text was updated successfully, but these errors were encountered:
This is intentional (see #1748) but we need to update the spec
Sorry, something went wrong.
Can I rely on them being unassignable if I make them const?
No. You could add some arbitrarily-named member to them, though.
does it mean enums are no longer nominal?
No. For example:
enum A { x } enum B { x } // Still an error var q: A = B.x;
The spec is now an "archived" artifact and we won't be tracking defects against it anymore.
ahejlsberg
No branches or pull requests
In 1.8, if you declare two empty enums with the same local name in different modules, they are assignable, in violation of the spec ("different enum types are not assignable to each other"):
This bug will not occur (i.e. the error will be correctly reported) if
const
, orThe text was updated successfully, but these errors were encountered: