Premature incompatibily errors in generic classes definitions
Open
bug
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
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`).
Contributor guide
Assessment
This issue has not been assessed yet.