-
Notifications
You must be signed in to change notification settings - Fork 13.4k
const enum keyof typeof #21031
Copy link
Copy link
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
Milestone
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueGood First IssueWell scoped, documented and has the green lightWell scoped, documented and has the green lightHelp WantedYou can do thisYou can do this
TypeScript Version: 2.7.0-dev.20180105
Code
index.tsExpected behavior:
Expected the second line to work without compilation errors just like a non-const enum.
Actual behavior:
Emits an unexpected error on line 2:
Oddly enough, it looks like the type checking below the type declaration is working as expected. So I think this might be bug...line 2 should not be a compiler error.
Related issue: #14106