Skip to content

fix35982: allow BigIntLiteral to parse as PropertyName for literal object and indices - #58608

Merged
Isabel Duan (iisaduan) merged 17 commits into
microsoft:mainfrom
iisaduan:parse-bigint-index
Jul 20, 2024
Merged

fix35982: allow BigIntLiteral to parse as PropertyName for literal object and indices#58608
Isabel Duan (iisaduan) merged 17 commits into
microsoft:mainfrom
iisaduan:parse-bigint-index

Conversation

@iisaduan

@iisaduanIsabel Duan (iisaduan) commented May 21, 2024

Copy link
Copy Markdown
Member

Fixes#35982

This PR allows more valid bigint uses in JS to parse and emit correctly. We will parse (and correctly emit) the following cases, but give the following errors:

{ ({1n: 123}); };
~~ 1538: A `bigint` literal may not be used as a property name.
[1,2,3][1n]; ~~ 2538: Type `bigint` cannot be used as an index type.
const arr = [1,2,3];
const { 0n: f } = arr; ~~ 2538: Type `bigint` cannot be used as an index type.
class K {
4n = 0;
~~ 1538: A `bigint` literal may not be used as a property name.
}

@typescript-bot

Copy link
Copy Markdown
Contributor

Looks like you're introducing a change to the public API surface area. If this includes breaking changes, please document them on our wiki's API Breaking Changes page.

Also, please make sure Daniel Rosenwasser (@DanielRosenwasser) and Ryan Cavanaugh (@RyanCavanaugh) are aware of the changes, just as a heads up.

@iisaduan

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) test it

@typescript-bot

TypeScript Bot (typescript-bot) commented May 21, 2024

Copy link
Copy Markdown
Contributor

Starting jobs; this comment will be updated as builds start and complete.

CommandStatusResults
test top400✅ Started✅ Results
user test this✅ Started✅ Results
run dt✅ Started✅ Results
perf test this faster✅ Started👀 Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Isabel Duan (@iisaduan), the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot

Copy link
Copy Markdown
Contributor

Isabel Duan (@iisaduan) Here are the results of running the user tests comparing main and refs/pull/58608/merge:

Everything looks good!

@typescript-bot

Copy link
Copy Markdown
Contributor

Isabel Duan (@iisaduan)
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols62,15462,154~~~p=1.000 n=6
Types50,24850,248~~~p=1.000 n=6
Memory used193,446k (± 0.95%)192,952k (± 0.75%)~192,172k195,875kp=0.689 n=6
Parse Time1.55s (± 2.16%)1.54s (± 1.40%)~1.51s1.57sp=0.686 n=6
Bind Time0.87s (± 1.26%)0.86s (± 1.41%)~0.85s0.88sp=0.476 n=6
Check Time11.35s (± 0.47%)11.32s (± 0.18%)~11.29s11.34sp=0.227 n=6
Emit Time3.14s (± 1.00%)3.15s (± 0.71%)~3.13s3.19sp=1.000 n=6
Total Time16.92s (± 0.30%)16.88s (± 0.13%)~16.84s16.90sp=0.062 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,110944,110~~~p=1.000 n=6
Types407,140407,140~~~p=1.000 n=6
Memory used1,222,028k (± 0.00%)1,222,038k (± 0.00%)~1,222,011k1,222,077kp=1.000 n=6
Parse Time8.10s (± 0.45%)8.13s (± 0.42%)~8.09s8.19sp=0.145 n=6
Bind Time2.24s (± 0.63%)2.25s (± 0.56%)~2.23s2.26sp=0.249 n=6
Check Time36.47s (± 0.31%)36.40s (± 0.31%)~36.25s36.55sp=0.377 n=6
Emit Time17.53s (± 0.92%)17.54s (± 0.59%)~17.39s17.68sp=0.872 n=6
Total Time64.35s (± 0.22%)64.33s (± 0.17%)~64.15s64.42sp=0.936 n=6
mui-docs - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols1,978,7891,978,789~~~p=1.000 n=6
Types882,017882,017~~~p=1.000 n=6
Memory used1,884,687k (± 0.01%)1,884,644k (± 0.00%)~1,884,551k1,884,696kp=0.066 n=6
Parse Time8.02s (± 0.29%)8.02s (± 0.35%)~7.97s8.04sp=0.867 n=6
Bind Time2.67s (± 5.33%)2.73s (± 0.73%)~2.69s2.74sp=0.300 n=6
Check Time71.01s (± 0.46%)70.87s (± 0.28%)~70.67s71.17sp=0.575 n=6
Emit Time0.17s (± 3.72%)0.17s (± 2.42%)~0.16s0.17sp=0.673 n=6
Total Time81.87s (± 0.52%)81.79s (± 0.26%)~81.53s82.13sp=0.936 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,223,1981,223,681+483 (+ 0.04%)~~p=0.001 n=6
Types260,141260,452+311 (+ 0.12%)~~p=0.001 n=6
Memory used2,340,437k (± 0.05%)2,340,209k (± 0.03%)~2,339,523k2,341,237kp=0.689 n=6
Parse Time5.00s (± 1.44%)4.98s (± 1.62%)~4.88s5.09sp=0.689 n=6
Bind Time1.90s (± 0.64%)1.89s (± 0.62%)~1.87s1.90sp=0.323 n=6
Check Time33.81s (± 0.39%)33.75s (± 0.45%)~33.54s33.96sp=0.630 n=6
Emit Time2.63s (± 3.81%)2.70s (± 1.48%)~2.64s2.76sp=0.521 n=6
Total Time43.35s (± 0.60%)43.35s (± 0.49%)~43.06s43.55sp=1.000 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,223,1981,223,681+483 (+ 0.04%)~~p=0.001 n=6
Types260,141260,452+311 (+ 0.12%)~~p=0.001 n=6
Memory used2,415,349k (± 0.03%)2,416,424k (± 0.03%)+1,075k (+ 0.04%)2,415,535k2,417,111kp=0.031 n=6
Parse Time6.30s (± 1.30%)6.31s (± 0.65%)~6.26s6.36sp=0.936 n=6
Bind Time2.04s (± 0.95%)2.04s (± 1.19%)~1.99s2.06sp=1.000 n=6
Check Time40.16s (± 0.49%)40.21s (± 0.38%)~39.98s40.42sp=0.810 n=6
Emit Time3.22s (± 1.62%)3.19s (± 2.28%)~3.05s3.26sp=0.471 n=6
Total Time51.72s (± 0.51%)51.76s (± 0.40%)~51.45s51.98sp=0.689 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols257,714258,106+392 (+ 0.15%)~~p=0.001 n=6
Types104,904105,170+266 (+ 0.25%)~~p=0.001 n=6
Memory used426,512k (± 0.02%)427,412k (± 0.01%)+900k (+ 0.21%)427,391k427,454kp=0.005 n=6
Parse Time4.18s (± 0.61%)4.18s (± 0.49%)~4.15s4.21sp=0.454 n=6
Bind Time1.62s (± 0.72%)1.62s (± 0.91%)~1.59s1.63sp=0.666 n=6
Check Time22.26s (± 0.27%)22.26s (± 0.37%)~22.11s22.36sp=0.872 n=6
Emit Time1.72s (± 1.50%)1.70s (± 1.21%)~1.67s1.73sp=0.105 n=6
Total Time29.79s (± 0.28%)29.76s (± 0.31%)~29.63s29.90sp=0.747 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,575224,575~~~p=1.000 n=6
Types93,78593,785~~~p=1.000 n=6
Memory used369,881k (± 0.03%)369,826k (± 0.02%)~369,765k369,969kp=0.575 n=6
Parse Time3.50s (± 0.44%)3.50s (± 0.53%)~3.47s3.52sp=0.370 n=6
Bind Time1.94s (± 1.10%)1.94s (± 0.83%)~1.91s1.95sp=0.934 n=6
Check Time19.31s (± 0.17%)19.33s (± 0.44%)~19.24s19.46sp=0.809 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time24.75s (± 0.18%)24.78s (± 0.33%)~24.65s24.86sp=0.377 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,823,8792,823,879~~~p=1.000 n=6
Types957,876957,876~~~p=1.000 n=6
Memory used2,998,648k (± 0.00%)2,998,669k (± 0.00%)~2,998,573k2,998,765kp=0.936 n=6
Parse Time13.87s (± 0.30%)13.90s (± 0.23%)~13.86s13.95sp=0.196 n=6
Bind Time4.13s (± 0.25%)4.13s (± 0.34%)~4.11s4.15sp=0.738 n=6
Check Time73.48s (± 0.40%)73.57s (± 0.33%)~73.33s73.96sp=0.575 n=6
Emit Time23.42s (± 1.02%)23.43s (± 1.08%)~23.06s23.73sp=0.810 n=6
Total Time114.90s (± 0.43%)115.02s (± 0.17%)~114.70s115.25sp=0.936 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols265,866265,866~~~p=1.000 n=6
Types108,401108,401~~~p=1.000 n=6
Memory used410,505k (± 0.01%)410,540k (± 0.01%)~410,487k410,602kp=0.173 n=6
Parse Time3.82s (± 1.07%)3.84s (± 0.88%)~3.80s3.89sp=0.518 n=6
Bind Time1.67s (± 1.03%)1.68s (± 1.24%)~1.65s1.70sp=0.744 n=6
Check Time16.91s (± 0.63%)16.90s (± 0.40%)~16.79s16.97sp=0.748 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.41s (± 0.46%)22.42s (± 0.47%)~22.27s22.55sp=1.000 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols524,654524,654~~~p=1.000 n=6
Types178,920178,920~~~p=1.000 n=6
Memory used462,683k (± 0.03%)462,756k (± 0.03%)~462,633k462,994kp=0.575 n=6
Parse Time3.90s (± 0.51%)3.91s (± 0.53%)~3.88s3.94sp=0.615 n=6
Bind Time1.45s (± 1.31%)1.45s (± 1.34%)~1.42s1.47sp=0.935 n=6
Check Time22.48s (± 0.87%)22.63s (± 0.40%)~22.52s22.76sp=0.149 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time27.83s (± 0.65%)27.98s (± 0.35%)~27.82s28.09sp=0.148 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot

Copy link
Copy Markdown
Contributor

Isabel Duan (@iisaduan) Here are the results of running the top 400 repos comparing main and refs/pull/58608/merge:

Everything looks good!

@iisaduan

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) test it

@typescript-bot

TypeScript Bot (typescript-bot) commented May 23, 2024

Copy link
Copy Markdown
Contributor

Starting jobs; this comment will be updated as builds start and complete.

CommandStatusResults
test top400✅ Started✅ Results
user test this✅ Started✅ Results
run dt✅ Started✅ Results
perf test this faster✅ Started👀 Results

@iisaduanIsabel Duan (iisaduan) changed the title fix35982: allow BigIntLiteral to parse as PropertyName for literal objectfix35982: allow BigIntLiteral to parse as PropertyName for literal object and indicesMay 23, 2024
@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Isabel Duan (@iisaduan), the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot

Copy link
Copy Markdown
Contributor

Isabel Duan (@iisaduan) Here are the results of running the user tests comparing main and refs/pull/58608/merge:

Everything looks good!

@typescript-bot

Copy link
Copy Markdown
Contributor

Isabel Duan (@iisaduan)
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols62,15462,154~~~p=1.000 n=6
Types50,24850,248~~~p=1.000 n=6
Memory used192,946k (± 0.73%)192,908k (± 0.76%)~192,160k195,894kp=0.936 n=6
Parse Time1.30s (± 0.63%)1.29s (± 1.50%)~1.26s1.31sp=0.157 n=6
Bind Time0.72s0.72s~~~p=1.000 n=6
Check Time9.56s (± 0.56%)9.54s (± 0.44%)~9.49s9.59sp=0.469 n=6
Emit Time2.65s (± 0.52%)2.64s (± 0.75%)~2.62s2.67sp=0.247 n=6
Total Time14.23s (± 0.20%)14.18s (± 0.41%)~14.09s14.23sp=0.183 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,110944,110~~~p=1.000 n=6
Types407,140407,140~~~p=1.000 n=6
Memory used1,222,015k (± 0.00%)1,222,009k (± 0.01%)~1,221,856k1,222,126kp=0.575 n=6
Parse Time8.06s (± 0.22%)8.12s (± 0.78%)~8.05s8.22sp=0.158 n=6
Bind Time2.25s (± 0.86%)2.25s (± 0.61%)~2.23s2.27sp=0.459 n=6
Check Time36.45s (± 0.37%)36.59s (± 0.63%)~36.26s36.82sp=0.378 n=6
Emit Time17.53s (± 0.58%)17.58s (± 0.55%)~17.45s17.71sp=0.470 n=6
Total Time64.29s (± 0.24%)64.54s (± 0.43%)~64.09s64.78sp=0.128 n=6
mui-docs - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols1,978,5701,978,570~~~p=1.000 n=6
Types882,090882,090~~~p=1.000 n=6
Memory used1,885,387k (± 0.00%)1,885,367k (± 0.00%)~1,885,341k1,885,421kp=0.199 n=6
Parse Time6.76s (± 0.36%)6.80s (± 0.41%)~6.76s6.83sp=0.052 n=6
Bind Time2.29s (± 0.76%)2.30s (± 0.76%)~2.27s2.32sp=0.684 n=6
Check Time60.71s (± 0.32%)60.74s (± 0.31%)~60.42s60.96sp=0.688 n=6
Emit Time0.15s (± 2.75%)0.15s (± 3.77%)~0.14s0.15sp=0.282 n=6
Total Time69.92s (± 0.30%)69.98s (± 0.26%)~69.71s70.24sp=0.687 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,225,0001,225,496+496 (+ 0.04%)~~p=0.001 n=6
Types260,662260,983+321 (+ 0.12%)~~p=0.001 n=6
Memory used2,341,618k (± 0.03%)2,343,070k (± 0.04%)+1,453k (+ 0.06%)2,342,133k2,344,638kp=0.020 n=6
Parse Time4.98s (± 0.68%)4.96s (± 0.96%)~4.90s5.02sp=0.688 n=6
Bind Time1.91s (± 0.57%)1.89s (± 0.27%)-0.02s (- 0.87%)1.89s1.90sp=0.023 n=6
Check Time33.81s (± 0.31%)33.96s (± 0.43%)~33.71s34.13sp=0.128 n=6
Emit Time2.67s (± 2.06%)2.67s (± 1.75%)~2.62s2.76sp=0.575 n=6
Total Time43.38s (± 0.26%)43.50s (± 0.36%)~43.27s43.69sp=0.230 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,225,0001,225,496+496 (+ 0.04%)~~p=0.001 n=6
Types260,662260,983+321 (+ 0.12%)~~p=0.001 n=6
Memory used2,418,024k (± 0.01%)2,469,490k (± 3.15%)+51,466k (+ 2.13%)2,417,832k2,571,118kp=0.045 n=6
Parse Time6.21s (± 1.34%)6.16s (± 0.78%)~6.09s6.21sp=0.230 n=6
Bind Time2.05s (± 0.99%)2.05s (± 1.26%)~2.01s2.08sp=0.744 n=6
Check Time40.32s (± 0.21%)40.32s (± 0.32%)~40.17s40.50sp=1.000 n=6
Emit Time3.08s (± 2.07%)3.16s (± 6.05%)~2.97s3.50sp=0.575 n=6
Total Time51.67s (± 0.20%)51.71s (± 0.27%)~51.55s51.93sp=0.748 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols257,735258,129+394 (+ 0.15%)~~p=0.001 n=6
Types104,934105,209+275 (+ 0.26%)~~p=0.001 n=6
Memory used426,658k (± 0.01%)427,626k (± 0.02%)+968k (+ 0.23%)427,516k427,729kp=0.005 n=6
Parse Time4.18s (± 0.62%)4.17s (± 0.80%)~4.12s4.20sp=0.871 n=6
Bind Time1.62s (± 1.44%)1.62s (± 1.72%)~1.58s1.65sp=0.809 n=6
Check Time22.26s (± 0.49%)22.36s (± 0.38%)~22.24s22.47sp=0.228 n=6
Emit Time1.69s (± 1.48%)1.67s (± 0.76%)~1.65s1.68sp=0.102 n=6
Total Time29.74s (± 0.38%)29.81s (± 0.45%)~29.67s29.98sp=0.521 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,575224,575~~~p=1.000 n=6
Types93,78593,785~~~p=1.000 n=6
Memory used369,936k (± 0.03%)369,917k (± 0.03%)~369,797k370,074kp=0.689 n=6
Parse Time2.83s (± 1.17%)2.85s (± 0.72%)~2.82s2.87sp=0.292 n=6
Bind Time1.59s (± 1.22%)1.57s (± 0.53%)~1.56s1.58sp=0.162 n=6
Check Time15.68s (± 0.35%)15.61s (± 0.33%)~15.56s15.70sp=0.078 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time20.10s (± 0.27%)20.04s (± 0.36%)~19.95s20.15sp=0.199 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,835,5952,835,595~~~p=1.000 n=6
Types961,025961,025~~~p=1.000 n=6
Memory used3,008,099k (± 0.00%)3,008,021k (± 0.00%)~3,007,932k3,008,125kp=0.093 n=6
Parse Time17.02s (± 0.21%)17.10s (± 0.88%)~16.99s17.39sp=0.514 n=6
Bind Time5.06s (± 0.48%)5.04s (± 0.77%)~5.01s5.11sp=0.260 n=6
Check Time90.14s (± 2.17%)88.98s (± 0.26%)~88.70s89.30sp=0.471 n=6
Emit Time27.47s (± 7.39%)28.59s (± 0.70%)~28.35s28.85sp=0.748 n=6
Total Time139.69s (± 0.24%)139.71s (± 0.24%)~139.37s140.32sp=1.000 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols266,087266,087~~~p=1.000 n=6
Types108,518108,518~~~p=1.000 n=6
Memory used410,934k (± 0.02%)410,960k (± 0.01%)~410,866k411,035kp=0.471 n=6
Parse Time4.75s (± 0.75%)4.75s (± 0.41%)~4.72s4.77sp=0.628 n=6
Bind Time2.07s (± 0.90%)2.05s (± 1.29%)~2.00s2.07sp=0.563 n=6
Check Time21.01s (± 0.18%)21.03s (± 0.26%)~20.95s21.08sp=0.419 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time27.83s (± 0.23%)27.83s (± 0.23%)~27.74s27.90sp=1.000 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols535,745535,745~~~p=1.000 n=6
Types182,753182,753~~~p=1.000 n=6
Memory used470,453k (± 0.02%)470,445k (± 0.02%)~470,351k470,611kp=0.936 n=6
Parse Time3.18s (± 0.69%)3.16s (± 0.77%)~3.13s3.20sp=0.062 n=6
Bind Time1.20s (± 0.86%)1.20s (± 0.34%)~1.19s1.20sp=0.924 n=6
Check Time18.43s (± 0.29%)18.36s (± 0.37%)~18.29s18.46sp=0.199 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time22.80s (± 0.33%)22.72s (± 0.33%)~22.62s22.80sp=0.128 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot

Copy link
Copy Markdown
Contributor

Isabel Duan (@iisaduan) Here are the results of running the top 400 repos comparing main and refs/pull/58608/merge:

Everything looks good!

Comment threadsrc/compiler/diagnosticMessages.json Outdated
Comment threadsrc/compiler/checker.ts Outdated
Comment threadtests/cases/compiler/bigintIndex.ts Outdated
Comment threadsrc/compiler/diagnosticMessages.json Outdated
@iisaduan

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) test it

@typescript-bot

TypeScript Bot (typescript-bot) commented Jul 13, 2024

Copy link
Copy Markdown
Contributor

Starting jobs; this comment will be updated as builds start and complete.

CommandStatusResults
test top400✅ Started✅ Results
user test this✅ Started
run dt✅ Started✅ Results
perf test this faster✅ Started👀 Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Isabel Duan (@iisaduan), the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot

Copy link
Copy Markdown
Contributor

Isabel Duan (@iisaduan)
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
MetricbaselineprDeltaBestWorstp-value
Compiler-Unions - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols62,15362,153~~~p=1.000 n=6
Types50,24250,242~~~p=1.000 n=6
Memory used192,750k (± 0.76%)193,357k (± 0.94%)~192,136k195,703kp=0.298 n=6
Parse Time1.95s (± 0.95%)1.94s (± 0.60%)~1.92s1.95sp=0.357 n=6
Bind Time1.05s (± 0.93%)1.07s (± 0.76%)+0.01s (+ 1.43%)1.06s1.08sp=0.026 n=6
Check Time13.89s (± 0.29%)13.87s (± 0.44%)~13.81s13.97sp=0.571 n=6
Emit Time4.03s (± 0.53%)4.00s (± 0.65%)~3.96s4.03sp=0.102 n=6
Total Time20.93s (± 0.13%)20.88s (± 0.34%)~20.82s20.98sp=0.257 n=6
angular-1 - node (v18.15.0, x64)
Errors55~~~p=1.000 n=6
Symbols944,114944,114~~~p=1.000 n=6
Types407,050407,050~~~p=1.000 n=6
Memory used1,218,410k (± 0.00%)1,218,395k (± 0.00%)~1,218,350k1,218,456kp=0.689 n=6
Parse Time6.70s (± 0.51%)6.72s (± 0.46%)~6.69s6.78sp=0.373 n=6
Bind Time1.87s (± 0.68%)1.86s (± 0.74%)~1.85s1.88sp=0.564 n=6
Check Time30.73s (± 0.18%)30.72s (± 0.36%)~30.59s30.89sp=0.936 n=6
Emit Time13.55s (± 0.62%)13.57s (± 0.49%)~13.47s13.65sp=0.936 n=6
Total Time52.85s (± 0.19%)52.88s (± 0.26%)~52.70s53.10sp=0.748 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,148,7302,148,730~~~p=1.000 n=6
Types929,320929,320~~~p=1.000 n=6
Memory used2,116,402k (± 0.01%)2,116,449k (± 0.01%)~2,116,230k2,116,690kp=0.471 n=6
Parse Time6.58s (± 0.25%)6.59s (± 0.12%)~6.58s6.60sp=0.934 n=6
Bind Time2.33s (± 0.24%)2.32s (± 0.47%)~2.30s2.33sp=0.476 n=6
Check Time70.68s (± 0.12%)70.66s (± 0.43%)~70.36s71.06sp=0.810 n=6
Emit Time0.14s (± 3.77%)0.14s (± 2.88%)~0.14s0.15sp=0.114 n=6
Total Time79.73s (± 0.11%)79.71s (± 0.39%)~79.40s80.12sp=0.936 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,225,9481,226,432+484 (+ 0.04%)~~p=0.001 n=6
Types261,589261,903+314 (+ 0.12%)~~p=0.001 n=6
Memory used2,338,875k (± 0.01%)2,340,095k (± 0.03%)+1,221k (+ 0.05%)2,339,334k2,340,856kp=0.008 n=6
Parse Time5.08s (± 0.67%)5.05s (± 0.85%)~4.98s5.10sp=0.297 n=6
Bind Time1.90s (± 0.86%)1.91s (± 0.39%)~1.90s1.92sp=0.189 n=6
Check Time34.15s (± 0.25%)34.16s (± 0.40%)~34.01s34.36sp=1.000 n=6
Emit Time3.24s (± 1.36%)3.25s (± 1.68%)~3.19s3.34sp=1.000 n=6
Total Time44.39s (± 0.20%)44.38s (± 0.36%)~44.23s44.64sp=0.810 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,225,9481,226,432+484 (+ 0.04%)~~p=0.001 n=6
Types261,589261,903+314 (+ 0.12%)~~p=0.001 n=6
Memory used2,413,293k (± 0.03%)2,414,369k (± 0.04%)~2,413,444k2,415,752kp=0.066 n=6
Parse Time5.20s (± 1.09%)5.23s (± 0.72%)~5.19s5.28sp=0.574 n=6
Bind Time1.70s (± 0.62%)1.71s (± 1.21%)~1.69s1.74sp=0.405 n=6
Check Time34.66s (± 0.29%)34.65s (± 0.20%)~34.55s34.73sp=0.936 n=6
Emit Time3.31s (± 2.10%)3.30s (± 2.53%)~3.19s3.40sp=0.809 n=6
Total Time44.88s (± 0.22%)44.88s (± 0.19%)~44.79s45.02sp=0.810 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols258,230258,623+393 (+ 0.15%)~~p=0.001 n=6
Types104,789105,058+269 (+ 0.26%)~~p=0.001 n=6
Memory used427,103k (± 0.03%)428,136k (± 0.04%)+1,033k (+ 0.24%)427,960k428,413kp=0.005 n=6
Parse Time3.32s (± 0.70%)3.31s (± 1.06%)~3.27s3.36sp=0.746 n=6
Bind Time1.32s (± 1.49%)1.32s (± 0.88%)~1.30s1.33sp=0.868 n=6
Check Time17.84s (± 0.26%)17.93s (± 0.24%)+0.10s (+ 0.54%)17.86s17.98sp=0.016 n=6
Emit Time1.66s (± 0.91%)1.65s (± 1.40%)~1.62s1.68sp=0.806 n=6
Total Time24.13s (± 0.15%)24.22s (± 0.29%)+0.09s (+ 0.38%)24.12s24.29sp=0.037 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors3535~~~p=1.000 n=6
Symbols224,565224,565~~~p=1.000 n=6
Types93,73493,734~~~p=1.000 n=6
Memory used369,466k (± 0.03%)369,519k (± 0.01%)~369,477k369,556kp=0.128 n=6
Parse Time3.43s (± 1.35%)3.44s (± 0.68%)~3.41s3.47sp=0.687 n=6
Bind Time1.93s (± 0.60%)1.93s (± 0.89%)~1.91s1.95sp=0.935 n=6
Check Time19.14s (± 0.46%)19.16s (± 0.35%)~19.04s19.23sp=0.572 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time24.51s (± 0.45%)24.53s (± 0.35%)~24.39s24.63sp=0.810 n=6
vscode - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,891,1602,891,160~~~p=1.000 n=6
Types978,184978,184~~~p=1.000 n=6
Memory used3,054,909k (± 0.00%)3,054,954k (± 0.00%)~3,054,858k3,055,012kp=0.173 n=6
Parse Time13.70s (± 0.14%)13.69s (± 0.22%)~13.64s13.73sp=0.570 n=6
Bind Time4.18s (± 0.82%)4.18s (± 0.28%)~4.16s4.19sp=0.681 n=6
Check Time74.29s (± 2.08%)74.73s (± 3.04%)~72.97s77.73sp=0.810 n=6
Emit Time23.06s (± 6.80%)22.50s (± 8.89%)~19.87s24.13sp=1.000 n=6
Total Time115.22s (± 0.35%)115.10s (± 0.31%)~114.56s115.54sp=0.630 n=6
webpack - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols267,239267,239~~~p=1.000 n=6
Types108,815108,815~~~p=1.000 n=6
Memory used411,860k (± 0.02%)411,845k (± 0.03%)~411,702k411,960kp=1.000 n=6
Parse Time4.75s (± 0.54%)4.73s (± 0.55%)~4.69s4.76sp=0.107 n=6
Bind Time2.10s (± 0.63%)2.09s (± 0.49%)~2.07s2.10sp=0.134 n=6
Check Time20.76s (± 0.31%)20.78s (± 0.35%)~20.64s20.85sp=0.572 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time27.61s (± 0.20%)27.60s (± 0.19%)~27.51s27.67sp=0.687 n=6
xstate-main - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols510,479510,479~~~p=1.000 n=6
Types161,600161,600~~~p=1.000 n=6
Memory used448,002k (± 0.05%)447,988k (± 0.07%)~447,649k448,501kp=0.810 n=6
Parse Time3.17s (± 0.62%)3.17s (± 0.59%)~3.14s3.19sp=0.870 n=6
Bind Time1.17s (± 0.35%)1.17s (± 1.00%)~1.16s1.19sp=0.242 n=6
Check Time17.00s (± 0.21%)17.05s (± 0.42%)~16.97s17.14sp=0.295 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time21.34s (± 0.25%)21.39s (± 0.30%)~21.33s21.48sp=0.291 n=6
System info unknown
Hosts
  • node (v18.15.0, x64)
Scenarios
  • Compiler-Unions - node (v18.15.0, x64)
  • angular-1 - node (v18.15.0, x64)
  • mui-docs - node (v18.15.0, x64)
  • self-build-src - node (v18.15.0, x64)
  • self-build-src-public-api - node (v18.15.0, x64)
  • self-compiler - node (v18.15.0, x64)
  • ts-pre-modules - node (v18.15.0, x64)
  • vscode - node (v18.15.0, x64)
  • webpack - node (v18.15.0, x64)
  • xstate-main - node (v18.15.0, x64)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot

Copy link
Copy Markdown
Contributor

Isabel Duan (@iisaduan) Here are the results of running the top 400 repos with tsc comparing main and refs/pull/58608/merge:

Everything looks good!

@iisaduan

Copy link
Copy Markdown
MemberAuthor

TypeScript Bot (@typescript-bot) user test this

@typescript-bot

TypeScript Bot (typescript-bot) commented Jul 13, 2024

Copy link
Copy Markdown
Contributor

Starting jobs; this comment will be updated as builds start and complete.

CommandStatusResults
user test this✅ Started✅ Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Isabel Duan (@iisaduan) Here are the results of running the user tests with tsc comparing main and refs/pull/58608/merge:

Everything looks good!

Comment threadsrc/compiler/checker.ts Outdated
}
else {
error(indexNode, Diagnostics.Type_0_cannot_be_used_as_an_index_type, typeToString(indexType));
const typeString = typeToString(indexNode.kind === SyntaxKind.BigIntLiteral ? getBaseTypeOfLiteralType(getContextFreeTypeOfExpression(indexNode)) : indexType);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this just end up producing bigint or do we expect something else to show up here? If something other than bigint can appear, we should add tests as the tests only show bigint. If this can only ever produce bigint, then I would just use the literal string.

Also, unless anyone else has a particular preference, I think Type '1n' cannot be used as an index type is also acceptable, so leaving this as typeToString(indexType) might be fine.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not really sure how the latest push resolved this; "bigInt" isn't a thing in TS or JS and I think Ron was suggesting to actually write the value? (See also my comment on the earlier thread with suggested code)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should either write the value, or bigint (all lowercase) as it's the underlying base type.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I've been looking at the tests, and some of the test cases have been inconsistent with the caps. I'll fix that.

Would you prefer the "property does not exist on type" error? I was using the "bigint literal type cannot be used as an index" error because the original design choice was the bigintliteral type cannot be used as an index, as you should use a string or number instead. "cannot be used as index" seemed more descriptive of what was happening than "property does not exist".

I don't mind using the value in the error message (1n cannot be used as an index type) if you like that better, and it is what you would get with typeToString(indexType). I changed it because bigint made the above more clear as well.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess if you just swap it back to bigint, that should be sufficient. I see what you mean about the inconsistency; it's not that say 1n doesn't exist on the type, but that bigint isn't supported at all?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's valid syntactically in js to index with bigints, but we've disallowed them when type checking

Comment threadsrc/compiler/types.ts
@DanielRosenwasserDaniel Rosenwasser (DanielRosenwasser) added Breaking Change Would introduce errors in existing code Domain: API Relates to the public API for TypeScript labels Jul 19, 2024

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few things that I didn't catch before that I want addressed, but I'm going to mark this as approved so you're not blocked on merging.

Comment threadsrc/compiler/checker.ts Outdated
Comment threadsrc/compiler/diagnosticMessages.json Outdated
@iisaduan
Isabel Duan (iisaduan) merged commit dfb8701 into microsoft:mainJul 20, 2024
@iisaduan
Isabel Duan (iisaduan) deleted the parse-bigint-index branch July 20, 2024 00:48
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: TeamBreaking ChangeWould introduce errors in existing codeDomain: APIRelates to the public API for TypeScriptFor Milestone BugPRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LiteralPropertyName should allow BigInt

6 participants

@iisaduan@typescript-bot@DanielRosenwasser@rbuckton@jakebailey@sandersn