Add uncurry of recursive functions
This MR introduces the old uncurrification (written by @tomjack?) for ast_typed
, adapted to ast_aggregated
and applied only on E_recursive
.
It allows the following:
let rec foo (n : int) (x : string) : string = if n = 0 then x else foo (n - 1) (String.concat x "toto")
(the actual check of depth doesn't seem to be really needed, as later recursion only allows tail-position only? But anyway, I think it's better to keep the checks)
-
has a changelog entry
Edited by E. Rivas
Merge request reports
Activity
assigned to @er433
added Review label
mentioned in commit acbf5bd5
@er433 . I think we should keep the check. We plan to remove the restriction on tail recursion at some point so we will remove the check for tail recursion. If your check will be needed then, then absolutely don't remove it
mentioned in issue #1248 (moved)
unassigned @er433
Please register or sign in to reply