Type arguments for WebGLRenderingContext.uniform*fv as ArrayLike<number> instead of number[] #14925
Labels
Bug
A bug in TypeScript
Domain: lib.d.ts
The issue relates to the different libraries shipped with TypeScript
Fixed
A PR has been merged for this issue
Help Wanted
You can do this
Milestone
The
uniform*fv
methods onWebGLRenderingContext
currently accept aFloat32Array | number[]
, however it would be nicer if they could acceptFloat32Array | ArrayLike<number>
. The webgl specification gives two signatures for these methods, one accepting aFloat32Array
and another accepting asequence<GLFloat>
. Hence it doesn't require an actual array, just something that may be indexed.ArrayLike<number>
seems like a better fit.TypeScript Version: 2.2.1 / nightly (2.2.0-dev.201xxxxx)
Code
Expected behavior:
I expected that I could, the webgl specification does not require this to be an actual array, it says
sequence<GLFloat>
.Actual behavior:
It refuses to compile and I need to cast
v
.The text was updated successfully, but these errors were encountered: