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
Try these lines:
const arr = [{foo: 42}, {foo: 17}]; const index = 1; const {[index]: {foo}} = arr;
As you can see here, no error is reported until v0.184 but v0.185+ raises a prop-missing error.
prop-missing
It is worthy to note that replacing index by a number works in v0.185:
index
const arr = [{foo: 42}, {foo: 17}]; const {[1]: {foo}} = arr;
The text was updated successfully, but these errors were encountered:
The same issue arises when destructuring objects:
const obj = {foo: {bar: 42}}; const key = 'foo'; const {[key]: {bar}} = obj;
Try it here.
Sorry, something went wrong.
Thanks for the report and the repros @Robloche !
This surfaced as an issue in 0.185 since we turned on inference_mode=constrain_writes by default.
inference_mode=constrain_writes
I have identified the root cause and I am preparing a fix. Hopefully, it will be included in 0.186.
8b05d56
No branches or pull requests
Try these lines:
As you can see here, no error is reported until v0.184 but v0.185+ raises a
prop-missing
error.It is worthy to note that replacing
index
by a number works in v0.185:The text was updated successfully, but these errors were encountered: