Skip to content

Add missing Float16Array constructors - #62351

Merged
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
greggman:float16-issue
Sep 9, 2025
Merged

Add missing Float16Array constructors#62351
Jake Bailey (jakebailey) merged 1 commit into
microsoft:mainfrom
greggman:float16-issue

Conversation

@greggman

Copy link
Copy Markdown
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

CopilotAI review requested due to automatic review settings August 28, 2025 21:50
@github-project-automationgithub-project-automationBot moved this to Not started in PR BacklogAug 28, 2025
@typescript-botTypeScript Bot (typescript-bot) added the For Backlog Bug PRs that fix a backlog bug label Aug 28, 2025

CopilotAI left a comment

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.

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
Copy Markdown
ContributorAuthor

@microsoft-github-policy-service agree

@github-project-automationgithub-project-automationBot moved this from Not started to Needs merge in PR BacklogSep 9, 2025
@jakebailey

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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

@jakebailey

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) test it

probably won't say anything interesting, but

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 9, 2025

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

@jakebailey

Copy link
Copy Markdown
Member

TypeScript Bot (@typescript-bot) cherry-pick this to release-5.9

@typescript-bot

TypeScript Bot (typescript-bot) commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

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

CommandStatusResults
cherry-pick this to release-5.9✅ Started✅ Results

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey, Jake Bailey (@jakebailey)! I've created #62426 for you.

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Jake Bailey (@jakebailey), 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

