facebook / facebook/flow

Confuse behavior when comparing enum

Aperta
#4,347 0 commenti 1 reazione 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

https://flow.org/try/#0PTAEAEDMBsHsHcBQ0CmAXUBDAXKA5JngD54BGxeAxnqALz6GKICWkoAFJnfXgCZ4BKUAG9QIUADtYoFACdZsWYgC+TVp26gAjENHi5CpapZsNtc-n66xYA4pVrTXc-R0ibk6XaNA

![image](https://user-images.githubusercontent.com/5233940/28022913-081820c0-65bf-11e7-9a6d-6e6f9c677487.png)

I think this is a quite strange behavior comparing to [typescript version](http://www.typescriptlang.org/play/index.html#src=let%20a%3A%20'a'%7C'b'%7C'c'%20%3D%20'a'%0D%0A%0D%0Aif%20(a%20%3D%3D%20'd')%20%7B%20%2F%2F%20no%20error%0D%0A%7D%0D%0A%0D%0Aif(a%20%3D%3D%201)%20%7B%20%2F%2F%20error%0D%0A%7D%0D%0A%0D%0Aif%20(a%20%3D%3D%3D%20'd')%20%7B%20%2F%2F%20error%0D%0A%7D%0D%0A%0D%0Aif%20(a%20%3D%3D%3D%201)%20%7B%20%2F%2F%20no%20error%0D%0A%7D),
![image](https://user-images.githubusercontent.com/5233940/28022872-eb14db8a-65be-11e7-893c-258efdf3b007.png)

and personaly I'm more agree with the typescript version, because people will make less mistack.

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.