Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005703OCamlOCaml typingpublic2012-07-27 14:262013-08-19 14:54
Reportercgillot 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version 
Target Version4.02.0+devFixed in Version 
Summary0005703: Class members hidden by recursive modules
DescriptionI 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 InformationOcaml version : trunk, revision 12787
Tagsrecmod
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- 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
2013-08-19 14:54 doligez Target Version 4.01.0+dev => 4.02.0+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker