You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above code throws the following error when passing to a TypedArray an awaited ArrayBuffer from a Promise involving a then call
No overload matches this call.
The last overload gave the following error.
Argument of type 'Iterable<number> | ArrayBuffer' is not assignable to parameter of type 'ArrayBuffer'.
Type 'Iterable<number>' is missing the following properties from type 'ArrayBuffer': byteLength, slice, [Symbol.toStringTag]
π Expected behavior
The code should work because the following will not throw an error as the follow examples don't throw an error (also in playground link):
// refactoring the arrayBuffer definition to a separate variable doesn't throw an errorconstarrayBuffer=awaitPromise.resolve().then(()=>newArrayBuffer(10))constarray=newUint8Array(arrayBuffer)
// without the "then" it doesn't throw an errorconstarray=newUint8Array(Promise.resolve(newArrayBuffer(10)))
The text was updated successfully, but these errors were encountered:
Bug Report
π Search Terms
TypedArray
,ArrayBuffer
,Promise.then
,await
π Version & Regression Information
β― Playground Link
Playground link with relevant code
π» Code
π Actual behavior
The above code throws the following error when passing to a
TypedArray
an awaitedArrayBuffer
from aPromise
involving athen
callπ Expected behavior
The code should work because the following will not throw an error as the follow examples don't throw an error (also in playground link):
The text was updated successfully, but these errors were encountered: