mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Added tests.
This commit is contained in:
29
tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts
Normal file
29
tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts
Normal file
@@ -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: '' })
|
||||
Reference in New Issue
Block a user