Hegel: Inference doesn't work with recursive functions

Created on 21 May 2020  路  2Comments  路  Source: JSMonk/hegel

function factorial(a) {
  if (a === 1) {
    return 1;
  }

  return a * factorial(a - 1);
}
bug

Most helpful comment

Just an addition:

function bar(a) {
  return a ? a : bar(a)
}

function foo(a) {
  return a ? a : bar("")
}

Gives AnalyzationError: Maximum call stack size exceeded..

P.S. Great thank you for lifting this project! Great job!

All 2 comments

Just an addition:

function bar(a) {
  return a ? a : bar(a)
}

function foo(a) {
  return a ? a : bar("")
}

Gives AnalyzationError: Maximum call stack size exceeded..

P.S. Great thank you for lifting this project! Great job!

Thank you a lot, guys ^_^.
We will try to fix it soon.

Was this page helpful?
0 / 5 - 0 ratings