tweag / nickel

Better configuration for less
https://nickel-lang.org/
MIT License
2.23k stars 85 forks source link

`nickel doc` overflows the stack with recursive schemas #1967

Open yannham opened 2 weeks ago

yannham commented 2 weeks ago

Describe the bug nickel doc aborts with a stack overflow on a real-world 1MB Nickel schema, which doesn't look very deep (nickel doc does use recursive calls, but the stack space should be linear in the depth of the schema, roughly).

To Reproduce I unfortunately can't provide the test case, which has been provided as a courtesy but isn't public. This issue is mostly a reminder to investigate it.

yannham commented 1 week ago

We do have a MRE, and it seems it doesn't have anything to do with schema size, but everything to do with recursive contracts:

{
  Recursive = {
    foo | Number,
    bar | Recursive | optional
  }
}