Files

62 lines
4.9 KiB
Diff

--- old.genericRestParameters3.errors.txt
+++ new.genericRestParameters3.errors.txt
@@= skipped -18, +18 lines =@@
genericRestParameters3.ts(37,21): error TS2345: Argument of type '<T extends any[]>(cb: (...args: T) => void) => void' is not assignable to parameter of type '(...args: CoolArray<any>) => void'.
Types of parameters 'cb' and 'args' are incompatible.
Property '0' is missing in type 'CoolArray<any>' but required in type '[cb: (...args: any[]) => void]'.
-genericRestParameters3.ts(44,32): error TS2345: Argument of type '[10, 20]' is not assignable to parameter of type 'CoolArray<number>'.
- Property 'hello' is missing in type '[10, 20]' but required in type 'CoolArray<number>'.
-genericRestParameters3.ts(49,1): error TS2345: Argument of type '[]' is not assignable to parameter of type 'CoolArray<never>'.
- Property 'hello' is missing in type '[]' but required in type 'CoolArray<never>'.
-genericRestParameters3.ts(50,5): error TS2345: Argument of type '[number]' is not assignable to parameter of type 'CoolArray<unknown>'.
- Property 'hello' is missing in type '[number]' but required in type 'CoolArray<unknown>'.
-genericRestParameters3.ts(51,5): error TS2345: Argument of type '[number, number]' is not assignable to parameter of type 'CoolArray<unknown>'.
- Property 'hello' is missing in type '[number, number]' but required in type 'CoolArray<unknown>'.
-genericRestParameters3.ts(52,5): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'CoolArray<number>'.
- Property 'hello' is missing in type 'number[]' but required in type 'CoolArray<number>'.
+genericRestParameters3.ts(44,32): error TS2741: Property 'hello' is missing in type '[10, 20]' but required in type 'CoolArray<number>'.
+genericRestParameters3.ts(49,1): error TS2741: Property 'hello' is missing in type '[]' but required in type 'CoolArray<never>'.
+genericRestParameters3.ts(50,5): error TS2741: Property 'hello' is missing in type '[number]' but required in type 'CoolArray<unknown>'.
+genericRestParameters3.ts(51,5): error TS2741: Property 'hello' is missing in type '[number, number]' but required in type 'CoolArray<unknown>'.
+genericRestParameters3.ts(52,5): error TS2741: Property 'hello' is missing in type 'number[]' but required in type 'CoolArray<number>'.
genericRestParameters3.ts(59,5): error TS2345: Argument of type '["what"]' is not assignable to parameter of type '[] | [number, string]'.
Type '["what"]' is not assignable to type '[number, string]'.
Source has 1 element(s) but target requires 2.
@@= skipped -90, +85 lines =@@
let a = bar(10, 20);
let b = bar<CoolArray<number>>(10, 20); // Error
~~~~~~
-!!! error TS2345: Argument of type '[10, 20]' is not assignable to parameter of type 'CoolArray<number>'.
-!!! error TS2345: Property 'hello' is missing in type '[10, 20]' but required in type 'CoolArray<number>'.
+!!! error TS2741: Property 'hello' is missing in type '[10, 20]' but required in type 'CoolArray<number>'.
!!! related TS2728 genericRestParameters3.ts:30:5: 'hello' is declared here.
declare function baz<T>(...args: CoolArray<T>): void;
@@= skipped -9, +8 lines =@@
baz(); // Error
~~~~~
-!!! error TS2345: Argument of type '[]' is not assignable to parameter of type 'CoolArray<never>'.
-!!! error TS2345: Property 'hello' is missing in type '[]' but required in type 'CoolArray<never>'.
+!!! error TS2741: Property 'hello' is missing in type '[]' but required in type 'CoolArray<never>'.
!!! related TS2728 genericRestParameters3.ts:30:5: 'hello' is declared here.
baz(1); // Error
~
-!!! error TS2345: Argument of type '[number]' is not assignable to parameter of type 'CoolArray<unknown>'.
-!!! error TS2345: Property 'hello' is missing in type '[number]' but required in type 'CoolArray<unknown>'.
+!!! error TS2741: Property 'hello' is missing in type '[number]' but required in type 'CoolArray<unknown>'.
!!! related TS2728 genericRestParameters3.ts:30:5: 'hello' is declared here.
baz(1, 2); // Error
~~~~
-!!! error TS2345: Argument of type '[number, number]' is not assignable to parameter of type 'CoolArray<unknown>'.
-!!! error TS2345: Property 'hello' is missing in type '[number, number]' but required in type 'CoolArray<unknown>'.
+!!! error TS2741: Property 'hello' is missing in type '[number, number]' but required in type 'CoolArray<unknown>'.
!!! related TS2728 genericRestParameters3.ts:30:5: 'hello' is declared here.
baz(...ca); // Error
~~~~~
-!!! error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'CoolArray<number>'.
-!!! error TS2345: Property 'hello' is missing in type 'number[]' but required in type 'CoolArray<number>'.
+!!! error TS2741: Property 'hello' is missing in type 'number[]' but required in type 'CoolArray<number>'.
!!! related TS2728 genericRestParameters3.ts:30:5: 'hello' is declared here.
// Repro from #26491