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

sjsonnet accepts duplicate local variables whereas jsonnet doesn't #178

Closed
zapster opened this issue Jul 6, 2023 · 0 comments · Fixed by #234
Closed

sjsonnet accepts duplicate local variables whereas jsonnet doesn't #178

zapster opened this issue Jul 6, 2023 · 0 comments · Fixed by #234

Comments

@zapster
Copy link

zapster commented Jul 6, 2023

See the following jsonnet file:

$ cat duplicate_local.jsonnet
{
  local var = ['foo'],
  local var = var + ['bar'],
  var: var,
}

The jsonnet reference implementation complains:

$ jsonnet duplicate_local.jsonnet
duplicate_local.jsonnet:3:9-12 Duplicate local var: var

  local var = var + ['bar'],

However, sjsonnet happily accepts it:

$ sjsonnet duplicate_local.jsonnet
{
   "var": [
      "foo",
      "bar"
   ]
}

Independent of what makes more sense, I think sjsonnet should behave the same as jsonnet.

Jsonnet commandline interpreter v0.17.0
Sjsonnet 0.4.3

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