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
The code for the object case was completely broken.
Actually, the correct condition is even a bit more complex, but this was overlooked.
The variant case was checked more carefully.
Original bug ID: 7284
Reporter: @lpw25
Assigned to: @garrigue
Status: closed (set by @xavierleroy on 2017-09-24T15:33:05Z)
Resolution: fixed
Priority: normal
Severity: major
Version: 4.03.0
Fixed in version: 4.04.0 +dev / +beta1 / +beta2
Category: typing
Monitored by: @alainfrisch
Bug description
I think that this condition in
mcomp_fields
:if miss1 <> [] && (object_row ty1).desc = Tnil
|| miss2 <> [] && (object_row ty2).desc = Tnil then raise (Unify []);
is supposed to be:
if miss1 <> [] && (object_row ty2).desc = Tnil
|| miss2 <> [] && (object_row ty1).desc = Tnil then raise (Unify []);
As it stands the check treats some compatible types as incompatible. For example, the following code gives a segmentation fault:
module type S = sig
end
module M = struct
end
module F(X : S) = struct
end
module N = F(M)
let () = N.f (N.V2 0)
The text was updated successfully, but these errors were encountered: