microsoft / microsoft/TypeScript
Incorrect docs: type compatibility for functions with overloads
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
Search Terms: functions with overloads, type compatibility
In the docs, it says: "When a function has overloads, each overload in the source type must be matched by a compatible signature on the target type." But it should be "When a function has overloads, each overload in the source type target type must be matched by a compatible signature on the target type source type."
Code
The actual behaviour is right:
type t1 = {
(foo: string): string
(foo: number): number
}
type t2 = {
(foo: string): string
}
declare let v1: t1;
declare let v2: t2;
v2 = v1 // OK
v1 = v2 // Error
The type on the right side of = is considered "the source type".
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
型の互換性に関するリンク先の TypeScript Handbook のページから始め、オーバーロードの互換性について説明しているセクションを見つけます。記載内容を提示された代入例と比較し、ソース型とターゲット型が一貫して説明されるようにソースドキュメントを更新します。レンダリングされたページと、例に記載された動作を確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 68/100