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
Original bug ID: 4989 Reporter: hattori Status: closed (set by @mshinwell on 2016-12-06T21:36:06Z) Resolution: suspended Priority: normal Severity: feature Version: 3.11.1 Category: ~DO NOT USE (was: OCaml general) Related to:#6738
Bug description
Compiler rejects thw following definition:
let rec f = let g = fun x -> f x in g;;
Error: This kind of expression is not allowed as right-hand side of `let rec'
However, the following definition is OK:
let rec f = let g = f in fun x -> g x;;
val f : 'a -> 'b =
It seems that the first definition is also OK according to the reference manual (section 7.3).
The text was updated successfully, but these errors were encountered:
The checking of recursive value definitions is syntactic in nature and rather subtle. In your case, the criteria used do not distinguish between your example and "let rec f = let g = f in g", which would be semantically ill-defined indeed (just like "let rec f = f").
I'll keep this PR as a feature wish, but I'm afraid it's not going to be addressed any time soon.
Original bug ID: 4989
Reporter: hattori
Status: closed (set by @mshinwell on 2016-12-06T21:36:06Z)
Resolution: suspended
Priority: normal
Severity: feature
Version: 3.11.1
Category: ~DO NOT USE (was: OCaml general)
Related to: #6738
Bug description
Compiler rejects thw following definition:
let rec f = let g = fun x -> f x in g;;
Error: This kind of expression is not allowed as right-hand side of `let rec'
However, the following definition is OK:
let rec f = let g = f in fun x -> g x;;
val f : 'a -> 'b =
It seems that the first definition is also OK according to the reference manual (section 7.3).
The text was updated successfully, but these errors were encountered: