| Anonymous | Login | Signup for a new account | 2013-05-26 05:22 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | |||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |||
| 0004623 | OCaml | OCaml general | public | 2008-10-15 17:28 | 2010-04-27 09:16 | |||
| Reporter | dario | |||||||
| Assigned To | garrigue | |||||||
| Priority | normal | Severity | minor | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | 3.11+dev | |||||||
| Target Version | Fixed in Version | 3.11+dev | ||||||
| Summary | 0004623: Private constraints accepted by toplevel but not by compiler | |||||||
| Description | Using the just released 3.11 Beta1, the following code is accepted by the top-level: module Foobar: sig type foo_t = [ `A ] type bar_t = [ `B ] type foobar_t = [ foo_t | bar_t ] type 'a t = private 'a constraint 'a = [< foobar_t ] val make_a: unit -> foo_t t val make_b: unit -> bar_t t end = struct type foo_t = [ `A ] type bar_t = [ `B ] type foobar_t = [ foo_t | bar_t ] type 'a t = 'a constraint 'a = [< foobar_t ] let make_a () = `A let make_b () = `B end But is rejected by both the byte and native code compilers: File "constraint.ml", line 1, characters 0-1: Error: The implementation constraint.ml does not match the interface (inferred signature): Modules do not match: sig type foo_t = [ `A ] type bar_t = [ `B ] type foobar_t = [ `A | `B ] type 'a t = 'a Foobar.t constraint 'a = [< foobar_t ] val make_a : unit -> foo_t t val make_b : unit -> bar_t t end is not included in sig type foo_t = [ `A ] type bar_t = [ `B ] type foobar_t = [ `A | `B ] type 'a t = private 'a constraint 'a = [< foobar_t ] val make_a : unit -> foo_t t val make_b : unit -> bar_t t end Type declarations do not match: type 'a t = 'a Foobar.t constraint 'a = [< foobar_t ] is not included in type 'a t = private 'a constraint 'a = [< foobar_t ] | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0004680) garrigue (manager) 2008-10-16 04:14 |
Actually the problem was not unrelated to constraints. A minimal reproduction case follows: module Foobar : sig type t = private int end = struct type t = int end This is now fixed in CVS/release311, by allowing head-expansion of private abbreviations when defining a private type. |
|
(0005385) garrigue (manager) 2010-04-27 09:16 |
safe to close |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2008-10-15 17:28 | dario | New Issue | |
| 2008-10-16 04:14 | garrigue | Status | new => resolved |
| 2008-10-16 04:14 | garrigue | Fixed in Version | => 3.11+dev |
| 2008-10-16 04:14 | garrigue | Resolution | open => fixed |
| 2008-10-16 04:14 | garrigue | Assigned To | => garrigue |
| 2008-10-16 04:14 | garrigue | Note Added: 0004680 | |
| 2010-04-27 09:16 | garrigue | Relationship added | related to 0004580 |
| 2010-04-27 09:16 | garrigue | Note Added: 0005385 | |
| 2010-04-27 09:16 | garrigue | Status | resolved => closed |
| Copyright © 2000 - 2011 MantisBT Group |