-
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.
Add signature restriction for __spreadArray
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 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
16 changes: 16 additions & 0 deletions
16
tests/baselines/reference/arraySpreadImportHelpers.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,16 @@ | ||
tests/cases/conformance/es6/spread/main.ts(3,15): error TS2807: This syntax requires an imported helper named '__spreadArray' with 3 parameters, which is not compatible with the one in 'tslib'. Consider upgrading your version of 'tslib'. | ||
|
||
|
||
==== tests/cases/conformance/es6/spread/main.ts (1 errors) ==== | ||
export {}; | ||
const k = [1, , 2]; | ||
const o = [3, ...k, 4]; | ||
~~~~ | ||
!!! error TS2807: This syntax requires an imported helper named '__spreadArray' with 3 parameters, which is not compatible with the one in 'tslib'. Consider upgrading your version of 'tslib'. | ||
|
||
==== tests/cases/conformance/es6/spread/tslib.d.ts (0 errors) ==== | ||
// this is a pre-TS4.4 versions of emit helper, which always forced array packing | ||
declare module "tslib" { | ||
function __spreadArray(to: any[], from: any[]): any[]; | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
tests/cases/conformance/es6/spread/arraySpreadImportHelpers.ts
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 @@ | ||
// @target: es5 | ||
// @importHelpers: true | ||
// @isolatedModules: true | ||
// @noTypesAndSymbols: true | ||
// @noEmit: true | ||
// @filename: main.ts | ||
|
||
export {}; | ||
const k = [1, , 2]; | ||
const o = [3, ...k, 4]; | ||
|
||
// @filename: tslib.d.ts | ||
// this is a pre-TS4.4 versions of emit helper, which always forced array packing | ||
declare module "tslib" { | ||
function __spreadArray(to: any[], from: any[]): any[]; | ||
} |