Closed
Description
From master
interface Foo {
kind: "foo";
name: string;
}
interface Bar {
kind: "bar";
length: string;
}
let x: string | Foo | Bar = <any>undefined;
if(typeof x === 'string') {
} else {
switch(x.kind) {
case 'foo':
console.log(x.name); // <-- Error, Property 'name' does not exist on type 'Foo | Bar'.
}
}
Compiles without error in 2.1.0-dev.20160729