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
module type OneSig=sigtypetvaloneValue: t -> stringendmodule type TwoSig=sigtypetvaltwoValue: t -> intendlethasBothOneAndTwo (implicit OneImpl: OneSig) (implicit TwoImpl: TwoSig with type t = OneImpl.t) (o: OneImpl.t) =let twoValue = string_of_int (TwoImpl.twoValue o) inlet oneValue =OneImpl.oneValue o in
oneValue ^ twoValue
implicit moduleHasBothForAbstractFloat: sigtypetvalcreate: unit -> tvaloneValue: t -> stringvaltwoValue: t -> intend=structtypet = floatletcreate()=4.4let oneValue = string_of_float
let twoValue = int_of_float
endlet abstractFloat =HasBothForAbstractFloat.create ()let _ = hasBothOneAndTwo abstractFloat
gives the error:
Error: Signature mismatch:
...
Type declarations do not match:
type t
is not included in
type t = HasBothForAbstractFloat.t
File "[5]", line 7, characters 7-8: Expected declaration
File "[5]", line 17, characters 7-8: Actual declaration
Characters 681-697:
let _ = hasBothOneAndTwo abstractFloat
^^^^^^^^^^^^^^^^
It seems that, for some reason, the final inclusion check ends up checking the strengthened version of the module type (the one including "type t = HasBothForAbstractFloat.t") against
the unstrengthed version (the one with just "type t").
The text was updated successfully, but these errors were encountered:
A bug report from @jordwalke:
gives the error:
It seems that, for some reason, the final inclusion check ends up checking the strengthened version of the module type (the one including "type t = HasBothForAbstractFloat.t") against
the unstrengthed version (the one with just "type t").
The text was updated successfully, but these errors were encountered: