We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This typechecks:
function f({a = 1, b = 2}) { } f({});
But this does not:
function f({a = 1, b = 2} = {}) { } f();
with an error Type '{}' has no property 'a' and no string index.
Type '{}' has no property 'a' and no string index
I'd expect both to behave the same way.
This idiom is pretty convenient in ES6-style code and I don't see why a passed parameter would be treated differently from a default value here.
The text was updated successfully, but these errors were encountered:
This is fixed by #4598. The fix is already in the nightly builds and will ship in the 1.7 release.
Sorry, something went wrong.
No branches or pull requests
This typechecks:
But this does not:
with an error
Type '{}' has no property 'a' and no string index
.I'd expect both to behave the same way.
This idiom is pretty convenient in ES6-style code and I don't see why a passed parameter would be treated differently from a default value here.
The text was updated successfully, but these errors were encountered: