Skip to content

Commit a764729

Browse files
committed
Add tests
1 parent ca47ddb commit a764729

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/cases/conformance/types/typeRelationships/typeInference/unionAndIntersectionInference1.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,13 @@ const createTest = (): ITest => {
8686
}
8787

8888
declare function f1<T, U>(x: T | U): T | U;
89-
declare function f2<T, U>(x: T & U): T & U;
89+
declare function f2<T, U>(x: T, y: U): T | U;
9090

9191
let x1: string = f1('a');
92-
let x2: string = f2('a');
92+
let x2: string = f2('a', 'b');
93+
94+
// Repro from #30442
95+
96+
const func = <T>() => {};
97+
const assign = <T, U>(a: T, b: U) => Object.assign(a, b);
98+
const res: (() => void) & { func: any } = assign(() => {}, { func });

0 commit comments

Comments
 (0)