Type hole with compatibility between optional parameters/extra parameters
Aberta
bug
Typing: soundness
- Linguagem predominante
- Rust
- Estrelas
- 22.3k
- Forks
- 1.9k
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
```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.
Guia de contribuição
Avaliação
Esta issue ainda não foi avaliada.