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

Do not allow duplicate field in object when evaluating list list comprehension #100

Merged
merged 1 commit into from
Nov 9, 2020

Conversation

edsilfer
Copy link
Contributor

@edsilfer edsilfer commented Nov 9, 2020

What changes are proposed in this pull request?

This PR fixes issue 99 by issuing an error in case an Expr.Str is matching with an Expr.ForSpec with a value greater than 1. This condition denotes that the Expr.Str field value would be overridden in each interaction of the Expr.ForSpec

How is this tested?

  • Two new unit test with a positive and negative scenario emulating the issue
  • Run ./mill "sjsonnet[2.13.3].jvm.test.testLocal" to make sure that all the tests are still passing

@edsilfer edsilfer self-assigned this Nov 9, 2020
@edsilfer edsilfer force-pushed the edgar/fix-duplicate-field-on-list-comprehension branch from 230693f to 5259355 Compare November 9, 2020 12:01
Copy link
Contributor

@lihaoyi-databricks lihaoyi-databricks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small nit, but otherwise looks good

@edsilfer edsilfer force-pushed the edgar/fix-duplicate-field-on-list-comprehension branch from 5259355 to a893c6f Compare November 9, 2020 12:59
@edsilfer edsilfer merged commit 1143556 into master Nov 9, 2020
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 this pull request may close these issues.

Duplicated fields are allowed when building object via list comprehension
3 participants