@@ -60,7 +60,6 @@ type unification_context = {
6060 variance_stack : (t * t ) rec_stack ;
6161 abstract_cast_stack : (t * t ) rec_stack ;
6262 unify_new_monos : t rec_stack ;
63- apply_params_stack : (t * t list ) list ref ;
6463}
6564
6665type unify_min_result =
@@ -95,7 +94,6 @@ let default_unification_context () = {
9594 variance_stack = new_rec_stack() ;
9695 abstract_cast_stack = new_rec_stack() ;
9796 unify_new_monos = new_rec_stack() ;
98- apply_params_stack = ref [] ;
9997}
10098
10199(* Unify like targets (e.g. Java) probably would. *)
@@ -114,7 +112,6 @@ let native_unification_context = {
114112 variance_stack = new_rec_stack() ;
115113 abstract_cast_stack = new_rec_stack() ;
116114 unify_new_monos = new_rec_stack() ;
117- apply_params_stack = ref [] ;
118115}
119116
120117module Monomorph = struct
@@ -627,11 +624,11 @@ let rec type_eq uctx a b =
627624 type_eq_params uctx a b tl1 tl2
628625 | TType (t ,tl ) , _ when can_follow a ->
629626 rec_stack uctx.eq_stack (a,b) (fast_eq_pair (a,b))
630- (fun() -> try_apply_params_rec uctx.apply_params_stack t.t_params tl t.t_type (fun a -> type_eq uctx a b))
627+ (fun() -> try_apply_params_rec t.t_params tl t.t_type (fun a -> type_eq uctx a b))
631628 (fun l -> error (cannot_unify a b :: l))
632629 | _ , TType (t ,tl ) when can_follow b ->
633630 rec_stack uctx.eq_stack (a,b) (fast_eq_pair (a,b))
634- (fun() -> try_apply_params_rec uctx.apply_params_stack t.t_params tl t.t_type (type_eq uctx a))
631+ (fun() -> try_apply_params_rec t.t_params tl t.t_type (type_eq uctx a))
635632 (fun l -> error (cannot_unify a b :: l))
636633 | TEnum (e1 ,tl1 ) , TEnum (e2 ,tl2 ) ->
637634 if e1 != e2 && not (param = EqCoreType && e1.e_path = e2.e_path) then error [cannot_unify a b];
@@ -767,12 +764,12 @@ let rec unify (uctx : unification_context) a b =
767764 | TType (t ,tl ) , _ ->
768765 rec_stack uctx.unify_stack (a,b)
769766 (fun(a2,b2) -> fast_eq_unbound_mono a a2 && fast_eq b b2)
770- (fun() -> try_apply_params_rec uctx.apply_params_stack t.t_params tl t.t_type (fun a -> unify uctx a b))
767+ (fun() -> try_apply_params_rec t.t_params tl t.t_type (fun a -> unify uctx a b))
771768 (fun l -> error (cannot_unify a b :: l))
772769 | _ , TType (t ,tl ) ->
773770 rec_stack uctx.unify_stack (a,b)
774771 (fun(a2,b2) -> fast_eq a a2 && fast_eq_unbound_mono b b2)
775- (fun() -> try_apply_params_rec uctx.apply_params_stack t.t_params tl t.t_type (unify uctx a))
772+ (fun() -> try_apply_params_rec t.t_params tl t.t_type (unify uctx a))
776773 (fun l -> error (cannot_unify a b :: l))
777774 | TEnum (ea ,tl1 ) , TEnum (eb ,tl2 ) ->
778775 if ea != eb then error [cannot_unify a b];
0 commit comments