facebook / facebook/flow

Refinement should be lost after function call in loop

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

Descrizione

This code is wrong but Flow 0.37 gives no errors:

```js
/* @flow */

var x : {y : ?Function} = {
y: function() {
x.y = null;
},
};

if (x.y) {
for (const a of [1, 2, 3]) {
x.y();
}
}
```

https://flowtype.org/try/#0PQKgBAAgZgNg9gdzCYAoVA3AhgJzADzAC4wBvAT2LAH4AxAVwDsBjAFwEs5GBfMAXjKowYciShM2nRgAoAlIOHD8AOkoDG9GDADcQsNwA0qbrtTsoYaSvLzSeqHDzTmXAM6swWMHAsBtAIwGYABMQQDMALq2ekqqcrrC3MaoQA

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.