-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScript
Milestone
Description
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
createProgramdoesn't enforceWebGLShader[]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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: lib.d.tsThe issue relates to the different libraries shipped with TypeScriptThe issue relates to the different libraries shipped with TypeScript