From 36be6c8b6859ea5b8a18e375609133311fd0cce3 Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Mon, 11 Feb 2019 09:41:38 -0800 Subject: [PATCH] Accept new baselines --- .../restTuplesFromContextualTypes.errors.txt | 12 ++++++------ .../reference/restTuplesFromContextualTypes.types | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/baselines/reference/restTuplesFromContextualTypes.errors.txt b/tests/baselines/reference/restTuplesFromContextualTypes.errors.txt index d2246fbfd84..7af71017a71 100644 --- a/tests/baselines/reference/restTuplesFromContextualTypes.errors.txt +++ b/tests/baselines/reference/restTuplesFromContextualTypes.errors.txt @@ -1,7 +1,7 @@ -tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts(56,7): error TS2345: Argument of type '(a: number, b: any, ...x: any[]) => void' is not assignable to parameter of type '(x: number, ...args: T) => void'. +tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts(56,7): error TS2345: Argument of type '(a: number, b: T[0], ...x: T[number][]) => void' is not assignable to parameter of type '(x: number, ...args: T) => void'. Types of parameters 'b' and 'args' are incompatible. - Type 'T' is not assignable to type '[any, ...any[]]'. - Property '0' is missing in type 'any[]' but required in type '[any, ...any[]]'. + Type 'T' is not assignable to type '[T[0], ...T[number][]]'. + Property '0' is missing in type 'any[]' but required in type '[T[0], ...T[number][]]'. ==== tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts (1 errors) ==== @@ -62,10 +62,10 @@ tests/cases/conformance/types/rest/restTuplesFromContextualTypes.ts(56,7): error f((a, ...x) => {}); f((a, b, ...x) => {}); ~~~~~~~~~~~~~~~~~~ -!!! error TS2345: Argument of type '(a: number, b: any, ...x: any[]) => void' is not assignable to parameter of type '(x: number, ...args: T) => void'. +!!! error TS2345: Argument of type '(a: number, b: T[0], ...x: T[number][]) => void' is not assignable to parameter of type '(x: number, ...args: T) => void'. !!! error TS2345: Types of parameters 'b' and 'args' are incompatible. -!!! error TS2345: Type 'T' is not assignable to type '[any, ...any[]]'. -!!! error TS2345: Property '0' is missing in type 'any[]' but required in type '[any, ...any[]]'. +!!! error TS2345: Type 'T' is not assignable to type '[T[0], ...T[number][]]'. +!!! error TS2345: Property '0' is missing in type 'any[]' but required in type '[T[0], ...T[number][]]'. } // Repro from #25288 diff --git a/tests/baselines/reference/restTuplesFromContextualTypes.types b/tests/baselines/reference/restTuplesFromContextualTypes.types index ee63057b9eb..ad5a4788426 100644 --- a/tests/baselines/reference/restTuplesFromContextualTypes.types +++ b/tests/baselines/reference/restTuplesFromContextualTypes.types @@ -332,8 +332,8 @@ function f4(t: T) { f((...x) => {}); >f((...x) => {}) : void >f : (cb: (x: number, ...args: T) => void) => void ->(...x) => {} : (x: number, ...args: any[]) => void ->x : [number, ...any[]] +>(...x) => {} : (x: number, ...args: T[number][]) => void +>x : [number, ...T[number][]] f((a, ...x) => {}); >f((a, ...x) => {}) : void @@ -345,10 +345,10 @@ function f4(t: T) { f((a, b, ...x) => {}); >f((a, b, ...x) => {}) : void >f : (cb: (x: number, ...args: T) => void) => void ->(a, b, ...x) => {} : (a: number, b: any, ...x: any[]) => void +>(a, b, ...x) => {} : (a: number, b: T[0], ...x: T[number][]) => void >a : number ->b : any ->x : any[] +>b : T[0] +>x : T[number][] } // Repro from #25288