From 97664b0f9a26568dde13738f462989f86c166785 Mon Sep 17 00:00:00 2001 From: Greggman Date: Wed, 27 Aug 2025 14:35:37 -0700 Subject: [PATCH] Add missing Float16Array constructors These 2 constructor overloads appear to be missing. You can find similar overloads for other typed array constructors in `es6.d.ts` --- src/lib/esnext.float16.d.ts | 2 ++ tests/cases/compiler/typedArrayConstructorOverloads.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/lib/esnext.float16.d.ts b/src/lib/esnext.float16.d.ts index 88b12f6753605..6a1f600040d75 100644 --- a/src/lib/esnext.float16.d.ts +++ b/src/lib/esnext.float16.d.ts @@ -356,6 +356,8 @@ interface Float16ArrayConstructor { new (length?: number): Float16Array; new (array: ArrayLike | Iterable): Float16Array; new (buffer: TArrayBuffer, byteOffset?: number, length?: number): Float16Array; + new (buffer: ArrayBuffer, byteOffset?: number, length?: number): Float16Array; + new (array: ArrayLike | ArrayBuffer): Float16Array; /** * The size in bytes of each element in the array. diff --git a/tests/cases/compiler/typedArrayConstructorOverloads.ts b/tests/cases/compiler/typedArrayConstructorOverloads.ts index c532545d39d1a..63fbfb07a9df0 100644 --- a/tests/cases/compiler/typedArrayConstructorOverloads.ts +++ b/tests/cases/compiler/typedArrayConstructorOverloads.ts @@ -12,6 +12,7 @@ type TypedArrayConstructor = | Uint16ArrayConstructor | Int32ArrayConstructor | Uint32ArrayConstructor + | Float16ArrayConstructor | Float32ArrayConstructor | Float64ArrayConstructor | BigInt64ArrayConstructor