EventEmitter when inherited deeply does not respect parent type
Open
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
I am having an issue involving class inheritance and EventEmitter in the following scenario:
```
class A extends EventEmitter
class B extends A
const test: B = new B()
events$EventEmitter. This type is incompatible with B
```
Is there a way to avoid this?
From what it looks like, the type of B is class B on the const declaration, but new B() is the type of events$EventEmitter, which is inherited from type A.
Contributor guide
Assessment
This issue has not been assessed yet.