|
@@ -1245,7 +1245,14 @@ and unify_types a b tl1 tl2 =
|
|
type_eq EqRightDynamic t1 t2
|
|
type_eq EqRightDynamic t1 t2
|
|
with Unify_error l ->
|
|
with Unify_error l ->
|
|
let err = cannot_unify a b in
|
|
let err = cannot_unify a b in
|
|
- error (try unify t1 t2; (err :: (Invariant_parameter (t1,t2)) :: l) with _ -> err :: l)
|
|
|
|
|
|
+ (try (match follow t1, follow t2 with
|
|
|
|
+ | TAbstract({a_impl = Some _} as a1,pl1),TAbstract({a_impl = Some _ } as a2,pl2) ->
|
|
|
|
+ type_eq EqStrict (apply_params a1.a_types pl1 a1.a_this) (apply_params a2.a_types pl2 a2.a_this)
|
|
|
|
+ | TAbstract({a_impl = Some _} as a,pl),t -> type_eq EqStrict (apply_params a.a_types pl a.a_this) t
|
|
|
|
+ | t,TAbstract({a_impl = Some _ } as a,pl) -> type_eq EqStrict t (apply_params a.a_types pl a.a_this)
|
|
|
|
+ | _ -> raise (Unify_error l))
|
|
|
|
+ with Unify_error _ ->
|
|
|
|
+ error (err :: (Invariant_parameter (t1,t2)) :: l))
|
|
) tl1 tl2
|
|
) tl1 tl2
|
|
|
|
|
|
and unify_with_access t1 f2 =
|
|
and unify_with_access t1 f2 =
|