-
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
Type syntax in destructured arguments of ES6 functions #307
Comments
See #235 for a discussion about destructuring. |
As @fkling points out, That said, I can't think of a reason why you shouldn't be able to at least annotate the full destructuring pattern: (it seems Flow currently doesn't parse this)
@gabelevi Can you think of any reasons why that ^ shouldn't work as a workaround? |
The workaround seems to work fine now. |
The workaround doesn't allow you to specify default arguments in your parameter declaration :( |
Say I have a function that looks like this:
When I run this through the transpiler, it complains that I'm using the same argument twice in strict mode –– I assume that's a reference to
string
. Obviously, the flow syntax is not working here. I am wondering how I should type the destructured arguments to make it work. I suppose I could just remove the strict mode pragma.The text was updated successfully, but these errors were encountered: