| Anonymous | Login | Signup for a new account | 2013-05-24 14:31 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 | |||
| 0004569 | OCaml | OCaml general | public | 2008-06-25 05:02 | 2008-06-25 05:06 | |||
| Reporter | garrigue | |||||||
| Assigned To | ||||||||
| Priority | normal | Severity | minor | Reproducibility | always | |||
| Status | closed | Resolution | fixed | |||||
| Platform | OS | OS Version | ||||||
| Product Version | 3.10.2 | |||||||
| Target Version | Fixed in Version | 3.10.3+dev | ||||||
| Summary | 0004569: Conjunctive polymorphic variants in class parameter constraints are rejected | |||||||
| Description | Reported by Khoo Yit Phang on the caml list 2008-06-24: I discovered that the attached snippet of Ocaml does not compile in ocamlc, but does work in the ocaml toplevel (tested in v3.10.0 and 3.10.2). Removing anything (except the :int annotation) causes the error to go away. Is it a bug in the type-checker? # cat polymorphic-variants-methods-bug.ml class ['a] c (a : 'a) = object (s) method s = s method d : int = match a with `A b -> b#num end # ocamlc polymorphic-variants-methods-bug.ml The implementation polymorphic-variants-methods-bug.ml does not match the interface (inferred signature): Type declarations do not match: type 'a c = < d : int; s : 'a c > constraint 'a = [< `A of < num : int; .. > & < num : int; .. > ] is not included in type 'a c = < d : int; s : 'a c > constraint 'a = [< `A of < num : int; .. > & < num : int; .. > & < num : int; .. > ] #ocamlc -i polymorphic-variants-methods-bug.ml class ['a] c : 'a -> object ('b) constraint 'a = [< `A of < num : int; .. > ] method d : int method s : 'b end | |||||||
| Tags | No tags attached. | |||||||
| Attached Files | ||||||||
Notes |
|
|
(0004524) garrigue (manager) 2008-06-25 05:06 |
This was due to the way unification is used during type expansion. Fxied in branch release310 by making the unification rigid when expanding a type during an equality check. |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2008-06-25 05:02 | garrigue | New Issue | |
| 2008-06-25 05:06 | garrigue | Status | new => closed |
| 2008-06-25 05:06 | garrigue | Note Added: 0004524 | |
| 2008-06-25 05:06 | garrigue | Resolution | open => fixed |
| 2008-06-25 05:06 | garrigue | Fixed in Version | => 3.10.3+dev |
| Copyright © 2000 - 2011 MantisBT Group |