Skip to content

Commit 7a10043

Browse files
committed
Add tests and accept baselines
1 parent 7ed6c7a commit 7a10043

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

tests/baselines/reference/unionTypeCallSignatures.errors.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(67,12): error TS2
2828
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(68,12): error TS2346: Supplied parameters do not match any signature of call target.
2929
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(69,12): error TS2346: Supplied parameters do not match any signature of call target.
3030
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(70,12): error TS2346: Supplied parameters do not match any signature of call target.
31+
tests/cases/conformance/types/union/unionTypeCallSignatures.ts(73,12): error TS2346: Supplied parameters do not match any signature of call target.
3132

3233

33-
==== tests/cases/conformance/types/union/unionTypeCallSignatures.ts (30 errors) ====
34+
==== tests/cases/conformance/types/union/unionTypeCallSignatures.ts (31 errors) ====
3435
var numOrDate: number | Date;
3536
var strOrBoolean: string | boolean;
3637
var strOrNum: string | number;
@@ -162,4 +163,9 @@ tests/cases/conformance/types/union/unionTypeCallSignatures.ts(70,12): error TS2
162163
~~~~~~~~~~~~~~~~~~~~~~~~~
163164
!!! error TS2346: Supplied parameters do not match any signature of call target.
164165

166+
var unionWithRestParameter4: { (...a: string[]): string; } | { (a: string, b: string): number; };
167+
strOrNum = unionWithRestParameter4("hello"); // error supplied parameters do not match any call signature
168+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
169+
!!! error TS2346: Supplied parameters do not match any signature of call target.
170+
strOrNum = unionWithRestParameter4("hello", "world");
165171

tests/baselines/reference/unionTypeCallSignatures.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ strOrNum = unionWithRestParameter3('hello', 10, 11); // error no call signature
7070
strOrNum = unionWithRestParameter3('hello', "hello"); // error no call signature
7171
strOrNum = unionWithRestParameter3(); // error no call signature
7272

73+
var unionWithRestParameter4: { (...a: string[]): string; } | { (a: string, b: string): number; };
74+
strOrNum = unionWithRestParameter4("hello"); // error supplied parameters do not match any call signature
75+
strOrNum = unionWithRestParameter4("hello", "world");
7376

7477

7578
//// [unionTypeCallSignatures.js]
@@ -132,3 +135,6 @@ strOrNum = unionWithRestParameter3('hello', 10); // error no call signature
132135
strOrNum = unionWithRestParameter3('hello', 10, 11); // error no call signature
133136
strOrNum = unionWithRestParameter3('hello', "hello"); // error no call signature
134137
strOrNum = unionWithRestParameter3(); // error no call signature
138+
var unionWithRestParameter4;
139+
strOrNum = unionWithRestParameter4("hello"); // error supplied parameters do not match any call signature
140+
strOrNum = unionWithRestParameter4("hello", "world");

tests/cases/conformance/types/union/unionTypeCallSignatures.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,6 @@ strOrNum = unionWithRestParameter3('hello', 10, 11); // error no call signature
6969
strOrNum = unionWithRestParameter3('hello', "hello"); // error no call signature
7070
strOrNum = unionWithRestParameter3(); // error no call signature
7171

72+
var unionWithRestParameter4: { (...a: string[]): string; } | { (a: string, b: string): number; };
73+
strOrNum = unionWithRestParameter4("hello"); // error supplied parameters do not match any call signature
74+
strOrNum = unionWithRestParameter4("hello", "world");

0 commit comments

Comments
 (0)