Closed
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
}
}