TypeScript/tests/cases/compiler/namespaceDisambiguationInUnion.ts
Andrew Branch 3e86f15f51
Disambiguate types with same name from different namespaces in mapToTypeNodes (#37543)
* Disambiguate types with same name from different namespaces in mapToTypeNodes

* Update baseline with additional example

* Fix typo
2020-04-07 10:55:56 -07:00

14 lines
265 B
TypeScript

namespace Foo {
export type Yep = { type: "foo.yep" };
}
namespace Bar {
export type Yep = { type: "bar.yep" };
}
const x = { type: "wat.nup" };
const val1: Foo.Yep | Bar.Yep = x;
const y = [{ type: "a" }, { type: "b" }];
const val2: [Foo.Yep, Bar.Yep] = y;