diff --git a/tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts b/tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts new file mode 100644 index 00000000000..aec1821c162 --- /dev/null +++ b/tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts @@ -0,0 +1,29 @@ +interface Foo { + a: string; + b: number; +}; + +interface Bar { + b: string; +} + +interface Other { + totallyUnrelatedProperty: number; +} + +export let x = { a: '', b: '' }; + +declare function f(x: Foo | Other): any; + +f(x); +f({ a: '', b: '' }) + +declare function g(x: Bar | Other): any; + +g(x); +g({ a: '', b: '' }) + +declare function h(x: Foo | Bar | Other): any; + +h(x); +h({ a: '', b: '' })