-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
TypeScript Version: 3.9.2
Search Terms: unreachable
Code
const hel2 = (x: number) => {
switch (typeof x) {
case 'number': return 0
}
x // Unreachable code detected
}
const hel12 = (x: number) => {
if(typeof x === 'number'){
return 0;
}
x // expect same error here!
}Expected behavior:
in commnet
Actual behavior:
in commnet
Related Issues:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript