moleike / haskell-jsonnet

🎏 Haskell implementation of Jsonnet
https://hackage.haskell.org/package/jsonnet
Other
21 stars 6 forks source link

Evaluating `expr in super` fails when there is no super class #18

Open moleike opened 3 years ago

moleike commented 3 years ago

This is expected given we are treating super as a variable, while Jsonnet core AST super is just another literal.

C++ impl. returns the following:

{ foo: "bar", bar: super.foo }

RUNTIME ERROR: attempt to use super when there is no super class.

While:

{ foo: "bar", bar: "foo" in super }

outputs:

{
  "bar": false,
  "foo": "bar"
}

The following test fails due to this:

std.assertEqual({ f+: 3 }, { f: 3 })