Premature class `this` specialization
- Lingua principale
- Rust
- Stelle
- 22.3k
- Fork
- 1.9k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
For `this` return type on a class method, `super`-based method calls from an extension class see the superclass type instead of `this` type, e.g.
```js
class A {
self(): this {
return this;
}
}
const K: Class = A; // `self(): this` \mapsto `self(): A`
class B extends K {
self(): this { // false negative from Flow
return super.self();
}
}
```
```
11: return super.self();
^ A. This type is incompatible with the expected return type of
10: self(): this {
^ B
11: return super.self();
^ A. This type is incompatible with the expected return type of
10: self(): this {
^ some incompatible instantiation of `this`
```
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.