jrsonnet icon indicating copy to clipboard operation
jrsonnet copied to clipboard

X in super returns value while it shouldn't

Open Duologic opened this issue 9 months ago • 1 comments

From https://github.com/google/go-jsonnet/blob/master/testdata/insuper5.jsonnet

{ x: 42 } { y: { "false": "x" in super } }
➜ cjsonnet ./go-jsonnet-test/vendor/testdata/insuper5.jsonnet
{
   "x": 42,
   "y": {
      "false": false
   }
}

➜ jsonnet ./go-jsonnet-test/vendor/testdata/insuper5.jsonnet
{
   "x": 42,
   "y": {
      "false": false
   }
}

➜ jrsonnet ./go-jsonnet-test/vendor/testdata/insuper5.jsonnet
{
   "x": 42,
   "y": {
      "false": true
   }
}

Duologic avatar May 17 '25 21:05 Duologic

Current version of jrsonnet incorrectly propagates super in case if it doesn't exists, i.e

{ a: 42 } { y: {} { "false": "a" in super } }

Returns the correct answer; super should be reset when making a new object, and not only when extending.

#193 completely refactors context propagation, and the bug is fixed here.

CertainLach avatar May 19 '25 07:05 CertainLach