Type hole with compatibility between optional parameters/extra parameters
Đang mở
bug
Typing: soundness
- Ngôn ngữ chính
- Rust
- Star
- 22.3k
- Fork
- 1.9k
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
```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.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.