Premature incompatibily errors in generic classes definitions
- Lingua principale
- Rust
- Stelle
- 22.3k
- Fork
- 1.9k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Here is simplified example:
```js
class Task {
static spawn: (task:Task) => Task
spawn ():Task {
return Task.spawn(this)
}
}
```
Here flow reports following error:
```
6: return Task.spawn(this)
^^^^^^^^^^^^^^^^ call of method `spawn`
3: class Task {
^ x. This type is incompatible with
4: static spawn: (task:Task) => Task
^^^^^ empty
```
What I actually expect is for flow to report type error when `task.spawn()` is called on tasks that can fail (`Task`) and report no errors when called on tasks that can not fail (`Task`).
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.