Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix field visibility of object comprehension fields to inherit
This should make C++ Jsonnet match the existing behaviour of Go-Jsonnet. Object comprehensions do not support differing field visibility, that is an object comprehension with a "hidden" or "forced-visible" field such as `{[k]::1 for k in ["x"]}` is rejected with a syntax error. However, intuitively the `{[key_expr]: value_expr for x in ...}` syntax seems like it should behave similarly to a normal (non-comprehension) object that uses default field visibility. Default field visibility is to 'inherit' visibility when merging objects with the + operator, and this is the existing behaviour of Go-Jsonnet. Example case: ./jsonnet -e '{"one":: "base"} + {[k]: "derived" for k in ["one"]}' Before this commit, Go-Jsonnet output: { } Before this commit, C++ Jsonnet output: { "one": "derived" } Bug report: #1111
- Loading branch information