-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
SuggestionAn idea for TypeScriptAn idea for TypeScriptWon't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix itThe severity and priority of this issue do not warrant the time or complexity needed to fix it
Description
TypeScript Version:
1.9.0-dev
Code
// A self-contained demonstration of the problem follows...
interface A {}
interface B {}
interface C {}
declare function isA(arg: any): arg is A;
declare function isB(arg: any): arg is B;
declare function isC(arg: any): arg is C;
function handleAction<T>(action: T) {
switch (true) {
case isA(action):
case isB(action):
// action expected to be A|B type here
break;
case isC(action):
// action expected to be C type here
break;
default:
// action expected to be undefined type here
}
}maxkoretskyi
Metadata
Metadata
Assignees
Labels
SuggestionAn idea for TypeScriptAn idea for TypeScriptWon't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix itThe severity and priority of this issue do not warrant the time or complexity needed to fix it