mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #28456 from Microsoft/nonExperimentalBigInt
BigInt shouldn't be considered experimental
This commit is contained in:
@@ -30642,13 +30642,10 @@ namespace ts {
|
||||
isPrefixUnaryExpression(node.parent) && isLiteralTypeNode(node.parent.parent);
|
||||
if (!literalType) {
|
||||
if (languageVersion < ScriptTarget.ESNext) {
|
||||
if (grammarErrorOnNode(node, Diagnostics.BigInt_literals_are_not_available_when_targetting_lower_than_ESNext)) {
|
||||
if (grammarErrorOnNode(node, Diagnostics.BigInt_literals_are_not_available_when_targeting_lower_than_ESNext)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (!compilerOptions.experimentalBigInt) {
|
||||
return grammarErrorOnNode(node, Diagnostics.Experimental_support_for_BigInt_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalBigInt_option_to_remove_this_warning);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -584,12 +584,6 @@ namespace ts {
|
||||
category: Diagnostics.Experimental_Options,
|
||||
description: Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators
|
||||
},
|
||||
{
|
||||
name: "experimentalBigInt",
|
||||
type: "boolean",
|
||||
category: Diagnostics.Experimental_Options,
|
||||
description: Diagnostics.Enables_experimental_support_for_ESNext_BigInt_literals
|
||||
},
|
||||
|
||||
// Advanced
|
||||
{
|
||||
|
||||
@@ -1011,10 +1011,6 @@
|
||||
"category": "Message",
|
||||
"code": 1350
|
||||
},
|
||||
"Experimental support for BigInt is a feature that is subject to change in a future release. Set the 'experimentalBigInt' option to remove this warning.": {
|
||||
"category": "Error",
|
||||
"code": 1351
|
||||
},
|
||||
|
||||
"Duplicate identifier '{0}'.": {
|
||||
"category": "Error",
|
||||
@@ -2505,7 +2501,7 @@
|
||||
"category": "Error",
|
||||
"code": 2736
|
||||
},
|
||||
"BigInt literals are not available when targetting lower than ESNext.": {
|
||||
"BigInt literals are not available when targeting lower than ESNext.": {
|
||||
"category": "Error",
|
||||
"code": 2737
|
||||
},
|
||||
@@ -3933,10 +3929,6 @@
|
||||
"category": "Error",
|
||||
"code": 6370
|
||||
},
|
||||
"Enables experimental support for ESNext BigInt literals.": {
|
||||
"category": "Message",
|
||||
"code": 6371
|
||||
},
|
||||
|
||||
"The expected type comes from property '{0}' which is declared here on type '{1}'": {
|
||||
"category": "Message",
|
||||
|
||||
@@ -4495,7 +4495,6 @@ namespace ts {
|
||||
downlevelIteration?: boolean;
|
||||
emitBOM?: boolean;
|
||||
emitDecoratorMetadata?: boolean;
|
||||
experimentalBigInt?: boolean;
|
||||
experimentalDecorators?: boolean;
|
||||
forceConsistentCasingInFileNames?: boolean;
|
||||
/*@internal*/help?: boolean;
|
||||
|
||||
@@ -2450,7 +2450,6 @@ declare namespace ts {
|
||||
downlevelIteration?: boolean;
|
||||
emitBOM?: boolean;
|
||||
emitDecoratorMetadata?: boolean;
|
||||
experimentalBigInt?: boolean;
|
||||
experimentalDecorators?: boolean;
|
||||
forceConsistentCasingInFileNames?: boolean;
|
||||
importHelpers?: boolean;
|
||||
|
||||
@@ -2450,7 +2450,6 @@ declare namespace ts {
|
||||
downlevelIteration?: boolean;
|
||||
emitBOM?: boolean;
|
||||
emitDecoratorMetadata?: boolean;
|
||||
experimentalBigInt?: boolean;
|
||||
experimentalDecorators?: boolean;
|
||||
forceConsistentCasingInFileNames?: boolean;
|
||||
importHelpers?: boolean;
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
tests/cases/compiler/bigIntWithTargetES3.ts(5,22): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
tests/cases/compiler/bigIntWithTargetES3.ts(5,29): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
tests/cases/compiler/bigIntWithTargetES3.ts(5,39): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
tests/cases/compiler/bigIntWithTargetES3.ts(5,48): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
|
||||
|
||||
==== tests/cases/compiler/bigIntWithTargetES3.ts (4 errors) ====
|
||||
const normalNumber = 123; // should not error
|
||||
let bigintType: bigint; // should not error
|
||||
let bigintLiteralType: 123n; // should not error when used as type
|
||||
let bigintNegativeLiteralType: -123n; // should not error when used as type
|
||||
const bigintNumber = 123n * 0b1111n + 0o444n * 0x7fn; // each literal should error
|
||||
~~~~
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
~~~~~~~
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
~~~~~~
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
~~~~~
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
//// [bigIntWithTargetES3.ts]
|
||||
const normalNumber = 123; // should not error
|
||||
let bigintType: bigint; // should not error
|
||||
let bigintLiteralType: 123n; // should not error when used as type
|
||||
let bigintNegativeLiteralType: -123n; // should not error when used as type
|
||||
const bigintNumber = 123n * 0b1111n + 0o444n * 0x7fn; // each literal should error
|
||||
|
||||
|
||||
//// [bigIntWithTargetES3.js]
|
||||
var normalNumber = 123; // should not error
|
||||
var bigintType; // should not error
|
||||
var bigintLiteralType; // should not error when used as type
|
||||
var bigintNegativeLiteralType; // should not error when used as type
|
||||
var bigintNumber = 123n * 15n + 292n * 0x7fn; // each literal should error
|
||||
@@ -0,0 +1,16 @@
|
||||
=== tests/cases/compiler/bigIntWithTargetES3.ts ===
|
||||
const normalNumber = 123; // should not error
|
||||
>normalNumber : Symbol(normalNumber, Decl(bigIntWithTargetES3.ts, 0, 5))
|
||||
|
||||
let bigintType: bigint; // should not error
|
||||
>bigintType : Symbol(bigintType, Decl(bigIntWithTargetES3.ts, 1, 3))
|
||||
|
||||
let bigintLiteralType: 123n; // should not error when used as type
|
||||
>bigintLiteralType : Symbol(bigintLiteralType, Decl(bigIntWithTargetES3.ts, 2, 3))
|
||||
|
||||
let bigintNegativeLiteralType: -123n; // should not error when used as type
|
||||
>bigintNegativeLiteralType : Symbol(bigintNegativeLiteralType, Decl(bigIntWithTargetES3.ts, 3, 3))
|
||||
|
||||
const bigintNumber = 123n * 0b1111n + 0o444n * 0x7fn; // each literal should error
|
||||
>bigintNumber : Symbol(bigintNumber, Decl(bigIntWithTargetES3.ts, 4, 5))
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
=== tests/cases/compiler/bigIntWithTargetES3.ts ===
|
||||
const normalNumber = 123; // should not error
|
||||
>normalNumber : 123
|
||||
>123 : 123
|
||||
|
||||
let bigintType: bigint; // should not error
|
||||
>bigintType : bigint
|
||||
|
||||
let bigintLiteralType: 123n; // should not error when used as type
|
||||
>bigintLiteralType : 123n
|
||||
|
||||
let bigintNegativeLiteralType: -123n; // should not error when used as type
|
||||
>bigintNegativeLiteralType : -123n
|
||||
>-123n : -123n
|
||||
>123n : 123n
|
||||
|
||||
const bigintNumber = 123n * 0b1111n + 0o444n * 0x7fn; // each literal should error
|
||||
>bigintNumber : bigint
|
||||
>123n * 0b1111n + 0o444n * 0x7fn : bigint
|
||||
>123n * 0b1111n : bigint
|
||||
>123n : 123n
|
||||
>0b1111n : 15n
|
||||
>0o444n * 0x7fn : bigint
|
||||
>0o444n : 292n
|
||||
>0x7fn : 127n
|
||||
|
||||
@@ -2,18 +2,18 @@ tests/cases/compiler/bigintWithoutLib.ts(4,25): error TS2304: Cannot find name '
|
||||
tests/cases/compiler/bigintWithoutLib.ts(5,13): error TS2304: Cannot find name 'BigInt'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(6,5): error TS2304: Cannot find name 'BigInt'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(7,13): error TS2304: Cannot find name 'BigInt'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(7,30): error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(7,30): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(8,13): error TS2304: Cannot find name 'BigInt'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(8,31): error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(8,31): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(9,1): error TS2322: Type 'Object' is not assignable to type 'bigint'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(11,13): error TS2554: Expected 0 arguments, but got 1.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(15,18): error TS2304: Cannot find name 'BigInt64Array'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(15,38): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'?
|
||||
tests/cases/compiler/bigintWithoutLib.ts(16,19): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'?
|
||||
tests/cases/compiler/bigintWithoutLib.ts(17,19): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'?
|
||||
tests/cases/compiler/bigintWithoutLib.ts(17,34): error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(17,38): error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(17,42): error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(17,34): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(17,38): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(17,42): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(18,19): error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'?
|
||||
tests/cases/compiler/bigintWithoutLib.ts(19,19): error TS2304: Cannot find name 'BigInt64Array'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(20,19): error TS2304: Cannot find name 'BigInt64Array'.
|
||||
@@ -22,22 +22,22 @@ tests/cases/compiler/bigintWithoutLib.ts(27,19): error TS2304: Cannot find name
|
||||
tests/cases/compiler/bigintWithoutLib.ts(27,40): error TS2304: Cannot find name 'BigUint64Array'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(28,20): error TS2304: Cannot find name 'BigUint64Array'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(29,20): error TS2304: Cannot find name 'BigUint64Array'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(29,36): error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(29,40): error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(29,44): error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(29,36): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(29,40): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(29,44): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(30,20): error TS2304: Cannot find name 'BigUint64Array'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(31,20): error TS2304: Cannot find name 'BigUint64Array'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(32,20): error TS2304: Cannot find name 'BigUint64Array'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(33,20): error TS2304: Cannot find name 'BigUint64Array'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(40,10): error TS2339: Property 'setBigInt64' does not exist on type 'DataView'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(40,26): error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(40,26): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(41,10): error TS2339: Property 'setBigInt64' does not exist on type 'DataView'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(41,26): error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(41,26): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(42,10): error TS2339: Property 'setBigInt64' does not exist on type 'DataView'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(43,10): error TS2339: Property 'setBigUint64' does not exist on type 'DataView'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(43,26): error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(43,26): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(44,10): error TS2339: Property 'setBigUint64' does not exist on type 'DataView'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(44,26): error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(44,26): error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(45,10): error TS2339: Property 'setBigUint64' does not exist on type 'DataView'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(46,22): error TS2339: Property 'getBigInt64' does not exist on type 'DataView'.
|
||||
tests/cases/compiler/bigintWithoutLib.ts(47,22): error TS2339: Property 'getBigInt64' does not exist on type 'DataView'.
|
||||
@@ -62,12 +62,12 @@ tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigU
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'BigInt'.
|
||||
~~~~~~~
|
||||
!!! error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
bigintVal = BigInt.asUintN(8, 0xFFFFn);
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'BigInt'.
|
||||
~~~~~~~
|
||||
!!! error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
bigintVal = bigintVal.valueOf(); // should error - bigintVal inferred as {}
|
||||
~~~~~~~~~
|
||||
!!! error TS2322: Type 'Object' is not assignable to type 'bigint'.
|
||||
@@ -93,11 +93,11 @@ tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigU
|
||||
!!! error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'?
|
||||
!!! related TS2728 tests/cases/compiler/bigintWithoutLib.ts:15:5: 'bigIntArray' is declared here.
|
||||
~~
|
||||
!!! error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
~~
|
||||
!!! error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
~~
|
||||
!!! error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
bigIntArray = new BigInt64Array([1, 2, 3]);
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2552: Cannot find name 'BigInt64Array'. Did you mean 'bigIntArray'?
|
||||
@@ -128,11 +128,11 @@ tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigU
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'BigUint64Array'.
|
||||
~~
|
||||
!!! error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
~~
|
||||
!!! error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
~~
|
||||
!!! error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
bigUintArray = new BigUint64Array([1, 2, 3]);
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'BigUint64Array'.
|
||||
@@ -155,12 +155,12 @@ tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigU
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2339: Property 'setBigInt64' does not exist on type 'DataView'.
|
||||
~~
|
||||
!!! error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
dataView.setBigInt64(1, -1n, true);
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2339: Property 'setBigInt64' does not exist on type 'DataView'.
|
||||
~~
|
||||
!!! error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
dataView.setBigInt64(1, -1);
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2339: Property 'setBigInt64' does not exist on type 'DataView'.
|
||||
@@ -168,12 +168,12 @@ tests/cases/compiler/bigintWithoutLib.ts(49,22): error TS2339: Property 'getBigU
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2339: Property 'setBigUint64' does not exist on type 'DataView'.
|
||||
~~~~
|
||||
!!! error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
dataView.setBigUint64(2, 123n, true);
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2339: Property 'setBigUint64' does not exist on type 'DataView'.
|
||||
~~~~
|
||||
!!! error TS2737: BigInt literals are not available when targetting lower than ESNext.
|
||||
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
|
||||
dataView.setBigUint64(2, 123);
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2339: Property 'setBigUint64' does not exist on type 'DataView'.
|
||||
|
||||
@@ -56,6 +56,5 @@
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
// "experimentalBigInt": true, /* Enables experimental support for ESNext BigInt literals. */
|
||||
}
|
||||
}
|
||||
-1
@@ -56,7 +56,6 @@
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
// "experimentalBigInt": true, /* Enables experimental support for ESNext BigInt literals. */
|
||||
|
||||
/* Advanced Options */
|
||||
"noErrorTruncation": true, /* Do not truncate error messages. */
|
||||
|
||||
-1
@@ -56,6 +56,5 @@
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
// "experimentalBigInt": true, /* Enables experimental support for ESNext BigInt literals. */
|
||||
}
|
||||
}
|
||||
-1
@@ -56,6 +56,5 @@
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
// "experimentalBigInt": true, /* Enables experimental support for ESNext BigInt literals. */
|
||||
}
|
||||
}
|
||||
-1
@@ -56,7 +56,6 @@
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
// "experimentalBigInt": true, /* Enables experimental support for ESNext BigInt literals. */
|
||||
},
|
||||
"files": [
|
||||
"file0.st",
|
||||
|
||||
-1
@@ -56,6 +56,5 @@
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
// "experimentalBigInt": true, /* Enables experimental support for ESNext BigInt literals. */
|
||||
}
|
||||
}
|
||||
-1
@@ -56,6 +56,5 @@
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
// "experimentalBigInt": true, /* Enables experimental support for ESNext BigInt literals. */
|
||||
}
|
||||
}
|
||||
-1
@@ -56,6 +56,5 @@
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
// "experimentalBigInt": true, /* Enables experimental support for ESNext BigInt literals. */
|
||||
}
|
||||
}
|
||||
-1
@@ -56,6 +56,5 @@
|
||||
/* Experimental Options */
|
||||
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
||||
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
||||
// "experimentalBigInt": true, /* Enables experimental support for ESNext BigInt literals. */
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
tests/cases/compiler/warnExperimentalBigIntLiteral.ts(5,22): error TS1351: Experimental support for BigInt is a feature that is subject to change in a future release. Set the 'experimentalBigInt' option to remove this warning.
|
||||
tests/cases/compiler/warnExperimentalBigIntLiteral.ts(5,29): error TS1351: Experimental support for BigInt is a feature that is subject to change in a future release. Set the 'experimentalBigInt' option to remove this warning.
|
||||
tests/cases/compiler/warnExperimentalBigIntLiteral.ts(5,39): error TS1351: Experimental support for BigInt is a feature that is subject to change in a future release. Set the 'experimentalBigInt' option to remove this warning.
|
||||
tests/cases/compiler/warnExperimentalBigIntLiteral.ts(5,48): error TS1351: Experimental support for BigInt is a feature that is subject to change in a future release. Set the 'experimentalBigInt' option to remove this warning.
|
||||
|
||||
|
||||
==== tests/cases/compiler/warnExperimentalBigIntLiteral.ts (4 errors) ====
|
||||
const normalNumber = 123; // should not error
|
||||
let bigintType: bigint; // should not error
|
||||
let bigintLiteralType: 123n; // should not error when used as type
|
||||
let bigintNegativeLiteralType: -123n; // should not error when used as type
|
||||
const bigintNumber = 123n * 0b1111n + 0o444n * 0x7fn; // each literal should error
|
||||
~~~~
|
||||
!!! error TS1351: Experimental support for BigInt is a feature that is subject to change in a future release. Set the 'experimentalBigInt' option to remove this warning.
|
||||
~~~~~~~
|
||||
!!! error TS1351: Experimental support for BigInt is a feature that is subject to change in a future release. Set the 'experimentalBigInt' option to remove this warning.
|
||||
~~~~~~
|
||||
!!! error TS1351: Experimental support for BigInt is a feature that is subject to change in a future release. Set the 'experimentalBigInt' option to remove this warning.
|
||||
~~~~~
|
||||
!!! error TS1351: Experimental support for BigInt is a feature that is subject to change in a future release. Set the 'experimentalBigInt' option to remove this warning.
|
||||
@@ -3,11 +3,13 @@ const normalNumber = 123; // should not error
|
||||
let bigintType: bigint; // should not error
|
||||
let bigintLiteralType: 123n; // should not error when used as type
|
||||
let bigintNegativeLiteralType: -123n; // should not error when used as type
|
||||
const bigintNumber = 123n * 0b1111n + 0o444n * 0x7fn; // each literal should error
|
||||
const bigintNumber = 123n * 0b1111n + 0o444n * 0x7fn; // each literal should error
|
||||
|
||||
|
||||
|
||||
//// [warnExperimentalBigIntLiteral.js]
|
||||
const normalNumber = 123; // should not error
|
||||
let bigintType; // should not error
|
||||
let bigintLiteralType; // should not error when used as type
|
||||
let bigintNegativeLiteralType; // should not error when used as type
|
||||
const bigintNumber = 123n * 15n + 292n * 0x7fn; // each literal should error
|
||||
var normalNumber = 123; // should not error
|
||||
var bigintType; // should not error
|
||||
var bigintLiteralType; // should not error when used as type
|
||||
var bigintNegativeLiteralType; // should not error when used as type
|
||||
var bigintNumber = 123n * 15n + 292n * 0x7fn; // each literal should error
|
||||
|
||||
@@ -14,3 +14,4 @@ let bigintNegativeLiteralType: -123n; // should not error when used as type
|
||||
const bigintNumber = 123n * 0b1111n + 0o444n * 0x7fn; // each literal should error
|
||||
>bigintNumber : Symbol(bigintNumber, Decl(warnExperimentalBigIntLiteral.ts, 4, 5))
|
||||
|
||||
|
||||
|
||||
@@ -24,3 +24,4 @@ const bigintNumber = 123n * 0b1111n + 0o444n * 0x7fn; // each literal should err
|
||||
>0o444n : 292n
|
||||
>0x7fn : 127n
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// @target: esnext
|
||||
// @target: es3
|
||||
|
||||
const normalNumber = 123; // should not error
|
||||
let bigintType: bigint; // should not error
|
||||
let bigintLiteralType: 123n; // should not error when used as type
|
||||
let bigintNegativeLiteralType: -123n; // should not error when used as type
|
||||
const bigintNumber = 123n * 0b1111n + 0o444n * 0x7fn; // each literal should error
|
||||
const bigintNumber = 123n * 0b1111n + 0o444n * 0x7fn; // each literal should error
|
||||
@@ -1,5 +1,4 @@
|
||||
// @target: esnext
|
||||
// @experimentalBigInt: true
|
||||
|
||||
// @filename: a.ts
|
||||
interface BigIntIndex<E> {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// @experimentalBigInt: true
|
||||
// @target: esnext
|
||||
// @declaration: true
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// @experimentalBigInt: true
|
||||
// @target: es5
|
||||
|
||||
// Every line should error because these builtins are not declared
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// @experimentalBigInt: true
|
||||
// @target: esnext
|
||||
|
||||
// Cannot mix bigints and numbers
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// @experimentalBigInt: true
|
||||
// @target: esnext
|
||||
|
||||
// All bases should allow "n" suffix
|
||||
|
||||
Reference in New Issue
Block a user