mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-11 19:27:35 -06:00
Add tests
This commit is contained in:
parent
ca47ddb583
commit
a764729b38
@ -86,7 +86,13 @@ const createTest = (): ITest => {
|
||||
}
|
||||
|
||||
declare function f1<T, U>(x: T | U): T | U;
|
||||
declare function f2<T, U>(x: T & U): T & U;
|
||||
declare function f2<T, U>(x: T, y: U): T | U;
|
||||
|
||||
let x1: string = f1('a');
|
||||
let x2: string = f2('a');
|
||||
let x2: string = f2('a', 'b');
|
||||
|
||||
// Repro from #30442
|
||||
|
||||
const func = <T>() => {};
|
||||
const assign = <T, U>(a: T, b: U) => Object.assign(a, b);
|
||||
const res: (() => void) & { func: any } = assign(() => {}, { func });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user