Jake Bailey (@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
Copy Markdown
Contributor

Jake Bailey (@jakebailey)
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)
Errors3434~~~p=1.000 n=6
Symbols62,37062,370~~~p=1.000 n=6
Types50,38650,386~~~p=1.000 n=6
Memory used194,141k (± 0.95%)193,523k (± 0.77%)~192,845k196,568kp=0.173 n=6
Parse Time1.31s1.31s (± 0.48%)~1.30s1.32sp=1.000 n=6
Bind Time0.73s0.73s~~~p=1.000 n=6
Check Time9.76s (± 0.19%)9.75s (± 0.33%)~9.69s9.79sp=0.370 n=6
Emit Time2.75s (± 0.59%)2.74s (± 0.85%)~2.72s2.78sp=0.738 n=6
Total Time14.54s (± 0.18%)14.53s (± 0.28%)~14.49s14.60sp=0.252 n=6
angular-1 - node (v18.15.0, x64)
Errors11~~~p=1.000 n=6
Symbols948,914948,914~~~p=1.000 n=6
Types410,884410,884~~~p=1.000 n=6
Memory used1,246,603k (± 0.00%)1,246,638k (± 0.01%)~1,246,520k1,246,717kp=0.378 n=6
Parse Time6.51s (± 1.15%)6.51s (± 0.72%)~6.47s6.59sp=0.624 n=6
Bind Time1.87s (± 0.22%)1.87s (± 0.44%)~1.86s1.88sp=0.584 n=6
Check Time32.18s (± 0.41%)32.21s (± 0.14%)~32.13s32.27sp=0.936 n=6
Emit Time14.88s (± 0.37%)14.86s (± 0.25%)~14.81s14.91sp=0.688 n=6
Total Time55.43s (± 0.26%)55.45s (± 0.10%)~55.39s55.53sp=0.687 n=6
mui-docs - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols2,542,2172,542,217~~~p=1.000 n=6
Types902,596902,596~~~p=1.000 n=6
Memory used2,827,795k (± 0.00%)2,827,763k (± 0.00%)~2,827,575k2,827,854kp=0.689 n=6
Parse Time8.74s (± 0.29%)8.76s (± 0.29%)~8.73s8.78sp=0.119 n=6
Bind Time2.18s (± 0.38%)2.18s (± 0.65%)~2.16s2.20sp=0.503 n=6
Check Time86.37s (± 1.24%)86.28s (± 0.23%)~85.93s86.46sp=0.297 n=6
Emit Time0.30s (± 1.35%)0.62s (±125.19%)~0.30s2.20sp=0.527 n=6
Total Time97.60s (± 1.07%)97.84s (± 0.63%)~97.43s99.07sp=0.128 n=6
self-build-src - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,236,9221,236,958+36 (+ 0.00%)~~p=0.001 n=6
Types259,638259,638~~~p=1.000 n=6
Memory used2,386,981k (± 0.02%)2,447,614k (± 6.05%)~2,386,810k2,750,219kp=0.230 n=6
Parse Time5.19s (± 0.32%)5.18s (± 1.00%)~5.10s5.25sp=0.810 n=6
Bind Time1.82s (± 0.67%)1.80s (± 0.78%)~1.78s1.82sp=0.087 n=6
Check Time35.15s (± 0.30%)35.03s (± 0.52%)~34.67s35.18sp=0.230 n=6
Emit Time2.98s (± 1.91%)2.99s (± 1.31%)~2.95s3.05sp=0.810 n=6
Total Time45.15s (± 0.26%)45.01s (± 0.42%)~44.67s45.17sp=0.230 n=6
self-build-src-public-api - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols1,236,9221,236,958+36 (+ 0.00%)~~p=0.001 n=6
Types259,638259,638~~~p=1.000 n=6
Memory used2,939,515k (±12.70%)2,966,146k (±11.33%)~2,457,418k3,181,622kp=0.689 n=6
Parse Time6.92s (± 2.53%)6.84s (± 1.17%)~6.71s6.93sp=0.296 n=6
Bind Time2.20s (± 1.76%)2.18s (± 1.87%)~2.14s2.23sp=0.422 n=6
Check Time42.41s (± 0.47%)42.31s (± 0.76%)~41.74s42.56sp=0.810 n=6
Emit Time3.52s (± 2.57%)3.50s (± 1.52%)~3.44s3.57sp=0.748 n=6
Total Time55.07s (± 0.72%)54.84s (± 0.70%)~54.21s55.11sp=0.173 n=6
self-compiler - node (v18.15.0, x64)
Errors00~~~p=1.000 n=6
Symbols262,416262,420+4 (+ 0.00%)~~p=0.001 n=6
Types103,917103,917~~~p=1.000 n=6
Memory used441,697k (± 0.02%)441,677k (± 0.01%)~441,603k441,764kp=0.810 n=6
Parse Time4.42s (± 1.12%)4.41s (± 0.60%)~4.37s4.44sp=0.936 n=6
Bind Time1.63s (± 1.45%)1.63s (± 1.23%)~1.60s1.66sp=1.000 n=6
Check Time23.45s (± 0.71%)23.55s (± 0.36%)~23.44s23.65sp=0.336 n=6
Emit Time1.91s (± 1.38%)1.91s (± 0.90%)~1.88s1.93sp=1.000 n=6
Total Time31.40s (± 0.65%)31.50s (± 0.22%)~31.42s31.59sp=0.521 n=6
ts-pre-modules - node (v18.15.0, x64)
Errors7272~~~p=1.000 n=6
Symbols225,367225,367~~~p=1.000 n=6
Types94,29094,290~~~p=1.000 n=6
Memory used371,188k (± 0.03%)371,146k (± 0.02%)~371,071k371,224kp=0.810 n=6
Parse Time3.59s (± 0.63%)3.59s (± 1.16%)~3.55s3.65sp=0.809 n=6
Bind Time1.97s (± 0.81%)1.96s (± 1.24%)~1.94s2.00sp=0.220 n=6
Check Time20.33s (± 0.39%)20.40s (± 0.35%)~20.26s20.46sp=0.294 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time25.89s (± 0.36%)25.95s (± 0.25%)~25.84s26.01sp=0.296 n=6
vscode - node (v18.15.0, x64)
Errors11~~~p=1.000 n=6
Symbols3,888,1793,888,179~~~p=1.000 n=6
Types1,225,1761,225,176~~~p=1.000 n=6
Memory used3,712,684k (± 0.01%)3,712,316k (± 0.00%)-368k (- 0.01%)3,712,157k3,712,581kp=0.031 n=6
Parse Time18.90s (± 0.27%)18.96s (± 0.78%)~18.79s19.14sp=0.688 n=6
Bind Time6.08s (± 2.25%)6.04s (± 0.88%)~5.97s6.11sp=0.936 n=6
Check Time127.92s (± 2.87%)123.86s (± 1.47%)🟩-4.06s (- 3.17%)122.57s126.55sp=0.020 n=6
Emit Time39.73s (± 9.17%)46.33s (± 8.82%)🔻+6.60s (+16.61%)43.05s54.38sp=0.045 n=6
Total Time192.64s (± 1.74%)195.20s (± 2.25%)~190.93s202.38sp=0.230 n=6
webpack - node (v18.15.0, x64)
Errors3737~~~p=1.000 n=6
Symbols361,368361,372+4 (+ 0.00%)~~p=0.001 n=6
Types158,854158,854~~~p=1.000 n=6
Memory used519,048k (± 0.04%)519,190k (± 0.03%)~518,951k519,358kp=0.378 n=6
Parse Time4.59s (± 0.62%)4.63s (± 0.50%)+0.04s (+ 0.84%)4.59s4.65sp=0.041 n=6
Bind Time1.91s (± 1.74%)1.95s (± 1.24%)~1.90s1.97sp=0.106 n=6
Check Time22.01s (± 0.50%)22.08s (± 1.00%)~21.86s22.47sp=0.748 n=6
Emit Time0.00s (±244.70%)0.00s~~~p=0.405 n=6
Total Time28.51s (± 0.37%)28.66s (± 0.81%)~28.41s29.06sp=0.296 n=6
xstate-main - node (v18.15.0, x64)
Errors3030~~~p=1.000 n=6
Symbols668,461668,465+4 (+ 0.00%)~~p=0.001 n=6
Types200,558200,558~~~p=1.000 n=6
Memory used573,965k (± 0.01%)573,887k (± 0.02%)~573,669k574,004kp=0.575 n=6
Parse Time4.27s (± 0.32%)4.28s (± 0.71%)~4.24s4.32sp=0.739 n=6
Bind Time1.32s (± 0.88%)1.34s (± 0.47%)+0.02s (+ 1.39%)1.33s1.35sp=0.019 n=6
Check Time20.09s (± 0.41%)20.34s (± 1.99%)~19.93s20.85sp=0.377 n=6
Emit Time0.00s0.00s~~~p=1.000 n=6
Total Time25.69s (± 0.34%)25.96s (± 1.53%)~25.53s26.48sp=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)
BenchmarkNameIterations
Currentpr6
Baselinebaseline6

Developer Information:

Download Benchmarks

@typescript-bot

Copy link
Copy Markdown
Contributor

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

Everything looks good!

@jakebailey
Jake Bailey (jakebailey) merged commit 3320dfd into microsoft:mainSep 9, 2025
33 checks passed
@github-project-automationgithub-project-automationBot moved this from Needs merge to Done in PR BacklogSep 9, 2025
Jake Bailey (jakebailey) pushed a commit that referenced this pull request Sep 25, 2025
…e-5.9 (#62426)
Co-authored-by: Greggman <github@greggman.com>
@microsoftMicrosoft (microsoft) locked as resolved and limited conversation to collaborators Mar 9, 2026
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

For Backlog BugPRs 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

5 participants

@greggman@jakebailey@typescript-bot@andrewbranch