|
@@ -65,10 +65,10 @@ let valid_redefinition map1 map2 f1 t1 f2 t2 = (* child, parent *)
|
|
|
begin match f1.cf_kind,f2.cf_kind with
|
|
|
| Method m1, Method m2 when not (m1 = MethDynamic) && not (m2 = MethDynamic) ->
|
|
|
begin match follow t1, follow t2 with
|
|
|
- | TFun (args1,r1) , TFun (args2,r2) -> (
|
|
|
+ | TFun (args1,r1) , TFun (args2,r2) ->
|
|
|
if not (List.length args1 = List.length args2) then raise (Unify_error [Unify_custom "Different number of function arguments"]);
|
|
|
let i = ref 0 in
|
|
|
- try
|
|
|
+ begin try
|
|
|
valid r1 r2;
|
|
|
List.iter2 (fun (n,o1,a1) (_,o2,a2) ->
|
|
|
incr i;
|
|
@@ -77,7 +77,8 @@ let valid_redefinition map1 map2 f1 t1 f2 t2 = (* child, parent *)
|
|
|
) args1 args2;
|
|
|
with Unify_error l ->
|
|
|
let msg = if !i = 0 then Invalid_return_type else Invalid_function_argument(!i,List.length args1) in
|
|
|
- raise (Unify_error (Cannot_unify (t1,t2) :: msg :: l)))
|
|
|
+ raise (Unify_error (Cannot_unify (t1,t2) :: msg :: l))
|
|
|
+ end
|
|
|
| _ ->
|
|
|
die "" __LOC__
|
|
|
end
|