-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't relate unmatched parameter positions in signatures (#41308)
* Don't relate unmatched parameter positions in signatures * Add regression test * Accept new baselines
- Loading branch information
1 parent
3eed4a6
commit bd27bd8
Showing
5 changed files
with
82 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//// [unmatchedParameterPositions.ts] | ||
// Repros from #40251 | ||
|
||
declare let s: (...items: never[]) => never[]; | ||
let t1: () => unknown[] = s; | ||
let t2: (...args: []) => unknown[] = s; | ||
|
||
|
||
//// [unmatchedParameterPositions.js] | ||
"use strict"; | ||
// Repros from #40251 | ||
var t1 = s; | ||
var t2 = s; |
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/unmatchedParameterPositions.symbols
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
=== tests/cases/compiler/unmatchedParameterPositions.ts === | ||
// Repros from #40251 | ||
|
||
declare let s: (...items: never[]) => never[]; | ||
>s : Symbol(s, Decl(unmatchedParameterPositions.ts, 2, 11)) | ||
>items : Symbol(items, Decl(unmatchedParameterPositions.ts, 2, 16)) | ||
|
||
let t1: () => unknown[] = s; | ||
>t1 : Symbol(t1, Decl(unmatchedParameterPositions.ts, 3, 3)) | ||
>s : Symbol(s, Decl(unmatchedParameterPositions.ts, 2, 11)) | ||
|
||
let t2: (...args: []) => unknown[] = s; | ||
>t2 : Symbol(t2, Decl(unmatchedParameterPositions.ts, 4, 3)) | ||
>args : Symbol(args, Decl(unmatchedParameterPositions.ts, 4, 9)) | ||
>s : Symbol(s, Decl(unmatchedParameterPositions.ts, 2, 11)) | ||
|
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/unmatchedParameterPositions.types
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
=== tests/cases/compiler/unmatchedParameterPositions.ts === | ||
// Repros from #40251 | ||
|
||
declare let s: (...items: never[]) => never[]; | ||
>s : (...items: never[]) => never[] | ||
>items : never[] | ||
|
||
let t1: () => unknown[] = s; | ||
>t1 : () => unknown[] | ||
>s : (...items: never[]) => never[] | ||
|
||
let t2: (...args: []) => unknown[] = s; | ||
>t2 : () => unknown[] | ||
>args : [] | ||
>s : (...items: never[]) => never[] | ||
|
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// @strict: true | ||
|
||
// Repros from #40251 | ||
|
||
declare let s: (...items: never[]) => never[]; | ||
let t1: () => unknown[] = s; | ||
let t2: (...args: []) => unknown[] = s; |