Add tests
This commit is contained in:
parent
9479353d5c
commit
45411e525c
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue