microsoft / microsoft/TypeScript
Type definitions overshadowing
まだ誰も着手していません。
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 2日 4時間
- マージ済み PR(30日)
- 132
説明
TypeScript Version: 3.8.3
(also tried 3.9.0-dev.20200310)
Search Terms:
"Module '"immutable"' has no exported member"
Code
(not self contained)
import { hash } from "immutable";
export function test(): number {
return hash(1);
}
Actual behavior:
src/index.ts:1:10 - error TS2305: Module '"immutable"' has no exported member 'hash'.
1 import { hash } from "immutable";
~~~~
even though
grep "export function hash" node_modules/immutable/dist/immutable.d.ts
reveals
export function hash(value: any): number;
Because it uses type definitions in
node_modules/@types/draft-js/node_modules/immutable/dist/immutable.d.ts
instead of
node_modules/immutable/dist/immutable.d.ts
Demo:
sadly I did not find any way to put it in a playground, in any case:
https://gitlab.com/rawieo/issue_demo_1
Related Issues:
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
src/index.ts から始め、node_modules/immutable/dist/immutable.d.ts と node_modules/@types/draft-js/node_modules/immutable/dist/immutable.d.ts の宣言を比較します。TypeScript 3.8.3 または記載されている nightly バージョンで import を再現し、その後モジュール解決を追跡して、なぜネストされた定義が選択されるのかを理解します。hash の有効な export が TS2305 なしで解決されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- typescript
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100