moleike / haskell-jsonnet

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

`self` not in scope from an object local binding #31

Closed moleike closed 3 years ago

moleike commented 3 years ago

The following does not work:

local Fib = {
  n: 1,
  local outer = self,
  r: if self.n <= 1 then 1 else (Fib { n: outer.n - 1 }).r + (Fib { n: outer.n - 2 }).r,
};

(Fib { n: 25 }).r

We get a VarNotFound exception

moleike commented 3 years ago

Fixed in 6fc7be1dabd9b43070a08a05f2424e23c4506eeb