Use variable declared as const
as literal type
#12603
Labels
Fixed
A PR has been merged for this issue
Milestone
const
as literal type
#12603
It would be nice to be able to use a variable declared as
const
as a literal type in a type annotation.TypeScript Version: 2.0.0
Code
Expected behavior:
No error, type
Action
is{ type: 'INCREMENT' } | { type: 'DECREMENT' }
.Actual behavior:
Error: Cannot find name
INCREMENT
The text was updated successfully, but these errors were encountered: