Skip to content

Conversation

greggman
Copy link
Contributor

These 2 constructor overloads appear to be missing. You can find similar overloads for other typed array constructors in es6.d.ts

Fixes #62343

@Copilot Copilot AI review requested due to automatic review settings August 28, 2025 21:50
@github-project-automation github-project-automation bot moved this to Not started in PR Backlog Aug 28, 2025
@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Aug 28, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds missing constructor overloads for the Float16Array type to bring it in line with other typed array constructors. The change ensures type consistency across all typed array types in TypeScript's standard library definitions.

  • Adds Float16Array constructor overloads to match existing patterns for other typed arrays
  • Updates test coverage to include Float16Array in typed array constructor validation

@greggman
Copy link
Contributor Author

@microsoft-github-policy-service agree

@github-project-automation github-project-automation bot moved this from Not started to Needs merge in PR Backlog Sep 9, 2025
@jakebailey
Copy link
Member

This LGTM but needs a format to be accepted.

These 2 constructor overloads appear to be missing.
You can find similar overloads for other typed array constructors in `es6.d.ts`
@greggman
Copy link
Contributor Author

greggman commented Sep 9, 2025

ran npm run format. It added a newline. pushed.

@jakebailey
Copy link
Member

@typescript-bot test it

probably won't say anything interesting, but

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 9, 2025

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

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

@jakebailey
Copy link
Member

@typescript-bot cherry-pick this to release-5.9

@typescript-bot
Copy link
Collaborator

typescript-bot commented Sep 9, 2025

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

Command Status Results
cherry-pick this to release-5.9 ✅ Started ✅ Results

@typescript-bot
Copy link
Collaborator

Hey, @jakebailey! I've created #62426 for you.

@typescript-bot
Copy link
Collaborator

Hey @jakebailey, the results of running the DT tests are ready.

Everything looks the same!

You can check the log here.

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the user tests with tsc comparing main and refs/pull/62351/merge:

There were infrastructure failures potentially unrelated to your change:

  • 1 instance of "Git clone failed"

Otherwise...

Everything looks good!

@typescript-bot
Copy link
Collaborator

@jakebailey
The results of the perf run you requested are in!

Here they are:

tsc

Comparison Report - baseline..pr
Metric baseline pr Delta Best Worst p-value
Compiler-Unions - node (v18.15.0, x64)
Errors 34 34 ~ ~ ~ p=1.000 n=6
Symbols 62,370 62,370 ~ ~ ~ p=1.000 n=6
Types 50,386 50,386 ~ ~ ~ p=1.000 n=6
Memory used 194,141k (± 0.95%) 193,523k (± 0.77%) ~ 192,845k 196,568k p=0.173 n=6
Parse Time 1.31s 1.31s (± 0.48%) ~ 1.30s 1.32s p=1.000 n=6
Bind Time 0.73s 0.73s ~ ~ ~ p=1.000 n=6
Check Time 9.76s (± 0.19%) 9.75s (± 0.33%) ~ 9.69s 9.79s p=0.370 n=6
Emit Time 2.75s (± 0.59%) 2.74s (± 0.85%) ~ 2.72s 2.78s p=0.738 n=6
Total Time 14.54s (± 0.18%) 14.53s (± 0.28%) ~ 14.49s 14.60s p=0.252 n=6
angular-1 - node (v18.15.0, x64)
Errors 1 1 ~ ~ ~ p=1.000 n=6
Symbols 948,914 948,914 ~ ~ ~ p=1.000 n=6
Types 410,884 410,884 ~ ~ ~ p=1.000 n=6
Memory used 1,246,603k (± 0.00%) 1,246,638k (± 0.01%) ~ 1,246,520k 1,246,717k p=0.378 n=6
Parse Time 6.51s (± 1.15%) 6.51s (± 0.72%) ~ 6.47s 6.59s p=0.624 n=6
Bind Time 1.87s (± 0.22%) 1.87s (± 0.44%) ~ 1.86s 1.88s p=0.584 n=6
Check Time 32.18s (± 0.41%) 32.21s (± 0.14%) ~ 32.13s 32.27s p=0.936 n=6
Emit Time 14.88s (± 0.37%) 14.86s (± 0.25%) ~ 14.81s 14.91s p=0.688 n=6
Total Time 55.43s (± 0.26%) 55.45s (± 0.10%) ~ 55.39s 55.53s p=0.687 n=6
mui-docs - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 2,542,217 2,542,217 ~ ~ ~ p=1.000 n=6
Types 902,596 902,596 ~ ~ ~ p=1.000 n=6
Memory used 2,827,795k (± 0.00%) 2,827,763k (± 0.00%) ~ 2,827,575k 2,827,854k p=0.689 n=6
Parse Time 8.74s (± 0.29%) 8.76s (± 0.29%) ~ 8.73s 8.78s p=0.119 n=6
Bind Time 2.18s (± 0.38%) 2.18s (± 0.65%) ~ 2.16s 2.20s p=0.503 n=6
Check Time 86.37s (± 1.24%) 86.28s (± 0.23%) ~ 85.93s 86.46s p=0.297 n=6
Emit Time 0.30s (± 1.35%) 0.62s (±125.19%) ~ 0.30s 2.20s p=0.527 n=6
Total Time 97.60s (± 1.07%) 97.84s (± 0.63%) ~ 97.43s 99.07s p=0.128 n=6
self-build-src - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,236,922 1,236,958 +36 (+ 0.00%) ~ ~ p=0.001 n=6
Types 259,638 259,638 ~ ~ ~ p=1.000 n=6
Memory used 2,386,981k (± 0.02%) 2,447,614k (± 6.05%) ~ 2,386,810k 2,750,219k p=0.230 n=6
Parse Time 5.19s (± 0.32%) 5.18s (± 1.00%) ~ 5.10s 5.25s p=0.810 n=6
Bind Time 1.82s (± 0.67%) 1.80s (± 0.78%) ~ 1.78s 1.82s p=0.087 n=6
Check Time 35.15s (± 0.30%) 35.03s (± 0.52%) ~ 34.67s 35.18s p=0.230 n=6
Emit Time 2.98s (± 1.91%) 2.99s (± 1.31%) ~ 2.95s 3.05s p=0.810 n=6
Total Time 45.15s (± 0.26%) 45.01s (± 0.42%) ~ 44.67s 45.17s p=0.230 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 1,236,922 1,236,958 +36 (+ 0.00%) ~ ~ p=0.001 n=6
Types 259,638 259,638 ~ ~ ~ p=1.000 n=6
Memory used 2,939,515k (±12.70%) 2,966,146k (±11.33%) ~ 2,457,418k 3,181,622k p=0.689 n=6
Parse Time 6.92s (± 2.53%) 6.84s (± 1.17%) ~ 6.71s 6.93s p=0.296 n=6
Bind Time 2.20s (± 1.76%) 2.18s (± 1.87%) ~ 2.14s 2.23s p=0.422 n=6
Check Time 42.41s (± 0.47%) 42.31s (± 0.76%) ~ 41.74s 42.56s p=0.810 n=6
Emit Time 3.52s (± 2.57%) 3.50s (± 1.52%) ~ 3.44s 3.57s p=0.748 n=6
Total Time 55.07s (± 0.72%) 54.84s (± 0.70%) ~ 54.21s 55.11s p=0.173 n=6
self-compiler - node (v18.15.0, x64)
Errors 0 0 ~ ~ ~ p=1.000 n=6
Symbols 262,416 262,420 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Types 103,917 103,917 ~ ~ ~ p=1.000 n=6
Memory used 441,697k (± 0.02%) 441,677k (± 0.01%) ~ 441,603k 441,764k p=0.810 n=6
Parse Time 4.42s (± 1.12%) 4.41s (± 0.60%) ~ 4.37s 4.44s p=0.936 n=6
Bind Time 1.63s (± 1.45%) 1.63s (± 1.23%) ~ 1.60s 1.66s p=1.000 n=6
Check Time 23.45s (± 0.71%) 23.55s (± 0.36%) ~ 23.44s 23.65s p=0.336 n=6
Emit Time 1.91s (± 1.38%) 1.91s (± 0.90%) ~ 1.88s 1.93s p=1.000 n=6
Total Time 31.40s (± 0.65%) 31.50s (± 0.22%) ~ 31.42s 31.59s p=0.521 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors 72 72 ~ ~ ~ p=1.000 n=6
Symbols 225,367 225,367 ~ ~ ~ p=1.000 n=6
Types 94,290 94,290 ~ ~ ~ p=1.000 n=6
Memory used 371,188k (± 0.03%) 371,146k (± 0.02%) ~ 371,071k 371,224k p=0.810 n=6
Parse Time 3.59s (± 0.63%) 3.59s (± 1.16%) ~ 3.55s 3.65s p=0.809 n=6
Bind Time 1.97s (± 0.81%) 1.96s (± 1.24%) ~ 1.94s 2.00s p=0.220 n=6
Check Time 20.33s (± 0.39%) 20.40s (± 0.35%) ~ 20.26s 20.46s p=0.294 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 25.89s (± 0.36%) 25.95s (± 0.25%) ~ 25.84s 26.01s p=0.296 n=6
vscode - node (v18.15.0, x64)
Errors 1 1 ~ ~ ~ p=1.000 n=6
Symbols 3,888,179 3,888,179 ~ ~ ~ p=1.000 n=6
Types 1,225,176 1,225,176 ~ ~ ~ p=1.000 n=6
Memory used 3,712,684k (± 0.01%) 3,712,316k (± 0.00%) -368k (- 0.01%) 3,712,157k 3,712,581k p=0.031 n=6
Parse Time 18.90s (± 0.27%) 18.96s (± 0.78%) ~ 18.79s 19.14s p=0.688 n=6
Bind Time 6.08s (± 2.25%) 6.04s (± 0.88%) ~ 5.97s 6.11s p=0.936 n=6
Check Time 127.92s (± 2.87%) 123.86s (± 1.47%) 🟩-4.06s (- 3.17%) 122.57s 126.55s p=0.020 n=6
Emit Time 39.73s (± 9.17%) 46.33s (± 8.82%) 🔻+6.60s (+16.61%) 43.05s 54.38s p=0.045 n=6
Total Time 192.64s (± 1.74%) 195.20s (± 2.25%) ~ 190.93s 202.38s p=0.230 n=6
webpack - node (v18.15.0, x64)
Errors 37 37 ~ ~ ~ p=1.000 n=6
Symbols 361,368 361,372 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Types 158,854 158,854 ~ ~ ~ p=1.000 n=6
Memory used 519,048k (± 0.04%) 519,190k (± 0.03%) ~ 518,951k 519,358k p=0.378 n=6
Parse Time 4.59s (± 0.62%) 4.63s (± 0.50%) +0.04s (+ 0.84%) 4.59s 4.65s p=0.041 n=6
Bind Time 1.91s (± 1.74%) 1.95s (± 1.24%) ~ 1.90s 1.97s p=0.106 n=6
Check Time 22.01s (± 0.50%) 22.08s (± 1.00%) ~ 21.86s 22.47s p=0.748 n=6
Emit Time 0.00s (±244.70%) 0.00s ~ ~ ~ p=0.405 n=6
Total Time 28.51s (± 0.37%) 28.66s (± 0.81%) ~ 28.41s 29.06s p=0.296 n=6
xstate-main - node (v18.15.0, x64)
Errors 30 30 ~ ~ ~ p=1.000 n=6
Symbols 668,461 668,465 +4 (+ 0.00%) ~ ~ p=0.001 n=6
Types 200,558 200,558 ~ ~ ~ p=1.000 n=6
Memory used 573,965k (± 0.01%) 573,887k (± 0.02%) ~ 573,669k 574,004k p=0.575 n=6
Parse Time 4.27s (± 0.32%) 4.28s (± 0.71%) ~ 4.24s 4.32s p=0.739 n=6
Bind Time 1.32s (± 0.88%) 1.34s (± 0.47%) +0.02s (+ 1.39%) 1.33s 1.35s p=0.019 n=6
Check Time 20.09s (± 0.41%) 20.34s (± 1.99%) ~ 19.93s 20.85s p=0.377 n=6
Emit Time 0.00s 0.00s ~ ~ ~ p=1.000 n=6
Total Time 25.69s (± 0.34%) 25.96s (± 1.53%) ~ 25.53s 26.48s p=0.173 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)
Benchmark Name Iterations
Current pr 6
Baseline baseline 6

Developer Information:

Download Benchmarks

@typescript-bot
Copy link
Collaborator

@jakebailey Here are the results of running the top 400 repos with tsc comparing main and refs/pull/62351/merge:

Everything looks good!

@jakebailey jakebailey merged commit 3320dfd into microsoft:main Sep 9, 2025
33 checks passed
@github-project-automation github-project-automation bot moved this from Needs merge to Done in PR Backlog Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Float16Array's definition is incompatible with other typedarrays
3 participants