From c58819e9c2248294da8cbdc76ce14ae8d0388536 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Sun, 3 Mar 2019 17:01:11 -0800 Subject: [PATCH] Accept new baselines --- .../contextualSignatureInstantiation1.types | 8 +++--- .../contextualSignatureInstantiation2.types | 4 +-- .../reference/genericFunctionInference1.types | 26 +++++++++---------- .../genericTypeParameterEquivalence2.types | 20 +++++++------- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/tests/baselines/reference/contextualSignatureInstantiation1.types b/tests/baselines/reference/contextualSignatureInstantiation1.types index 82e0d7cb6fd..9bb1ff030ca 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation1.types +++ b/tests/baselines/reference/contextualSignatureInstantiation1.types @@ -15,8 +15,8 @@ var e = (x: string, y?: K) => x.length; >length : number var r99 = map(e); // should be {}[] for S since a generic lambda is not inferentially typed ->r99 : (a: {}[]) => number[] ->map(e) : (a: {}[]) => number[] +>r99 : (a: string[]) => number[] +>map(e) : (a: string[]) => number[] >map : (f: (x: S) => T) => (a: S[]) => T[] >e : (x: string, y?: K) => number @@ -37,8 +37,8 @@ var e2 = (x: string, y?: K) => x.length; >length : number var r100 = map2(e2); // type arg inference should fail for S since a generic lambda is not inferentially typed. Falls back to { length: number } ->r100 : (a: { length: number; }[]) => number[] ->map2(e2) : (a: { length: number; }[]) => number[] +>r100 : (a: string[]) => number[] +>map2(e2) : (a: string[]) => number[] >map2 : (f: (x: S) => T) => (a: S[]) => T[] >e2 : (x: string, y?: K) => number diff --git a/tests/baselines/reference/contextualSignatureInstantiation2.types b/tests/baselines/reference/contextualSignatureInstantiation2.types index dbd526ab556..44776b5c01e 100644 --- a/tests/baselines/reference/contextualSignatureInstantiation2.types +++ b/tests/baselines/reference/contextualSignatureInstantiation2.types @@ -31,8 +31,8 @@ var id: (x:T) => T; >x : T var r23 = dot(id)(id); ->r23 : (_: {}) => {} ->dot(id)(id) : (_: {}) => {} +>r23 : (_: T) => {} +>dot(id)(id) : (_: T) => {} >dot(id) : (g: (_: U) => {}) => (_: U) => {} >dot : (f: (_: T) => S) => (g: (_: U) => T) => (_: U) => S >id : (x: T) => T diff --git a/tests/baselines/reference/genericFunctionInference1.types b/tests/baselines/reference/genericFunctionInference1.types index 037e4a49718..cf85c1b5afb 100644 --- a/tests/baselines/reference/genericFunctionInference1.types +++ b/tests/baselines/reference/genericFunctionInference1.types @@ -33,14 +33,14 @@ declare function box(x: V): { value: V }; >value : V const f00 = pipe(list); ->f00 : (a: any) => any[] ->pipe(list) : (a: any) => any[] +>f00 : (a: T) => T[] +>pipe(list) : (a: T) => T[] >pipe : { (ab: (...args: A) => B): (...args: A) => B; (ab: (...args: A) => B, bc: (b: B) => C): (...args: A) => C; (ab: (...args: A) => B, bc: (b: B) => C, cd: (c: C) => D): (...args: A) => D; } >list : (a: T) => T[] const f01 = pipe(list, box); ->f01 : (a: any) => { value: any[]; } ->pipe(list, box) : (a: any) => { value: any[]; } +>f01 : (a: T) => { value: T[]; } +>pipe(list, box) : (a: T) => { value: T[]; } >pipe : { (ab: (...args: A) => B): (...args: A) => B; (ab: (...args: A) => B, bc: (b: B) => C): (...args: A) => C; (ab: (...args: A) => B, bc: (b: B) => C, cd: (c: C) => D): (...args: A) => D; } >list : (a: T) => T[] >box : (x: V) => { value: V; } @@ -57,15 +57,15 @@ const f02 = pipe(x => list(x), box); >box : (x: V) => { value: V; } const f03 = pipe(list, x => box(x)); ->f03 : (a: any) => { value: any[]; } ->pipe(list, x => box(x)) : (a: any) => { value: any[]; } +>f03 : (a: T) => { value: T[]; } +>pipe(list, x => box(x)) : (a: T) => { value: T[]; } >pipe : { (ab: (...args: A) => B): (...args: A) => B; (ab: (...args: A) => B, bc: (b: B) => C): (...args: A) => C; (ab: (...args: A) => B, bc: (b: B) => C, cd: (c: C) => D): (...args: A) => D; } >list : (a: T) => T[] ->x => box(x) : (x: any[]) => { value: any[]; } ->x : any[] ->box(x) : { value: any[]; } +>x => box(x) : (x: T[]) => { value: T[]; } +>x : T[] +>box(x) : { value: T[]; } >box : (x: V) => { value: V; } ->x : any[] +>x : T[] const f04 = pipe(x => list(x), x => box(x)) >f04 : (x: any) => { value: any[]; } @@ -83,11 +83,11 @@ const f04 = pipe(x => list(x), x => box(x)) >x : any[] const f05 = pipe(list, pipe(box)); ->f05 : (a: any) => { value: any[]; } ->pipe(list, pipe(box)) : (a: any) => { value: any[]; } +>f05 : (a: T) => { value: T[]; } +>pipe(list, pipe(box)) : (a: T) => { value: T[]; } >pipe : { (ab: (...args: A) => B): (...args: A) => B; (ab: (...args: A) => B, bc: (b: B) => C): (...args: A) => C; (ab: (...args: A) => B, bc: (b: B) => C, cd: (c: C) => D): (...args: A) => D; } >list : (a: T) => T[] ->pipe(box) : (x: any[]) => { value: any[]; } +>pipe(box) : (x: T[]) => { value: T[]; } >pipe : { (ab: (...args: A) => B): (...args: A) => B; (ab: (...args: A) => B, bc: (b: B) => C): (...args: A) => C; (ab: (...args: A) => B, bc: (b: B) => C, cd: (c: C) => D): (...args: A) => D; } >box : (x: V) => { value: V; } diff --git a/tests/baselines/reference/genericTypeParameterEquivalence2.types b/tests/baselines/reference/genericTypeParameterEquivalence2.types index 1fafa5ad69d..63b9bb774f5 100644 --- a/tests/baselines/reference/genericTypeParameterEquivalence2.types +++ b/tests/baselines/reference/genericTypeParameterEquivalence2.types @@ -129,8 +129,8 @@ function curry1(f: (a: A, b: B) => C): (ax: A) => (bx: B) => C { } var cfilter = curry1(filter); ->cfilter : (ax: {}) => (bx: {}) => {}[] ->curry1(filter) : (ax: {}) => (bx: {}) => {}[] +>cfilter : (ax: (a: A) => boolean) => (bx: A[]) => A[] +>curry1(filter) : (ax: (a: A) => boolean) => (bx: A[]) => A[] >curry1 : (f: (a: A, b: B) => C) => (ax: A) => (bx: B) => C >filter : (f: (a: A) => boolean, ar: A[]) => A[] @@ -149,11 +149,11 @@ function countWhere_1(pred: (a: A) => boolean): (a: A[]) => number { >a : A[] return compose(length2, cfilter(pred)); ->compose(length2, cfilter(pred)) : (a: {}) => number +>compose(length2, cfilter(pred)) : (a: A[]) => number >compose : (f: (b: B) => C, g: (a: A) => B) => (a: A) => C >length2 : (ar: A[]) => number ->cfilter(pred) : (bx: {}) => {}[] ->cfilter : (ax: {}) => (bx: {}) => {}[] +>cfilter(pred) : (bx: A[]) => A[] +>cfilter : (ax: (a: A) => boolean) => (bx: A[]) => A[] >pred : (a: A) => boolean } @@ -164,14 +164,14 @@ function countWhere_2(pred: (a: A) => boolean): (a: A[]) => number { >a : A[] var where = cfilter(pred); ->where : (bx: {}) => {}[] ->cfilter(pred) : (bx: {}) => {}[] ->cfilter : (ax: {}) => (bx: {}) => {}[] +>where : (bx: A[]) => A[] +>cfilter(pred) : (bx: A[]) => A[] +>cfilter : (ax: (a: A) => boolean) => (bx: A[]) => A[] >pred : (a: A) => boolean return compose(length2, where); ->compose(length2, where) : (a: {}) => number +>compose(length2, where) : (a: A[]) => number >compose : (f: (b: B) => C, g: (a: A) => B) => (a: A) => C >length2 : (ar: A[]) => number ->where : (bx: {}) => {}[] +>where : (bx: A[]) => A[] }