facebook / facebook/flow

$Keys of a subclass errors incorrectly on superclass keys

オープン
#2,497 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Rust
スター
22.3k
フォーク
1.9k
PR マージ指標
30日以内にマージされた PR はありません

説明

[Example](https://flowtype.org/try/#0PQKgBAAgZgNg9gdzCYAoVBjGBDAzrsAYTAG9UwwAPALjADsBXAWwCMBTAJwG5UBfdLHgIARMG0oAXNnQAmBYiX6oYbCWBlgAvPTZJhACgCU6FWpr1m7DlvUA6SmGDAwAOThiOHOB2WqwAa1oAEgBpNgBPXAAeYQA+GwBySgTHZwBRT29UIA)

In this example, `'x'` should satisfy the type `$Keys` since `x` is a field on the superclass, but instead it throws an error.

---

``` js
/* @flow */

class C {
x: number;
}

class D extends C {}

let d = new D()

let x: number = d.x // No error
let k: $Keys = 'x' // Error
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。