Skip to content

Commit 211ae95

Browse files
committed
Add typed array constructor regression coverage
1 parent f52473a commit 211ae95

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

tsc/testdata/tests/cases/compiler/typedArrayConstructorOverloads.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,13 @@ export function makeTypedArray(buffer: ArrayBuffer, ctr: TypedArrayConstructor)
2222
new ctr(buffer);
2323
new ctr(buffer, 0, 0);
2424
}
25+
26+
// https://github.com/microsoft/TypeScript/issues/44191
27+
28+
const uint8Array = new Uint8Array(4);
29+
// @ts-expect-error typed array inputs do not accept byteOffset and length
30+
new Uint8Array(uint8Array, 0, 1);
31+
32+
const bigInt64Array = new BigInt64Array(4);
33+
// @ts-expect-error typed array inputs do not accept byteOffset and length
34+
new BigInt64Array(bigInt64Array, 0, 1);

0 commit comments

Comments
 (0)