Added tests for types with overlap across a single property name.

This commit is contained in:
Daniel Rosenwasser 2018-11-30 14:59:43 -08:00
parent 3d8668c3d4
commit b44ee8ef4b

View File

@ -27,3 +27,21 @@ declare function h(x: Foo | Bar | Other): any;
h(x);
h({ a: '', b: '' })
interface CatDog { cat: any, dog: any }
interface ManBearPig { man: any, bear: any, pig: any }
interface Platypus { platypus: any }
type ExoticAnimal =
| CatDog
| ManBearPig
| Platypus;
declare function addToZoo(animal: ExoticAnimal): void;
addToZoo({ dog: "Barky McBarkface" });
addToZoo({ man: "Manny", bear: "Coffee" });
const manBeer = { man: "Manny", beer: "Coffee" };
addToZoo({ man: "Manny", beer: "Coffee" });
addToZoo(manBeer);