Type hole with compatibility between optional parameters/extra parameters
Ouverte
bug
Typing: soundness
- Langage dominant
- Rust
- Étoiles
- 22.3k
- Forks
- 1.9k
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
```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.
Guide de contribution
Ouvrir le guide de contribution
Évaluation
Cette issue n'a pas encore été évaluée.