mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
336f59c5d6
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: jakebailey <[email protected]>
85 lines
6.8 KiB
Diff
85 lines
6.8 KiB
Diff
--- old.strictBindCallApply1.errors.txt
|
|
+++ new.strictBindCallApply1.errors.txt
|
|
@@= skipped -8, +8 lines =@@
|
|
Source has 3 element(s) but target allows only 2.
|
|
strictBindCallApply1.ts(41,29): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
|
|
strictBindCallApply1.ts(42,22): error TS2769: No overload matches this call.
|
|
- Overload 1 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error.
|
|
- Argument of type 'undefined' is not assignable to parameter of type 'C'.
|
|
- Overload 2 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error.
|
|
+ The last overload gave the following error.
|
|
Argument of type 'undefined' is not assignable to parameter of type 'C'.
|
|
strictBindCallApply1.ts(48,17): error TS2554: Expected 3 arguments, but got 2.
|
|
strictBindCallApply1.ts(49,29): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'.
|
|
@@= skipped -23, +21 lines =@@
|
|
strictBindCallApply1.ts(71,17): error TS2322: Type 'number' is not assignable to type 'string'.
|
|
strictBindCallApply1.ts(72,12): error TS2345: Argument of type '[number, string, number]' is not assignable to parameter of type '[a: number, b: string]'.
|
|
Source has 3 element(s) but target allows only 2.
|
|
-strictBindCallApply1.ts(76,14): error TS2769: No overload matches this call.
|
|
- Overload 1 of 2, '(this: (this: 1, ...args: T) => void, thisArg: 1): (...args: T) => void', gave the following error.
|
|
- Argument of type '2' is not assignable to parameter of type '1'.
|
|
- Overload 2 of 2, '(this: (this: 1, ...args: unknown[]) => void, thisArg: 1): (...args: unknown[]) => void', gave the following error.
|
|
+strictBindCallApply1.ts(76,5): error TS2769: No overload matches this call.
|
|
+ The last overload gave the following error.
|
|
The 'this' context of type '(this: 1, ...args: T) => void' is not assignable to method's 'this' of type '(this: 1, ...args: unknown[]) => void'.
|
|
Types of parameters 'args' and 'args' are incompatible.
|
|
Type 'unknown[]' is not assignable to type 'T'.
|
|
'unknown[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'unknown[]'.
|
|
-strictBindCallApply1.ts(81,14): error TS2769: No overload matches this call.
|
|
- Overload 1 of 2, '(this: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void, thisArg: 1): (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void', gave the following error.
|
|
- Argument of type '2' is not assignable to parameter of type '1'.
|
|
- Overload 2 of 2, '(this: (this: 1, args_0: unknown) => void, thisArg: 1): (args_0: unknown) => void', gave the following error.
|
|
+strictBindCallApply1.ts(81,5): error TS2769: No overload matches this call.
|
|
+ The last overload gave the following error.
|
|
The 'this' context of type '(this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void' is not assignable to method's 'this' of type '(this: 1, args_0: unknown) => void'.
|
|
Types of parameters 'args' and 'args_0' are incompatible.
|
|
Type '[unknown]' is not assignable to type 'T extends 1 ? [unknown] : [unknown, unknown]'.
|
|
@@= skipped -80, +76 lines =@@
|
|
let f14 = c.foo.bind(undefined); // Error
|
|
~~~~~~~~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error.
|
|
-!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'C'.
|
|
-!!! error TS2769: Overload 2 of 2, '(this: (this: C, a: number, b: string) => string, thisArg: C): (a: number, b: string) => string', gave the following error.
|
|
-!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'C'.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
+!!! error TS2769: Argument of type 'undefined' is not assignable to parameter of type 'C'.
|
|
+!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here.
|
|
|
|
let f15 = c.overloaded.bind(c); // typeof C.prototype.overloaded
|
|
let f16 = c.generic.bind(c); // typeof C.prototype.generic
|
|
@@= skipped -72, +71 lines =@@
|
|
function bar<T extends unknown[]>(callback: (this: 1, ...args: T) => void) {
|
|
callback.bind(1);
|
|
callback.bind(2); // Error
|
|
- ~~~~
|
|
+ ~~~~~~~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 2, '(this: (this: 1, ...args: T) => void, thisArg: 1): (...args: T) => void', gave the following error.
|
|
-!!! error TS2769: Argument of type '2' is not assignable to parameter of type '1'.
|
|
-!!! error TS2769: Overload 2 of 2, '(this: (this: 1, ...args: unknown[]) => void, thisArg: 1): (...args: unknown[]) => void', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: The 'this' context of type '(this: 1, ...args: T) => void' is not assignable to method's 'this' of type '(this: 1, ...args: unknown[]) => void'.
|
|
!!! error TS2769: Types of parameters 'args' and 'args' are incompatible.
|
|
!!! error TS2769: Type 'unknown[]' is not assignable to type 'T'.
|
|
!!! error TS2769: 'unknown[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'unknown[]'.
|
|
+!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here.
|
|
}
|
|
|
|
function baz<T extends 1 | 2>(callback: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void) {
|
|
callback.bind(1);
|
|
callback.bind(2); // Error
|
|
- ~~~~
|
|
+ ~~~~~~~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 2, '(this: (this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void, thisArg: 1): (...args: T extends 1 ? [unknown] : [unknown, unknown]) => void', gave the following error.
|
|
-!!! error TS2769: Argument of type '2' is not assignable to parameter of type '1'.
|
|
-!!! error TS2769: Overload 2 of 2, '(this: (this: 1, args_0: unknown) => void, thisArg: 1): (args_0: unknown) => void', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: The 'this' context of type '(this: 1, ...args: T extends 1 ? [unknown] : [unknown, unknown]) => void' is not assignable to method's 'this' of type '(this: 1, args_0: unknown) => void'.
|
|
!!! error TS2769: Types of parameters 'args' and 'args_0' are incompatible.
|
|
!!! error TS2769: Type '[unknown]' is not assignable to type 'T extends 1 ? [unknown] : [unknown, unknown]'.
|
|
+!!! related TS2771 lib.es5.d.ts:--:--: The last overload is declared here.
|
|
}
|
|
|
|
// Repro from #32964
|