microsoft / microsoft/TypeScript
intellisense in static method suggests TypeParameter of outer class
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.4k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
TypeScript Version: 3.2.0-dev.20181101
Search Terms:
Code
class Outer<T> {
doStuff() {
class Inner<T> {
static doStuff(param: /**/) {}
}
}
}
Expected behavior:
Intellisense does not suggest T as it will result in an error.
OR
T of Inner doesn't shadow the outer T in static members, which is therefore accessible.
Actual behavior:
Suggests T from Outer.
Related Issues:
#28471
TypeChecker.getSymbolsInScope correctly excludes TypeParameters of the containing class for its static members. Because of that an outer scope can add a symbol with the same name.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、issue またはその Playground リンクにあるネストされたジェネリックな static メンバーのケースを再現し、次に static メンバー周辺の TypeChecker.getSymbolsInScope と IntelliSense のシンボル収集を調査します。IntelliSense がアクセスできない外側の T を提案しなくなり、Inner's T の意図された扱いが維持されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- compilers, developer-experience
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100