make the strict equality comparison operator a typeguard for string literal types · Issue #7447 · microsoft/TypeScript (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

@zpdDG4gta8XKpMCd

Description

@zpdDG4gta8XKpMCd

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

Issue actions