Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

let-rec wellformedness check is more restrictive than expected #7767

Closed
vicuna opened this issue Apr 9, 2018 · 2 comments
Closed

let-rec wellformedness check is more restrictive than expected #7767

vicuna opened this issue Apr 9, 2018 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Apr 9, 2018

Original bug ID: 7767
Reporter: @ivg
Assigned to: @yallop
Status: resolved (set by @yallop on 2018-04-11T07:50:00Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.06.0
Fixed in version: 4.07.0+dev/beta2/rc1/rc2
Category: typing

Bug description

I have an example of a definition that was accepted by previous versions of OCaml and is rejected after #556 1. A read carefully through all comments in that GPR and I didn't find anything that will mention that such definitions are no longer accepted. So this is why I'm marking this as "not expected". And I let you judge whether it is a regression or not and issuing this report to show an example of a real-world program, that is no longer accepted.

Here is an example (I'm sorry I don't like to reduces examples, so I minimized it while still keeping some amount of sense in it, the example is taken from the real code).

The minimized example:

type prog = Seq of prog list | Exp of string;;
let concat_map xs ~f = List.map f xs |> List.concat;;
let rec concat_prog = concat_map ~f:(function Seq xs -> concat_prog xs | x -> [x]);;
Error: This kind of expression is not allowed as right-hand side of `let rec'
@vicuna
Copy link
Author

vicuna commented Apr 9, 2018

Comment author: @yallop

Thanks for the report. There's a fix here:

#1712

@vicuna
Copy link
Author

vicuna commented Apr 11, 2018

Comment author: @yallop

Fixed in trunk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant