Skip to content
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

Duplicate fields in object comprehensions are not detected #121

Closed
szeiger opened this issue Jun 17, 2021 · 1 comment · Fixed by #156
Closed

Duplicate fields in object comprehensions are not detected #121

szeiger opened this issue Jun 17, 2021 · 1 comment · Fixed by #156

Comments

@szeiger
Copy link
Collaborator

szeiger commented Jun 17, 2021

This should fail but instead the second binding wins:

{ [t[0]]: t[1] for t in [['foo',1],['foo',2]] }
@szeiger
Copy link
Collaborator Author

szeiger commented Jul 2, 2021

Related fix #100 by @edsilfer for #99. This only covered the special case where everything is statically known. We also need to double-check if that fix is actually correct (i.e. if this kind of error is supposed to be caught statically according to the spec)

lihaoyi-databricks pushed a commit that referenced this issue May 30, 2023
Fixes #121 

Please advise on checking for size twice vs calling `contains` once per
key, I haven't benchmarked this.

This might also break some existing files which rely on this behavior
without realizing it's out of spec, either with duplicate list entries
getting reduced or more complex replacements where only the last entry
matters. Not sure if we're ok with that or what other options we have.
Breaking these probably beats allowing duplicate entries in the future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant