Add tests

This commit is contained in:
Anders Hejlsberg 2018-12-10 16:30:30 -08:00
parent 9479353d5c
commit 45411e525c

View file

@ -72,3 +72,25 @@ function f20<Data>(carrier: DataCarrier<Data>) {
const data: null = carrier.data
}
}
// Repro from #28935
type Foo = { tag: true, x: number } | { tag: false, y: number } | { [x: string]: string };
function f30(foo: Foo) {
if (foo.tag) {
foo;
}
else {
foo;
}
}
function f31(foo: Foo) {
if (foo.tag === true) {
foo;
}
else {
foo;
}
}