Skip to content

WebGLShader has no properties #35696

@vjancik

Description

@vjancik

TypeScript Version: 3.7.3

Search Terms: array element type checking, error type checking, stops checking function argument types

Code
https://github.com/vjancik/dont-find-me-yet/blob/tsc-issue/src/index.ts#L63-L64

  • fails to infer a possible Error type
  • and if I set it explicitly (see Playground), fails to enforce it in

https://github.com/vjancik/dont-find-me-yet/blob/tsc-issue/src/index.ts#L146

  • createProgram doesn't enforce WebGLShader[] at all on the first argument, or seemingly any of the other arguments as well. I can add any variable in there and the array accepts it (also Playground)

Expected behavior:
Types of fn. arguments on createProgram get enforced correctly.
Optional: Return type on loadShader & createProgram gets inferred correctly as ... | Error

Actual behavior:
The issue doesn't resolve even if I specify all return types on all functions manually.

Playground Link:
Playground link

Related Issues:
No, there are multiple problems and I can't pinpoint the cause in a very specific setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions