Explorar el Código

adapt `cast_or_unify` ref name

Simon Krajewski hace 11 años
padre
commit
b52b6951af
Se han modificado 4 ficheros con 4 adiciones y 4 borrados
  1. 1 1
      optimizer.ml
  2. 1 1
      typecore.ml
  3. 1 1
      typeload.ml
  4. 1 1
      typer.ml

+ 1 - 1
optimizer.ml

@@ -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
 			(* 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. *)
 			   first argument of abstract implementation functions. *)
 			(* actually we don't because unify_call_args takes care of that anyway *)
 			(* 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
 			| _ -> e) :: loop pl al false
 		| [], (v,opt) :: al ->
 		| [], (v,opt) :: al ->
 			(mk (TConst (match opt with None -> TNull | Some c -> c)) v.v_type p) :: loop [] al false
 			(mk (TConst (match opt with None -> TNull | Some c -> c)) v.v_type p) :: loop [] al false

+ 1 - 1
typecore.ml

@@ -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 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_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 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 *)
 (* Source: http://en.wikibooks.org/wiki/Algorithm_implementation/Strings/Levenshtein_distance#OCaml *)
 let levenshtein a b =
 let levenshtein a b =

+ 1 - 1
typeload.ml

@@ -234,7 +234,7 @@ let type_function_arg ctx t e opt p =
 let type_var_field ctx t e stat p =
 let type_var_field ctx t e stat p =
 	if stat then ctx.curfun <- FunStatic else ctx.curfun <- FunMember;
 	if stat then ctx.curfun <- FunStatic else ctx.curfun <- FunMember;
 	let e = type_expr ctx e (WithType t) in
 	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
 	match t with
 	| TType ({ t_path = ([],"UInt") },[]) | TAbstract ({ a_path = ([],"UInt") },[]) when stat -> { e with etype = t }
 	| TType ({ t_path = ([],"UInt") },[]) | TAbstract ({ a_path = ([],"UInt") },[]) when stat -> { e with etype = t }
 	| _ -> e
 	| _ -> e

+ 1 - 1
typer.ml

@@ -4801,5 +4801,5 @@ let rec create com =
 unify_min_ref := unify_min;
 unify_min_ref := unify_min;
 make_call_ref := make_call;
 make_call_ref := make_call;
 get_constructor_ref := get_constructor;
 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;
 type_module_type_ref := type_module_type;