$Keys of a subclass errors incorrectly on superclass keys
未關閉
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 還沒有評估資料。