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: 7036 Reporter: mandrykin Assigned to:@garrigue Status: closed (set by @xavierleroy on 2017-02-16T14:14:37Z) Resolution: fixed Priority: low Severity: minor Platform: x86_64 OS: Linux 3.19.0 OS Version: Ubuntu 15.04 Version: 4.02.3 Fixed in version: 4.03.0+dev / +beta1 Category: typing Monitored by:@hcarty
Bug description
The following reduced example:
module M = struct
module type S = sig type a val v : a end
type 'a s = (module S with type a = 'a)
end
module B = struct
class type a = object method a : 'a. 'a M.s -> 'a end
end
module M' = M
module B' = B
class b : B.a = object
method a : 'a. 'a M.s -> 'a = fun (type a) ((module X) : (module M.S with type a = a)) -> X.v
end
class b' : B.a = object
method a : 'a. 'a M'.s -> 'a = fun (type a) ((module X) : (module M'.S with type a = a)) -> X.v
end
is not accepted in both 4.02.3 and 4.03.0+trunk (4.03.0+dev11-2015-10-19):
Error: The class type object method a : 'a M'.s -> 'a end
is not matched by the class type B.a
The class type object method a : 'a M'.s -> 'a end
is not matched by the class type object method a : 'a M.s -> 'a end
The method a has type 'a. 'a M'.s -> 'a but is expected to have type
'a. 'a M.s -> 'a
Type 'a M'.s = (module M'.S with type a = 'a)
is not compatible with type 'a0 M.s = (module M.S with type a = 'a0)
although as module M' is an alias for module M, module types M.S and M'.S actually refer to the same module type.
Structural equality on package types only work if the types do not contain free type variables (both Tvar and Tunivar). So we still need to expand the module path for aliases.
Original bug ID: 7036
Reporter: mandrykin
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2017-02-16T14:14:37Z)
Resolution: fixed
Priority: low
Severity: minor
Platform: x86_64
OS: Linux 3.19.0
OS Version: Ubuntu 15.04
Version: 4.02.3
Fixed in version: 4.03.0+dev / +beta1
Category: typing
Monitored by: @hcarty
Bug description
The following reduced example:
is not accepted in both 4.02.3 and 4.03.0+trunk (4.03.0+dev11-2015-10-19):
although as module M' is an alias for module M, module types M.S and M'.S actually refer to the same module type.
File attachments
The text was updated successfully, but these errors were encountered: