microsoft / microsoft/TypeScript
WebGLShader has no properties
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
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.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
src/index.ts の 63-64 行目と 146 行目にある例から始め、リンク先の TypeScript Playground を使って報告された動作を再現します。loadShader と createProgram の推論された Error の戻り値型と引数チェックを比較します。関数の引数が強制され、期待される戻り値型が正しく推論されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 28/100