facebook / facebook/flow

Confuse behavior when comparing enum

Offen
#4,347 0 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Rust
Sterne
22.3k
Forks
1.9k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.