mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Added tests.
This commit is contained in:
@@ -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