microsoft / microsoft/TypeScript
Docs: "Type assertion" vs "asserts" keyword
オープン
まだ誰も着手していません。
Discussion
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
Hey there!
I’m updating Programming TypeScript to include assertions in control flow analysis, and was looking for guidance about naming.
Type assertions (x as T) and assertions in control flow analysis (asserts x is T) are similarly named. What’s a good way to call these these features, in a way that doesn’t confuse people and aligns with the way the TS team is communicating it?
A couple of ideas:
- Rename
x as Tto “type coercion” or “type casting" (even though it’s not a runtime behavior), and callasserts x is Ta “type assertion” - Keep
x as Tas-is (“type assertion”), and callasserts x is Ta “user-defined type assertion”, similar to a “user-defined type guard”
Thanks!
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、リンクされているプルリクエスト 32695 と、x as T と asserts x is T の違いに関する issue の議論を確認します。TypeScript のコミュニケーション方針に沿い、Programming TypeScript の更新の指針となる、合意された命名規則に到達すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100