-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle when associated name can be undefined
Fixes #40251
- Loading branch information
1 parent
9ed608b
commit 268a409
Showing
6 changed files
with
63 additions
and
2 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
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/parameterNamesInRestParameter.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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/index.js(2,3): error TS2684: The 'this' context of type '<T>(...items: T[]) => T[]' is not assignable to method's 'this' of type '(this: () => void) => unknown[]'. | ||
Types of parameters 'items' and 'args_0' are incompatible. | ||
Type 'any' is not assignable to type 'never'. | ||
|
||
|
||
==== /index.js (1 errors) ==== | ||
function F() { } | ||
!(Array.of.call(F) instanceof F); | ||
~~~~~~~~ | ||
!!! error TS2684: The 'this' context of type '<T>(...items: T[]) => T[]' is not assignable to method's 'this' of type '(this: () => void) => unknown[]'. | ||
!!! error TS2684: Types of parameters 'items' and 'args_0' are incompatible. | ||
!!! error TS2684: Type 'any' is not assignable to type '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,9 @@ | ||
//// [index.js] | ||
function F() { } | ||
!(Array.of.call(F) instanceof F); | ||
|
||
|
||
//// [index.js] | ||
"use strict"; | ||
function F() { } | ||
!(Array.of.call(F) instanceof F); |
13 changes: 13 additions & 0 deletions
13
tests/baselines/reference/parameterNamesInRestParameter.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,13 @@ | ||
=== /index.js === | ||
function F() { } | ||
>F : Symbol(F, Decl(index.js, 0, 0)) | ||
|
||
!(Array.of.call(F) instanceof F); | ||
>Array.of.call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) | ||
>Array.of : Symbol(ArrayConstructor.of, Decl(lib.es2015.core.d.ts, --, --)) | ||
>Array : Symbol(Array, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.core.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) | ||
>of : Symbol(ArrayConstructor.of, Decl(lib.es2015.core.d.ts, --, --)) | ||
>call : Symbol(CallableFunction.call, Decl(lib.es5.d.ts, --, --)) | ||
>F : Symbol(F, Decl(index.js, 0, 0)) | ||
>F : Symbol(F, Decl(index.js, 0, 0)) | ||
|
17 changes: 17 additions & 0 deletions
17
tests/baselines/reference/parameterNamesInRestParameter.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,17 @@ | ||
=== /index.js === | ||
function F() { } | ||
>F : () => void | ||
|
||
!(Array.of.call(F) instanceof F); | ||
>!(Array.of.call(F) instanceof F) : boolean | ||
>(Array.of.call(F) instanceof F) : boolean | ||
>Array.of.call(F) instanceof F : boolean | ||
>Array.of.call(F) : unknown[] | ||
>Array.of.call : <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R | ||
>Array.of : <T>(...items: T[]) => T[] | ||
>Array : ArrayConstructor | ||
>of : <T>(...items: T[]) => T[] | ||
>call : <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, ...args: A) => R | ||
>F : () => void | ||
>F : () => void | ||
|
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,9 @@ | ||
// @lib: es6 | ||
// @allowJs: true | ||
// @checkJs: true | ||
// @outDir: out | ||
// @strict: true | ||
|
||
// @filename: /index.js | ||
function F() { } | ||
!(Array.of.call(F) instanceof F); |