microsoft / microsoft/TypeScript
False positive error report for interface type missing index signature, thus not assignable to object type with `unknown` values.
オープン
@RyanCavanaugh がすでに取り組んでいます。
2019年7月8日 から。
Docs
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
TypeScript Version: 3.6.0-dev.20190704 (3.4.3 doesn't have this bug)
Search Terms:
index signature, unknown, assignable, interface
Code
interface A {
properties?: { [Key: string]: unknown };
}
type Bar = {
key?: "value";
};
interface Baz {
key?: "value";
}
interface B extends A { // ok
properties?: Bar;
}
interface C extends A { // error: Baz is not assignable to { [Key: string]: unknown } -> Index signature is missing
properties?: Baz;
}
Expected behavior:
No error expected, interface C extends A correctly.
Actual behavior:
Error because interface C does not extend interface A
Related Issues:
#30977 (this one is specifically for enums)
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。