make the strict equality comparison operator a typeguard for string literal types · Issue #7447 · microsoft/TypeScript (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
1.9.0-dev.20160217
Code
const hey: 'hey' = 'hey'; const value = Math.random() > 0.5 ? 'hey' : 'nay'; if (value === hey) { // here expected value to be of type 'hey' (we just asserted it), actual string }
Metadata
Metadata
Labels
Development
No branches or pull requests