@@ -278,7 +278,7 @@ let rec type_inline ctx cf f ethis params tret config p ?(self_calling_closure=f
(* we have to check for abstract casts here because we can't do that later. However, we have to skip the check for the
first argument of abstract implementation functions. *)
(* actually we don't because unify_call_args takes care of that anyway *)
- (* | _ when not (first && Meta.has Meta.Impl cf.cf_meta && cf.cf_name <> "_new") -> (!check_abstract_cast_ref) ctx (map_type v.v_type) e e.epos *)
+ (* | _ when not (first && Meta.has Meta.Impl cf.cf_meta && cf.cf_name <> "_new") -> (!cast_or_unify_ref) ctx (map_type v.v_type) e e.epos *)
| _ -> e) :: loop pl al false
| [], (v,opt) :: al ->
(mk (TConst (match opt with None -> TNull | Some c -> c)) v.v_type p) :: loop [] al false
@@ -154,7 +154,7 @@ let unify_min_ref : (typer -> texpr list -> t) ref = ref (fun _ _ -> assert fals
let match_expr_ref : (typer -> Ast.expr -> (Ast.expr list * Ast.expr option * Ast.expr option) list -> Ast.expr option option -> with_type -> Ast.pos -> decision_tree) ref = ref (fun _ _ _ _ _ _ -> assert false)
let get_pattern_locals_ref : (typer -> Ast.expr -> Type.t -> (string, tvar * pos) PMap.t) ref = ref (fun _ _ _ -> assert false)
let get_constructor_ref : (typer -> tclass -> t list -> Ast.pos -> (t * tclass_field)) ref = ref (fun _ _ _ _ -> assert false)
-let check_abstract_cast_ref : (typer -> t -> texpr -> Ast.pos -> texpr) ref = ref (fun _ _ _ _ -> assert false)
+let cast_or_unify_ref : (typer -> t -> texpr -> Ast.pos -> texpr) ref = ref (fun _ _ _ _ -> assert false)
(* Source: http://en.wikibooks.org/wiki/Algorithm_implementation/Strings/Levenshtein_distance#OCaml *)
let levenshtein a b =
@@ -234,7 +234,7 @@ let type_function_arg ctx t e opt p =
let type_var_field ctx t e stat p =
if stat then ctx.curfun <- FunStatic else ctx.curfun <- FunMember;
let e = type_expr ctx e (WithType t) in
- let e = (!check_abstract_cast_ref) ctx t e p in
+ let e = (!cast_or_unify_ref) ctx t e p in
match t with
| TType ({ t_path = ([],"UInt") },[]) | TAbstract ({ a_path = ([],"UInt") },[]) when stat -> { e with etype = t }
| _ -> e
@@ -4801,5 +4801,5 @@ let rec create com =
unify_min_ref := unify_min;
make_call_ref := make_call;
get_constructor_ref := get_constructor;
-check_abstract_cast_ref := Codegen.AbstractCast.cast_or_unify_raise;
+cast_or_unify_ref := Codegen.AbstractCast.cast_or_unify_raise;
type_module_type_ref := type_module_type;