Skip to content

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

Closed

Description

@vicuna

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'

Activity

  1. vicuna commented on Apr 9, 2018

    @vicuna
    Author

    Comment author: @yallop

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

    #1712

  2. vicuna commented on Apr 11, 2018

    @vicuna
    Author

    Comment author: @yallop

    Fixed in trunk

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions