You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 4336 Reporter: dnoblet Assigned to:@xavierleroy Status: closed (set by @xavierleroy on 2007-10-26T15:44:42Z) Resolution: fixed Priority: normal Severity: major Version: 3.10.0 Category: ~DO NOT USE (was: OCaml general) Related to:#4450#4709 Monitored by: lavi "Julien Signoles" n8gray @oandrieu@yakobowski berke @alainfrisch@mmottl
Bug description
The following program compiles and runs using OCaml 3.10.0:
module type ASig = sig type a val a:a val print:a -> unit end
module type BSig = sig type b val b:b val print:b -> unit end
module A = struct type a = int let a = 0 let print = print_int end
module B = struct type b = float let b = 0.0 let print = print_float end
module MakeA (Empty:sig end) : ASig = A
module MakeB (Empty:sig end) : BSig = B
module
rec NewA : ASig = MakeA (struct end)
and NewB : BSig with type b = NewA.a = MakeB (struct end)
let _ =
NewA.print NewB.b;
NewB.print NewA.a
The problem is, of course, that type A.a = int and type B.b = float; so, it seems like the compiler should complain when I try to construct module NewB with the (incorrect) type contraint "BSig with type b = NewA.a".
-David
The text was updated successfully, but these errors were encountered:
The check 'signature of implementation matches declared signature' was performed in the wrong typing environment. This is now fixed in the 3.10 CVS branch.
Original bug ID: 4336
Reporter: dnoblet
Assigned to: @xavierleroy
Status: closed (set by @xavierleroy on 2007-10-26T15:44:42Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 3.10.0
Category: ~DO NOT USE (was: OCaml general)
Related to: #4450 #4709
Monitored by: lavi "Julien Signoles" n8gray @oandrieu @yakobowski berke @alainfrisch @mmottl
Bug description
The following program compiles and runs using OCaml 3.10.0:
module type ASig = sig type a val a:a val print:a -> unit end
module type BSig = sig type b val b:b val print:b -> unit end
module A = struct type a = int let a = 0 let print = print_int end
module B = struct type b = float let b = 0.0 let print = print_float end
module MakeA (Empty:sig end) : ASig = A
module MakeB (Empty:sig end) : BSig = B
module
rec NewA : ASig = MakeA (struct end)
and NewB : BSig with type b = NewA.a = MakeB (struct end)
let _ =
NewA.print NewB.b;
NewB.print NewA.a
The problem is, of course, that type A.a = int and type B.b = float; so, it seems like the compiler should complain when I try to construct module NewB with the (incorrect) type contraint "BSig with type b = NewA.a".
-David
The text was updated successfully, but these errors were encountered: