Skip to content

Commit 4b2fc79

Browse files
committed
Accept new baselines
1 parent 7f90ad1 commit 4b2fc79

File tree

4 files changed

+70
-0
lines changed

4 files changed

+70
-0
lines changed

tests/baselines/reference/genericFunctionInference1.errors.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,4 +190,12 @@ tests/cases/compiler/genericFunctionInference1.ts(83,14): error TS2345: Argument
190190
x => x,
191191
x => first(x),
192192
);
193+
194+
// Repro from #30297
195+
196+
declare function foo2<T, U = T>(fn: T, a?: U, b?: U): [T, U];
197+
198+
foo2(() => {});
199+
foo2(identity);
200+
foo2(identity, 1);
193201

tests/baselines/reference/genericFunctionInference1.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,14 @@ const fn62 = pipe(
183183
x => x,
184184
x => first(x),
185185
);
186+
187+
// Repro from #30297
188+
189+
declare function foo2<T, U = T>(fn: T, a?: U, b?: U): [T, U];
190+
191+
foo2(() => {});
192+
foo2(identity);
193+
foo2(identity, 1);
186194

187195

188196
//// [genericFunctionInference1.js]
@@ -265,3 +273,6 @@ const fn40 = pipe(getString, string => orUndefined(string), identity);
265273
const fn60 = pipe(getArray, x => x, first);
266274
const fn61 = pipe(getArray, identity, first);
267275
const fn62 = pipe(getArray, x => x, x => first(x));
276+
foo2(() => { });
277+
foo2(identity);
278+
foo2(identity, 1);

tests/baselines/reference/genericFunctionInference1.symbols

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,3 +848,30 @@ const fn62 = pipe(
848848

849849
);
850850

851+
// Repro from #30297
852+
853+
declare function foo2<T, U = T>(fn: T, a?: U, b?: U): [T, U];
854+
>foo2 : Symbol(foo2, Decl(genericFunctionInference1.ts, 183, 2))
855+
>T : Symbol(T, Decl(genericFunctionInference1.ts, 187, 22))
856+
>U : Symbol(U, Decl(genericFunctionInference1.ts, 187, 24))
857+
>T : Symbol(T, Decl(genericFunctionInference1.ts, 187, 22))
858+
>fn : Symbol(fn, Decl(genericFunctionInference1.ts, 187, 32))
859+
>T : Symbol(T, Decl(genericFunctionInference1.ts, 187, 22))
860+
>a : Symbol(a, Decl(genericFunctionInference1.ts, 187, 38))
861+
>U : Symbol(U, Decl(genericFunctionInference1.ts, 187, 24))
862+
>b : Symbol(b, Decl(genericFunctionInference1.ts, 187, 45))
863+
>U : Symbol(U, Decl(genericFunctionInference1.ts, 187, 24))
864+
>T : Symbol(T, Decl(genericFunctionInference1.ts, 187, 22))
865+
>U : Symbol(U, Decl(genericFunctionInference1.ts, 187, 24))
866+
867+
foo2(() => {});
868+
>foo2 : Symbol(foo2, Decl(genericFunctionInference1.ts, 183, 2))
869+
870+
foo2(identity);
871+
>foo2 : Symbol(foo2, Decl(genericFunctionInference1.ts, 183, 2))
872+
>identity : Symbol(identity, Decl(genericFunctionInference1.ts, 154, 13))
873+
874+
foo2(identity, 1);
875+
>foo2 : Symbol(foo2, Decl(genericFunctionInference1.ts, 183, 2))
876+
>identity : Symbol(identity, Decl(genericFunctionInference1.ts, 154, 13))
877+

tests/baselines/reference/genericFunctionInference1.types

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -799,3 +799,27 @@ const fn62 = pipe(
799799

800800
);
801801

802+
// Repro from #30297
803+
804+
declare function foo2<T, U = T>(fn: T, a?: U, b?: U): [T, U];
805+
>foo2 : <T, U = T>(fn: T, a?: U | undefined, b?: U | undefined) => [T, U]
806+
>fn : T
807+
>a : U | undefined
808+
>b : U | undefined
809+
810+
foo2(() => {});
811+
>foo2(() => {}) : [() => void, () => void]
812+
>foo2 : <T, U = T>(fn: T, a?: U | undefined, b?: U | undefined) => [T, U]
813+
>() => {} : () => void
814+
815+
foo2(identity);
816+
>foo2(identity) : [<T>(value: T) => T, {}]
817+
>foo2 : <T, U = T>(fn: T, a?: U | undefined, b?: U | undefined) => [T, U]
818+
>identity : <T>(value: T) => T
819+
820+
foo2(identity, 1);
821+
>foo2(identity, 1) : [<T>(value: T) => T, number]
822+
>foo2 : <T, U = T>(fn: T, a?: U | undefined, b?: U | undefined) => [T, U]
823+
>identity : <T>(value: T) => T
824+
>1 : 1
825+

0 commit comments

Comments
 (0)