Skip to content

WebGL IDL generated types should use ArrayLike<*> for sequence<*> #28198

@jessevdk

Description

@jessevdk

TypeScript Version: 3.2.0-dev.201xxxxx

Search Terms: WebGL, idl, float32list

Code

const ctx: WebGLRenderingContext = null;
const value: ArrayLike<number> = [0, 1, 2];

ctx.uniform3fv(0, value);

Expected behavior: Compiles without errors (used to work in 3.0)

Actual behavior: Compiles with error since ArrayLike<number> isn't assignable to Float32Array nor number[]

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions