mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
63 lines
4.3 KiB
Diff
63 lines
4.3 KiB
Diff
--- old.overloadResolution.errors.txt
|
|
+++ new.overloadResolution.errors.txt
|
|
@@= skipped -0, +0 lines =@@
|
|
overloadResolution.ts(27,5): error TS2769: No overload matches this call.
|
|
- Overload 1 of 2, '(s: string): string', gave the following error.
|
|
- Argument of type '{}' is not assignable to parameter of type 'string'.
|
|
- Overload 2 of 2, '(s: number): number', gave the following error.
|
|
+ The last overload gave the following error.
|
|
Argument of type '{}' is not assignable to parameter of type 'number'.
|
|
overloadResolution.ts(41,11): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
|
|
overloadResolution.ts(63,5): error TS2558: Expected 3 type arguments, but got 4.
|
|
@@= skipped -8, +6 lines =@@
|
|
overloadResolution.ts(71,21): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
|
|
overloadResolution.ts(81,5): error TS2344: Type 'boolean' does not satisfy the constraint 'number'.
|
|
overloadResolution.ts(84,5): error TS2769: No overload matches this call.
|
|
- Overload 1 of 2, '(n: string, m: any): any', gave the following error.
|
|
- Argument of type 'boolean' is not assignable to parameter of type 'string'.
|
|
- Overload 2 of 2, '(n: number, m: any): any', gave the following error.
|
|
+ The last overload gave the following error.
|
|
Argument of type 'boolean' is not assignable to parameter of type 'number'.
|
|
overloadResolution.ts(85,11): error TS2769: No overload matches this call.
|
|
- Overload 1 of 2, '(n: any, m: number): any', gave the following error.
|
|
- Argument of type 'boolean' is not assignable to parameter of type 'number'.
|
|
- Overload 2 of 2, '(n: any, m: string): any', gave the following error.
|
|
+ The last overload gave the following error.
|
|
Argument of type 'boolean' is not assignable to parameter of type 'string'.
|
|
overloadResolution.ts(91,5): error TS2403: Subsequent variable declarations must have the same type. Variable 'n' must be of type 'number', but here has type 'string'.
|
|
overloadResolution.ts(91,22): error TS2551: Property 'toFixed' does not exist on type 'string'. Did you mean 'fixed'?
|
|
@@= skipped -43, +39 lines =@@
|
|
fn1({}); // Error
|
|
~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 2, '(s: string): string', gave the following error.
|
|
-!!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'string'.
|
|
-!!! error TS2769: Overload 2 of 2, '(s: number): number', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Argument of type '{}' is not assignable to parameter of type 'number'.
|
|
+!!! related TS2771 overloadResolution.ts:19:10: The last overload is declared here.
|
|
|
|
// Generic and non - generic overload where generic overload is the only candidate when called with type arguments
|
|
function fn2(s: string, n: number): number;
|
|
@@= skipped -73, +72 lines =@@
|
|
fn4(true, null); // Error
|
|
~~~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 2, '(n: string, m: any): any', gave the following error.
|
|
-!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'.
|
|
-!!! error TS2769: Overload 2 of 2, '(n: number, m: any): any', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'.
|
|
+!!! related TS2771 overloadResolution.ts:67:10: The last overload is declared here.
|
|
fn4(null, true); // Error
|
|
~~~~
|
|
!!! error TS2769: No overload matches this call.
|
|
-!!! error TS2769: Overload 1 of 2, '(n: any, m: number): any', gave the following error.
|
|
-!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'number'.
|
|
-!!! error TS2769: Overload 2 of 2, '(n: any, m: string): any', gave the following error.
|
|
+!!! error TS2769: The last overload gave the following error.
|
|
!!! error TS2769: Argument of type 'boolean' is not assignable to parameter of type 'string'.
|
|
+!!! related TS2771 overloadResolution.ts:67:10: The last overload is declared here.
|
|
|
|
// Non - generic overloads where contextual typing of function arguments has errors
|
|
function fn5(f: (n: string) => void): string;
|