| Anonymous | Login | Signup for a new account | 2013-05-19 16:20 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 | ||||||
| 0005703 | OCaml | OCaml typing | public | 2012-07-27 14:26 | 2012-09-21 14:52 | ||||||
| Reporter | cgillot | ||||||||||
| Assigned To | |||||||||||
| Priority | normal | Severity | minor | Reproducibility | always | ||||||
| Status | acknowledged | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | |||||||||||
| Target Version | 4.01.0+dev | Fixed in Version | |||||||||
| Summary | 0005703: Class members hidden by recursive modules | ||||||||||
| Description | I have a class hierarchy, each class being wrapped in its own module. When using regular modules, everything compiles just fine ; but recursive modules trigger typing failure. $ cat test.ml module rec Ma : sig class a : int -> object method as_a : int method z : int end end = struct class a x = object(this) method as_a : int = x method z : int = 50 end end and Mb : sig class b : int -> object method as_b : int inherit Ma.a end end = struct class b = let z = 50 in fun x -> object(this) method as_b : int = x inherit Ma.a z as a end end and Mc : sig class c : int -> object method as_c : int inherit Mb.b end end = struct class c = let u = 42 in fun x -> object(this) method as_c : int = x inherit Mb.b u as b end end $ ocamlc test.ml File "test.ml", line 31, characters 6-129: Error: Signature mismatch: ... Class declarations do not match: class c : int -> object method as_a : int method as_b : int method as_c : int method z : int end does not match class c : int -> object method as_b : int method as_c : int end The public method as_a cannot be hidden The public method z cannot be hidden This error never appears with regular modules (even with explicit signatures) ; and this only happens when there are at least 3 classes. | ||||||||||
| Additional Information | Ocaml version : trunk, revision 12787 | ||||||||||
| Tags | recmod | ||||||||||
| Attached Files | |||||||||||
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2012-07-27 14:26 | cgillot | New Issue | |
| 2012-07-31 13:32 | doligez | Status | new => acknowledged |
| 2012-07-31 13:32 | doligez | Target Version | => 4.00.1+dev |
| 2012-07-31 13:32 | doligez | Tag Attached: recmod | |
| 2012-09-21 14:52 | doligez | Target Version | 4.00.1+dev => 4.01.0+dev |
| Copyright © 2000 - 2011 MantisBT Group |