You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The recursive call to f() below, from inside g(), is not recognized as either happening in tail position or as causing an error, hence producing code consuming an non-constant amount of stack space:
In all cases, the code can be made tail-recursive by inlining. However, I imagine this cannot be supported easily. In that case, the code should simply be rejected by the analysis done for tailrec.
The text was updated successfully, but these errors were encountered:
The recursive call to f() below, from inside g(), is not recognized as either happening in tail position or as causing an error, hence producing code consuming an non-constant amount of stack space:
If you wonder why would one care, the original example is in unificationHelper here — I noticed because of a StackOverflowException:
https://github.com/inc-lc/ilc-scala/blob/597a1e6b53dedf9d626061d7b7a9e9da66df499f/src/main/scala/ilc/feature/inference/Inference.scala#L126
In all cases, the code can be made tail-recursive by inlining. However, I imagine this cannot be supported easily. In that case, the code should simply be rejected by the analysis done for tailrec.
The text was updated successfully, but these errors were encountered: