mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-11 01:34:55 -06:00
Added tests for types with overlap across a single property name.
This commit is contained in:
parent
3d8668c3d4
commit
b44ee8ef4b
@ -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);
|
||||
Loading…
x
Reference in New Issue
Block a user