Closed
Description
TypeScript Version: nightly (2.1.0-dev.20160831)
Code
class Foo {
}
class Bar {
public baz: string;
}
let a: Foo|Bar = undefined!;
if (a instanceof Foo) {
// Some code
} else {
a.baz = "";
}
Expected behavior:
No errors or at least error Property 'baz' does not exist on type 'Foo|Bar'
.
Actual behavior:
Error Property 'baz' does not exist on type 'never'.