Type hole with compatibility between optional parameters/extra parameters
オープン
bug
Typing: soundness
- 主要言語
- Rust
- スター
- 22.3k
- フォーク
- 1.9k
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
```js
//@flow
const x = (a: number = 1): number => a;
const y: () => number = x;
// No Flow error
// Runtime error: Uncaught TypeError: y(...).toFixed is not a function
y('x').toFixed();
const z: (a: string) => number = y;
// No Flow error
// Runtime error: Uncaught TypeError: z(...).toFixed is not a function
z('x').toFixed();
```
I expected Flow to either report that `(number|void) => number` is incompatible with `() => number`, or that `() => number` is incompatible with `(string) => number`. Either would fix this problem, but allowing both in combination is definitely unsound.
コントリビューションガイド
評価
この issue はまだ評価されていません。