EventEmitter when inherited deeply does not respect parent type
Offen
- Vorherrschende Sprache
- Rust
- Sterne
- 22.3k
- Forks
- 1.9k
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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.
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.