Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007767OCamltypingpublic2018-04-09 23:162018-04-11 10:02
Assigned Toyallop 
PlatformOSOS Version
Product Version4.06.0 
Target VersionFixed in Version4.07.0+dev/beta2/rc1/rc2 
Summary0007767: let-rec wellformedness check is more restrictive than expected
DescriptionI have an example of a definition that was accepted by previous versions of OCaml and is rejected after GPR#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][2]).

The minimized example:
type prog = Seq of prog list | Exp of string;;
let concat_map xs ~f = 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'

[1]: [^]
[2]: [^]
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
yallop (developer)
2018-04-10 01:25

Thanks for the report. There's a fix here: [^]
yallop (developer)
2018-04-11 09:50

Fixed in trunk

- Issue History
Date Modified Username Field Change
2018-04-09 23:16 ivg New Issue
2018-04-10 01:25 yallop Note Added: 0018998
2018-04-11 09:50 yallop Note Added: 0019007
2018-04-11 09:50 yallop Status new => resolved
2018-04-11 09:50 yallop Resolution open => fixed
2018-04-11 09:50 yallop Assigned To => yallop
2018-04-11 10:02 gasche Fixed in Version => 4.07.0+dev/beta2/rc1/rc2

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker