diff --git a/tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts b/tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts index aec1821c162..fe1d63cb606 100644 --- a/tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts +++ b/tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts @@ -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); \ No newline at end of file