facebook / facebook/flow

Function from class to class

Aperta
#3,915 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
22.3k
Fork
1.9k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

How do I properly annotate the following code?

```js
const AMixin = superclass => class extends superclass {
aMixedMethod() {}
}

const ABMixin = superclass => class extends AMixin(superclass) {
bMixedMethod() {}
}

export {
AMixin,
ABMixin,
};
```

This example on [flow.org/try](https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVBjOA7AzgFzAEEBZASwA8zswBeMXAVwAcBTAJwxgENdc6AfGC69+rCvlbYAJvyZtOPPmADeqMGG7kKraSVb4AFnGkAKAJSqAvqhuYcBYgCFt1OgxYcRy2kO9iJKVliV2xTeS8lXEs1DQAjbV19IxMLa1t0cWY4dkJYkMpqABp1Z1CSqwBuIA).

Analogous code without `exports` works fine with inferred types ([example](https://flow.org/try/#0PQKgBAAgZgNg9gdzCYAoVBjOA7AzgFzAEEBZASwA8zswBeMXAVwAcBTAJwxgENdc6AfGC69+rCvlbYAJvyZtOPPmADeqMGG7kKraSVb4AFnGkAKAJSqAvqhuYcBYgCFt1OgxYcRy2kO9iJKVliV2xTeS8lXEs1DQAjbV19IxMLa1t0f2JVdU1k4zMYmxsspzBxSRl+IhdKalMiGNyEgwK0lWLMh0I492xWJCcLAG50OIA6LUok1tTzUYmE6b1ZwoXJ-Ln1lpS11AmMTbWgA)), but I am not sure what the inferred signature is or how to get it or whether it is possible.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.