Accept new baselines

This commit is contained in:
Anders Hejlsberg
2019-03-12 17:30:35 -07:00
parent 4f4d9f6819
commit edf8954aae
4 changed files with 43 additions and 0 deletions
@@ -198,4 +198,9 @@ tests/cases/compiler/genericFunctionInference1.ts(83,14): error TS2345: Argument
foo2(() => {});
foo2(identity);
foo2(identity, 1);
// Repro from #30324
declare function times<T>(fn: (i: number) => T): (n: number) => T[];
const a2 = times(identity)(5); // => [0, 1, 2, 3, 4]
@@ -191,6 +191,11 @@ declare function foo2<T, U = T>(fn: T, a?: U, b?: U): [T, U];
foo2(() => {});
foo2(identity);
foo2(identity, 1);
// Repro from #30324
declare function times<T>(fn: (i: number) => T): (n: number) => T[];
const a2 = times(identity)(5); // => [0, 1, 2, 3, 4]
//// [genericFunctionInference1.js]
@@ -276,3 +281,4 @@ const fn62 = pipe(getArray, x => x, x => first(x));
foo2(() => { });
foo2(identity);
foo2(identity, 1);
const a2 = times(identity)(5); // => [0, 1, 2, 3, 4]
@@ -875,3 +875,19 @@ foo2(identity, 1);
>foo2 : Symbol(foo2, Decl(genericFunctionInference1.ts, 183, 2))
>identity : Symbol(identity, Decl(genericFunctionInference1.ts, 154, 13))
// Repro from #30324
declare function times<T>(fn: (i: number) => T): (n: number) => T[];
>times : Symbol(times, Decl(genericFunctionInference1.ts, 191, 18))
>T : Symbol(T, Decl(genericFunctionInference1.ts, 195, 23))
>fn : Symbol(fn, Decl(genericFunctionInference1.ts, 195, 26))
>i : Symbol(i, Decl(genericFunctionInference1.ts, 195, 31))
>T : Symbol(T, Decl(genericFunctionInference1.ts, 195, 23))
>n : Symbol(n, Decl(genericFunctionInference1.ts, 195, 50))
>T : Symbol(T, Decl(genericFunctionInference1.ts, 195, 23))
const a2 = times(identity)(5); // => [0, 1, 2, 3, 4]
>a2 : Symbol(a2, Decl(genericFunctionInference1.ts, 196, 5))
>times : Symbol(times, Decl(genericFunctionInference1.ts, 191, 18))
>identity : Symbol(identity, Decl(genericFunctionInference1.ts, 154, 13))
@@ -823,3 +823,19 @@ foo2(identity, 1);
>identity : <T>(value: T) => T
>1 : 1
// Repro from #30324
declare function times<T>(fn: (i: number) => T): (n: number) => T[];
>times : <T>(fn: (i: number) => T) => (n: number) => T[]
>fn : (i: number) => T
>i : number
>n : number
const a2 = times(identity)(5); // => [0, 1, 2, 3, 4]
>a2 : number[]
>times(identity)(5) : number[]
>times(identity) : (n: number) => number[]
>times : <T>(fn: (i: number) => T) => (n: number) => T[]
>identity : <T>(value: T) => T
>5 : 5