Skip to content

Strange error for JS enum with missing braces #26890

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
ghost opened this issue Sep 4, 2018 · 0 comments
Closed

Strange error for JS enum with missing braces #26890

ghost opened this issue Sep 4, 2018 · 0 comments
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@ghost
Copy link

ghost commented Sep 4, 2018

TypeScript Version: 3.1.0-dev.20180830

Code

/** @enum number */
const E = { A: 0 };

Expected behavior:

Useful error message, perhaps '{' expected..

Actual behavior:

src/a.js:1:11 - error TS2693: 'number' only refers to a type, but is being used as a value here.

But the error isn't fixed if I define const number = 0;...

@ghost ghost added Bug A bug in TypeScript Domain: Error Messages The issue relates to error messaging and removed Domain: Error Messages The issue relates to error messaging labels Sep 4, 2018
@ghost ghost added the Fixed A PR has been merged for this issue label Sep 6, 2018
@ghost ghost closed this as completed in #26915 Sep 13, 2018
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

0 participants