forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added simplified version of bugfix for microsoft#19220
- Loading branch information
Showing
9 changed files
with
127 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 25 additions & 46 deletions
71
tests/baselines/reference/functionParameterArityMismatch.errors.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,39 @@ | ||
tests/cases/compiler/functionParameterArityMismatch.ts(3,1): error TS2555: Expected at least 1 arguments, but got 0. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(4,1): error TS2572: Expected 1 or 3 arguments but got 2. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(5,1): error TS2571: Expected no more than 3 arguments but got 4. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(9,1): error TS2573: No overload expects 2 arguments. The most likely overloads that match expect either 0-1 arguments or at least 3 arguments. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(14,1): error TS2573: No overload expects 1 arguments. The most likely overloads that match expect either 0 arguments or at least 2 arguments. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(15,1): error TS2574: No overload expects 3 arguments. The most likely overloads that match expect either up to 2 arguments or 4-5 arguments. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(20,1): error TS2573: No overload expects 1 arguments. The most likely overloads that match expect either 0 arguments or at least 2 arguments. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(21,1): error TS2575: No overload expects 3 arguments. The most likely overloads that match expect either up to 2 arguments or at least 4 arguments. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(25,1): error TS2572: Expected 0-2 or 4-5 arguments but got 3. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(26,1): error TS2571: Expected no more than 5 arguments but got 6. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(3,1): error TS2554: Expected 1-3 arguments, but got 0. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(4,1): error TS2571: No overload expects 2 arguments. The most likely overloads that match expect either 1 arguments or at least 3 arguments. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(5,1): error TS2554: Expected 1-3 arguments, but got 4. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(11,1): error TS2571: No overload expects 1 arguments. The most likely overloads that match expect either 0 arguments or at least 2 arguments. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(12,1): error TS2571: No overload expects 3 arguments. The most likely overloads that match expect either 2 arguments or at least 4 arguments. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(13,1): error TS2571: No overload expects 5 arguments. The most likely overloads that match expect either 4 arguments or at least 6 arguments. | ||
tests/cases/compiler/functionParameterArityMismatch.ts(14,1): error TS2554: Expected 0-6 arguments, but got 7. | ||
|
||
|
||
==== tests/cases/compiler/functionParameterArityMismatch.ts (10 errors) ==== | ||
==== tests/cases/compiler/functionParameterArityMismatch.ts (7 errors) ==== | ||
declare function f1(a: number); | ||
declare function f1(a: number, b: number, c: number); | ||
f1(); | ||
~~~~ | ||
!!! error TS2555: Expected at least 1 arguments, but got 0. | ||
!!! error TS2554: Expected 1-3 arguments, but got 0. | ||
f1(1, 2); | ||
~~~~~~~~ | ||
!!! error TS2572: Expected 1 or 3 arguments but got 2. | ||
!!! error TS2571: No overload expects 2 arguments. The most likely overloads that match expect either 1 arguments or at least 3 arguments. | ||
f1(1, 2, 3, 4); | ||
~~~~~~~~~~~~~~ | ||
!!! error TS2571: Expected no more than 3 arguments but got 4. | ||
!!! error TS2554: Expected 1-3 arguments, but got 4. | ||
|
||
declare function f2(a?: number); | ||
declare function f2(a: number, b: number, c: number, ...d: number[]); | ||
f2(1, 2); | ||
~~~~~~~~ | ||
!!! error TS2573: No overload expects 2 arguments. The most likely overloads that match expect either 0-1 arguments or at least 3 arguments. | ||
|
||
declare function f3(); | ||
declare function f3(a: number, b: number); | ||
declare function f3(a: number, b: number, c: number, d: number, e?: number); | ||
f3(1); | ||
declare function f2(); | ||
declare function f2(a: number, b: number); | ||
declare function f2(a: number, b: number, c: number, d: number); | ||
declare function f2(a: number, b: number, c: number, d: number, e: number, f: number); | ||
f2(1); | ||
~~~~~ | ||
!!! error TS2573: No overload expects 1 arguments. The most likely overloads that match expect either 0 arguments or at least 2 arguments. | ||
f3(1, 2, 3); | ||
~~~~~~~~~~~ | ||
!!! error TS2574: No overload expects 3 arguments. The most likely overloads that match expect either up to 2 arguments or 4-5 arguments. | ||
|
||
declare function f4(); | ||
declare function f4(a: number, b: number); | ||
declare function f4(a: number, b: number, c: number, d: number, ...e: number[]); | ||
f4(1); | ||
~~~~~ | ||
!!! error TS2573: No overload expects 1 arguments. The most likely overloads that match expect either 0 arguments or at least 2 arguments. | ||
f4(1, 2, 3); | ||
~~~~~~~~~~~ | ||
!!! error TS2575: No overload expects 3 arguments. The most likely overloads that match expect either up to 2 arguments or at least 4 arguments. | ||
|
||
declare function f5(a?: number, b?: number); | ||
declare function f5(a: number, b: number, c: number, d: number, e?: number); | ||
f5(1, 2, 3); | ||
!!! error TS2571: No overload expects 1 arguments. The most likely overloads that match expect either 0 arguments or at least 2 arguments. | ||
f2(1, 2, 3); | ||
~~~~~~~~~~~ | ||
!!! error TS2572: Expected 0-2 or 4-5 arguments but got 3. | ||
f5(1, 2, 3, 4, 5, 6); | ||
~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2571: Expected no more than 5 arguments but got 6. | ||
!!! error TS2571: No overload expects 3 arguments. The most likely overloads that match expect either 2 arguments or at least 4 arguments. | ||
f2(1, 2, 3, 4, 5); | ||
~~~~~~~~~~~~~~~~~ | ||
!!! error TS2571: No overload expects 5 arguments. The most likely overloads that match expect either 4 arguments or at least 6 arguments. | ||
f2(1, 2, 3, 4, 5, 6, 7); | ||
~~~~~~~~~~~~~~~~~~~~~~~ | ||
!!! error TS2554: Expected 0-6 arguments, but got 7. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.