|
@@ -103,7 +103,6 @@ let object_field f =
|
|
if String.length f >= pflen && String.sub f 0 pflen = pf then String.sub f pflen (String.length f - pflen), false else f, true
|
|
if String.length f >= pflen && String.sub f 0 pflen = pf then String.sub f pflen (String.length f - pflen), false else f, true
|
|
|
|
|
|
let type_field_rec = ref (fun _ _ _ _ _ -> assert false)
|
|
let type_field_rec = ref (fun _ _ _ _ _ -> assert false)
|
|
-let type_expr_with_type_raise_rec = ref (fun _ _ _ -> assert false)
|
|
|
|
|
|
|
|
(* ---------------------------------------------------------------------- *)
|
|
(* ---------------------------------------------------------------------- *)
|
|
(* PASS 3 : type expression & check structure *)
|
|
(* PASS 3 : type expression & check structure *)
|
|
@@ -256,7 +255,7 @@ let rec unify_call_params ctx cf el args r p inline =
|
|
| _ -> error acc "Invalid")
|
|
| _ -> error acc "Invalid")
|
|
| ee :: l, (name,opt,t) :: l2 ->
|
|
| ee :: l, (name,opt,t) :: l2 ->
|
|
try
|
|
try
|
|
- let e = (!type_expr_with_type_raise_rec) ctx ee (Some t) in
|
|
|
|
|
|
+ let e = type_expr_with_type ctx ee (Some t) true in
|
|
unify_raise ctx e.etype t e.epos;
|
|
unify_raise ctx e.etype t e.epos;
|
|
loop ((e,false) :: acc) l l2 skip
|
|
loop ((e,false) :: acc) l l2 skip
|
|
with
|
|
with
|
|
@@ -2905,4 +2904,4 @@ let rec create com =
|
|
|
|
|
|
;;
|
|
;;
|
|
type_field_rec := type_field;
|
|
type_field_rec := type_field;
|
|
-type_expr_with_type_raise_rec := type_expr_with_type_raise;
|
|
|
|
|
|
+type_expr_with_type_ref := (fun ctx e t do_raise -> if do_raise then type_expr_with_type_raise ctx e t else type_expr_with_type ctx e t);
|