-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flow doesn't respect interface definition when implementation exists #676
Comments
cc @bhosmer |
Seems like a duplicate of #447 |
Any idea if/when this will be fixed? |
I only today discovered that Flow actually supports type-checking of props passed to React components, but you have to add a line like |
I can't get this working, even with the above line in |
I was trying to type check some code that uses Immutable.JS and this interface definition: https://gist.github.com/kastermester/ad79da3e48064effd82e
I was getting stumped when this code wasn't throwing any Flow errors:
But this code was throwing the correct error (that "number" and "string" weren't compatible):
After discussing with @jeffmo on IRC, it seems that the reason this is happening is because Flow can't reason about the Immutable.js build properly, and since it isn't tagged with
@flow
, treats it's exports asany
, and ignores the immutable library def.Sure enough, when I ignore
node_modules/immutable
in my.flowconfig
, it uses my Immutable interface definition and throws errors (seemingly correct ones too!).The text was updated successfully, but these errors were encountered: