-
Notifications
You must be signed in to change notification settings - Fork 12.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebGL IDL generated types should use ArrayLike<*> for sequence<*> #28198
WebGL IDL generated types should use ArrayLike<*> for sequence<*> #28198
Comments
PRs welcomed. You can find more information about contributing lib.d.ts fixes at https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes. |
As I wrote in microsoft/TypeScript-DOM-lib-generator#592, Web IDL sequence requires iterator support but ArrayLike does not. |
|
Yes, but unfortunately we cannot use |
Maybe we still can add overloads via |
Aye, that's what I was thinking. The es6 Dom lib seems like just the place for an overload like this. |
Oh, I just remembered that I opened an issue exactly for this purpose. microsoft/TypeScript-DOM-lib-generator#443 I can start working on this if the team agrees. |
That makes more sense @saschanaz. Also, does this change the scope to a more general approach? Should all number sequences in |
We should keep existing
I'm not sure I understand. |
I'm not familiar with the codebase so I'm probably missing something. The baselines defines only If the translation to |
But L15924 doesn't contains |
@saschanaz true, sorry for messing things up. I was indeed mixing |
I would suggest you changing the title: ArrayLike -> Iterable. |
TypeScript Version: 3.2.0-dev.201xxxxx
Search Terms: WebGL, idl, float32list
Code
Expected behavior: Compiles without errors (used to work in 3.0)
Actual behavior: Compiles with error since
ArrayLike<number>
isn't assignable toFloat32Array
nornumber[]
Playground Link: http://www.typescriptlang.org/play/#src=const%20ctx%3A%20WebGLRenderingContext%20%3D%20null%3B%0D%0Aconst%20value%3A%20ArrayLike%3Cnumber%3E%20%3D%20%5B0%2C%201%2C%202%5D%3B%0D%0A%0D%0Actx.uniform3fv(0%2C%20value)%3B
Related Issues: Wrong WebGLRenderingContext interface definition for pixelStorei #27542
The text was updated successfully, but these errors were encountered: