Skip to content

Commit 31fca3a

Browse files
author
Josh Goldberg
committed
Accepted new baselines
1 parent 51d10ee commit 31fca3a

7 files changed

+66
-420
lines changed
Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
tests/cases/compiler/bigIntWithTargetES3.ts(3,27): error TS1351: An identifier cannot follow a numeric literal.
2-
tests/cases/compiler/bigIntWithTargetES3.ts(4,36): error TS1351: An identifier cannot follow a numeric literal.
3-
tests/cases/compiler/bigIntWithTargetES3.ts(5,25): error TS1351: An identifier cannot follow a numeric literal.
1+
tests/cases/compiler/bigIntWithTargetES3.ts(5,22): error TS2737: BigInt literals are not available when targeting lower than ESNext.
2+
tests/cases/compiler/bigIntWithTargetES3.ts(5,29): error TS2737: BigInt literals are not available when targeting lower than ESNext.
3+
tests/cases/compiler/bigIntWithTargetES3.ts(5,39): error TS2737: BigInt literals are not available when targeting lower than ESNext.
4+
tests/cases/compiler/bigIntWithTargetES3.ts(5,48): error TS2737: BigInt literals are not available when targeting lower than ESNext.
45

56

6-
==== tests/cases/compiler/bigIntWithTargetES3.ts (3 errors) ====
7+
==== tests/cases/compiler/bigIntWithTargetES3.ts (4 errors) ====
78
const normalNumber = 123; // should not error
89
let bigintType: bigint; // should not error
910
let bigintLiteralType: 123n; // should not error when used as type
10-
~
11-
!!! error TS1351: An identifier cannot follow a numeric literal.
1211
let bigintNegativeLiteralType: -123n; // should not error when used as type
13-
~
14-
!!! error TS1351: An identifier cannot follow a numeric literal.
1512
const bigintNumber = 123n * 0b1111n + 0o444n * 0x7fn; // each literal should error
16-
~
17-
!!! error TS1351: An identifier cannot follow a numeric literal.
13+
~~~~
14+
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
15+
~~~~~~~
16+
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
17+
~~~~~~
18+
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
19+
~~~~~
20+
!!! error TS2737: BigInt literals are not available when targeting lower than ESNext.
1821

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
1+
tests/cases/compiler/a.ts(2,6): error TS1023: An index signature parameter type must be 'string' or 'number'.
12
tests/cases/compiler/a.ts(8,11): error TS2538: Type '1n' cannot be used as an index type.
2-
tests/cases/compiler/a.ts(8,12): error TS1351: An identifier cannot follow a numeric literal.
33
tests/cases/compiler/a.ts(14,1): error TS2322: Type '123n' is not assignable to type 'string | number | symbol'.
4-
tests/cases/compiler/a.ts(14,10): error TS1351: An identifier cannot follow a numeric literal.
5-
tests/cases/compiler/a.ts(17,25): error TS1351: An identifier cannot follow a numeric literal.
64
tests/cases/compiler/a.ts(19,12): error TS2538: Type 'bigint' cannot be used as an index type.
75
tests/cases/compiler/b.ts(2,12): error TS1136: Property assignment expected.
8-
tests/cases/compiler/b.ts(2,13): error TS1351: An identifier cannot follow a numeric literal.
96
tests/cases/compiler/b.ts(2,14): error TS1005: ';' expected.
107
tests/cases/compiler/b.ts(2,19): error TS1128: Declaration or statement expected.
118
tests/cases/compiler/b.ts(3,12): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
12-
tests/cases/compiler/b.ts(3,14): error TS1351: An identifier cannot follow a numeric literal.
139
tests/cases/compiler/b.ts(4,12): error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
1410

1511

16-
==== tests/cases/compiler/a.ts (6 errors) ====
12+
==== tests/cases/compiler/a.ts (4 errors) ====
1713
interface BigIntIndex<E> {
1814
[index: bigint]: E; // should error
15+
~~~~~
16+
!!! error TS1023: An index signature parameter type must be 'string' or 'number'.
1917
}
2018

2119
const arr: number[] = [1, 2, 3];
@@ -24,8 +22,6 @@ tests/cases/compiler/b.ts(4,12): error TS2464: A computed property name must be
2422
num = arr[1n]; // should error
2523
~~
2624
!!! error TS2538: Type '1n' cannot be used as an index type.
27-
~
28-
!!! error TS1351: An identifier cannot follow a numeric literal.
2925

3026
let key: keyof any; // should be type "string | number | symbol"
3127
key = 123;
@@ -34,13 +30,9 @@ tests/cases/compiler/b.ts(4,12): error TS2464: A computed property name must be
3430
key = 123n; // should error
3531
~~~
3632
!!! error TS2322: Type '123n' is not assignable to type 'string | number | symbol'.
37-
~
38-
!!! error TS1351: An identifier cannot follow a numeric literal.
3933

4034
// Show correct usage of bigint index: explicitly convert to string
4135
const bigNum: bigint = 0n;
42-
~
43-
!!! error TS1351: An identifier cannot follow a numeric literal.
4436
const typedArray = new Uint8Array(3);
4537
typedArray[bigNum] = 0xAA; // should error
4638
~~~~~~
@@ -50,22 +42,18 @@ tests/cases/compiler/b.ts(4,12): error TS2464: A computed property name must be
5042
typedArray[2] = 0xCC;
5143

5244
// {1n: 123} is a syntax error; must go in separate file so BigIntIndex error is shown
53-
==== tests/cases/compiler/b.ts (7 errors) ====
45+
==== tests/cases/compiler/b.ts (5 errors) ====
5446
// BigInt cannot be used as an object literal property
5547
const a = {1n: 123};
5648
~~
5749
!!! error TS1136: Property assignment expected.
58-
~
59-
!!! error TS1351: An identifier cannot follow a numeric literal.
6050
~
6151
!!! error TS1005: ';' expected.
6252
~
6353
!!! error TS1128: Declaration or statement expected.
6454
const b = {[1n]: 456};
6555
~~~~
6656
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
67-
~
68-
!!! error TS1351: An identifier cannot follow a numeric literal.
6957
const c = {[bigNum]: 789};
7058
~~~~~~~~
7159
!!! error TS2464: A computed property name must be of type 'string', 'number', 'symbol', or 'any'.
Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,15 @@
11
tests/cases/compiler/bigintWithLib.ts(4,1): error TS2350: Only a void function can be called with the 'new' keyword.
2-
tests/cases/compiler/bigintWithLib.ts(15,35): error TS1351: An identifier cannot follow a numeric literal.
3-
tests/cases/compiler/bigintWithLib.ts(15,39): error TS1351: An identifier cannot follow a numeric literal.
4-
tests/cases/compiler/bigintWithLib.ts(15,43): error TS1351: An identifier cannot follow a numeric literal.
52
tests/cases/compiler/bigintWithLib.ts(16,33): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
63
Type 'number[]' is missing the following properties from type 'SharedArrayBuffer': byteLength, [Symbol.species], [Symbol.toStringTag]
74
tests/cases/compiler/bigintWithLib.ts(21,13): error TS2540: Cannot assign to 'length' because it is a read-only property.
8-
tests/cases/compiler/bigintWithLib.ts(27,37): error TS1351: An identifier cannot follow a numeric literal.
9-
tests/cases/compiler/bigintWithLib.ts(27,41): error TS1351: An identifier cannot follow a numeric literal.
10-
tests/cases/compiler/bigintWithLib.ts(27,45): error TS1351: An identifier cannot follow a numeric literal.
115
tests/cases/compiler/bigintWithLib.ts(28,35): error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
126
Type 'number[]' is not assignable to type 'SharedArrayBuffer'.
137
tests/cases/compiler/bigintWithLib.ts(33,13): error TS2540: Cannot assign to 'length' because it is a read-only property.
14-
tests/cases/compiler/bigintWithLib.ts(38,27): error TS1351: An identifier cannot follow a numeric literal.
15-
tests/cases/compiler/bigintWithLib.ts(39,27): error TS1351: An identifier cannot follow a numeric literal.
168
tests/cases/compiler/bigintWithLib.ts(40,25): error TS2345: Argument of type '-1' is not assignable to parameter of type 'bigint'.
17-
tests/cases/compiler/bigintWithLib.ts(41,29): error TS1351: An identifier cannot follow a numeric literal.
18-
tests/cases/compiler/bigintWithLib.ts(42,29): error TS1351: An identifier cannot follow a numeric literal.
199
tests/cases/compiler/bigintWithLib.ts(43,26): error TS2345: Argument of type '123' is not assignable to parameter of type 'bigint'.
20-
tests/cases/compiler/bigintWithLib.ts(50,13): error TS1351: An identifier cannot follow a numeric literal.
21-
tests/cases/compiler/bigintWithLib.ts(51,14): error TS1351: An identifier cannot follow a numeric literal.
22-
tests/cases/compiler/bigintWithLib.ts(52,12): error TS1351: An identifier cannot follow a numeric literal.
23-
tests/cases/compiler/bigintWithLib.ts(52,18): error TS1351: An identifier cannot follow a numeric literal.
24-
tests/cases/compiler/bigintWithLib.ts(53,11): error TS1351: An identifier cannot follow a numeric literal.
2510

2611

27-
==== tests/cases/compiler/bigintWithLib.ts (22 errors) ====
12+
==== tests/cases/compiler/bigintWithLib.ts (7 errors) ====
2813
// Test BigInt functions
2914
let bigintVal: bigint = BigInt(123);
3015
bigintVal = BigInt("456");
@@ -42,12 +27,6 @@ tests/cases/compiler/bigintWithLib.ts(53,11): error TS1351: An identifier cannot
4227
let bigIntArray: BigInt64Array = new BigInt64Array();
4328
bigIntArray = new BigInt64Array(10);
4429
bigIntArray = new BigInt64Array([1n, 2n, 3n]);
45-
~
46-
!!! error TS1351: An identifier cannot follow a numeric literal.
47-
~
48-
!!! error TS1351: An identifier cannot follow a numeric literal.
49-
~
50-
!!! error TS1351: An identifier cannot follow a numeric literal.
5130
bigIntArray = new BigInt64Array([1, 2, 3]); // should error
5231
~~~~~~~~~
5332
!!! error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
@@ -65,12 +44,6 @@ tests/cases/compiler/bigintWithLib.ts(53,11): error TS1351: An identifier cannot
6544
let bigUintArray: BigUint64Array = new BigUint64Array();
6645
bigUintArray = new BigUint64Array(10);
6746
bigUintArray = new BigUint64Array([1n, 2n, 3n]);
68-
~
69-
!!! error TS1351: An identifier cannot follow a numeric literal.
70-
~
71-
!!! error TS1351: An identifier cannot follow a numeric literal.
72-
~
73-
!!! error TS1351: An identifier cannot follow a numeric literal.
7447
bigUintArray = new BigUint64Array([1, 2, 3]); // should error
7548
~~~~~~~~~
7649
!!! error TS2345: Argument of type 'number[]' is not assignable to parameter of type 'ArrayBuffer | SharedArrayBuffer'.
@@ -87,20 +60,12 @@ tests/cases/compiler/bigintWithLib.ts(53,11): error TS1351: An identifier cannot
8760
// Test added DataView methods
8861
const dataView = new DataView(new ArrayBuffer(80));
8962
dataView.setBigInt64(1, -1n);
90-
~
91-
!!! error TS1351: An identifier cannot follow a numeric literal.
9263
dataView.setBigInt64(1, -1n, true);
93-
~
94-
!!! error TS1351: An identifier cannot follow a numeric literal.
9564
dataView.setBigInt64(1, -1); // should error
9665
~~
9766
!!! error TS2345: Argument of type '-1' is not assignable to parameter of type 'bigint'.
9867
dataView.setBigUint64(2, 123n);
99-
~
100-
!!! error TS1351: An identifier cannot follow a numeric literal.
10168
dataView.setBigUint64(2, 123n, true);
102-
~
103-
!!! error TS1351: An identifier cannot follow a numeric literal.
10469
dataView.setBigUint64(2, 123); // should error
10570
~~~
10671
!!! error TS2345: Argument of type '123' is not assignable to parameter of type 'bigint'.
@@ -111,16 +76,6 @@ tests/cases/compiler/bigintWithLib.ts(53,11): error TS1351: An identifier cannot
11176

11277
// Test emitted declarations files
11378
const w = 12n; // should emit as const w = 12n
114-
~
115-
!!! error TS1351: An identifier cannot follow a numeric literal.
11679
const x = -12n; // should emit as const x = -12n
117-
~
118-
!!! error TS1351: An identifier cannot follow a numeric literal.
11980
const y: 12n = 12n; // should emit type 12n
120-
~
121-
!!! error TS1351: An identifier cannot follow a numeric literal.
122-
~
123-
!!! error TS1351: An identifier cannot follow a numeric literal.
124-
let z = 12n; // should emit type bigint in declaration file
125-
~
126-
!!! error TS1351: An identifier cannot follow a numeric literal.
81+
let z = 12n; // should emit type bigint in declaration file

0 commit comments

Comments
 (0)