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: 7699 Reporter: ubsan Status: resolved (set by @xavierleroy on 2018-01-12T13:01:08Z) Resolution: not fixable Priority: normal Severity: minor Version: 4.06.0 Category: typing
Bug description
Given two recursive modules T1 and T2, and an opaque type T1.t which is equal to b, references to T1.t in T2 are not normalized to have type b in T1.
Steps to reproduce
module rec Foo : sig
val make: Bar.t
end = struct
let make = Bar.make
end and Bar : sig
type t
val make: t
end = struct
type t = unit
let make = ()
let _: unit = Foo.make
end
gives the error:
File "./test.ml", line 11, characters 16-24:
Error: This expression has type Bar.t but an expression was expected of type
unit
Additional information
One can get around this issue by not using type aliases - I've gotten around this in my own code with a single-variant variant type.
The text was updated successfully, but these errors were encountered:
This is a well-known issue with recursive modules called the "double-vision" problem. There are some recursive module systems that avoid it -- see various works by Dreyer and Rossberg -- but changing OCaml's module system to match one of those would be a significant piece of work, so don't expect this to be fixed any time soon.
Original bug ID: 7699
Reporter: ubsan
Status: resolved (set by @xavierleroy on 2018-01-12T13:01:08Z)
Resolution: not fixable
Priority: normal
Severity: minor
Version: 4.06.0
Category: typing
Bug description
Given two recursive modules
T1
andT2
, and an opaque typeT1.t
which is equal tob
, references toT1.t
inT2
are not normalized to have typeb
inT1
.Steps to reproduce
gives the error:
File "./test.ml", line 11, characters 16-24:
Error: This expression has type Bar.t but an expression was expected of type
unit
Additional information
One can get around this issue by not using type aliases - I've gotten around this in my own code with a single-variant variant type.
The text was updated successfully, but these errors were encountered: