|
@@ -194,7 +194,7 @@ let rec type_inline ctx cf f ethis params tret config p force =
|
|
|
let in_local_fun = ref false in
|
|
|
let cancel_inlining = ref false in
|
|
|
let has_return_value = ref false in
|
|
|
- let ret_val = (match follow f.tf_type with TEnum ({ e_path = ([],"Void") },[]) | TAbstract ({ a_path = ([],"Void") },[]) -> false | _ -> true) in
|
|
|
+ let ret_val = (match follow f.tf_type with TAbstract ({ a_path = ([],"Void") },[]) -> false | _ -> true) in
|
|
|
let rec map term e =
|
|
|
let po = e.epos in
|
|
|
let e = { e with epos = p } in
|
|
@@ -382,7 +382,7 @@ let rec type_inline ctx cf f ethis params tret config p force =
|
|
|
(match follow e.etype with
|
|
|
| TMono _ ->
|
|
|
(match follow tret with
|
|
|
- | TEnum ({ e_path = [],"Void" },_) | TAbstract ({ a_path = [],"Void" },_) -> e
|
|
|
+ | TAbstract ({ a_path = [],"Void" },_) -> e
|
|
|
| _ -> raise (Unify_error []))
|
|
|
| _ -> try
|
|
|
type_eq EqStrict etype tret;
|
|
@@ -515,7 +515,7 @@ let rec optimize_for_loop ctx i e1 e2 p =
|
|
|
force locals to be of Int type (to prevent Int/UInt issues)
|
|
|
*)
|
|
|
let i2 = match i2.etype with
|
|
|
- | TInst({ cl_path = ([],"Int") }, []) | TAbstract ({ a_path = ([],"Int") }, []) -> i2
|
|
|
+ | TAbstract ({ a_path = ([],"Int") }, []) -> i2
|
|
|
| _ -> { i2 with eexpr = TCast(i2, None); etype = t_int }
|
|
|
in
|
|
|
(match max with
|
|
@@ -608,9 +608,6 @@ let rec need_parent e =
|
|
|
let rec add_final_return e t =
|
|
|
let def_return p =
|
|
|
let c = (match follow t with
|
|
|
- | TInst ({ cl_path = [],"Int" },_) -> TInt 0l
|
|
|
- | TInst ({ cl_path = [],"Float" },_) -> TFloat "0."
|
|
|
- | TEnum ({ e_path = [],"Bool" },_) -> TBool false
|
|
|
| TAbstract ({ a_path = [],"Int" },_) -> TInt 0l
|
|
|
| TAbstract ({ a_path = [],"Float" },_) -> TFloat "0."
|
|
|
| TAbstract ({ a_path = [],"Bool" },_) -> TBool false
|
|
@@ -706,7 +703,7 @@ let sanitize_expr com e =
|
|
|
{ e with eexpr = TFor (v,e1,e2) }
|
|
|
| TFunction f ->
|
|
|
let f = (match follow f.tf_type with
|
|
|
- | TEnum ({ e_path = [],"Void" },[]) | TAbstract ({ a_path = [],"Void" },[]) -> f
|
|
|
+ | TAbstract ({ a_path = [],"Void" },[]) -> f
|
|
|
| t ->
|
|
|
if com.config.pf_add_final_return then { f with tf_expr = add_final_return f.tf_expr t } else f
|
|
|
) in
|
|
@@ -781,13 +778,11 @@ let rec reduce_loop ctx e =
|
|
|
let is_float t =
|
|
|
match follow t with
|
|
|
| TAbstract({ a_path = [],"Float" },_) -> true
|
|
|
- | TInst ({ cl_path = ([],"Float") },_) -> true
|
|
|
| _ -> false
|
|
|
in
|
|
|
let is_numeric t =
|
|
|
match follow t with
|
|
|
| TAbstract({ a_path = [],("Float"|"Int") },_) -> true
|
|
|
- | TInst ({ cl_path = ([],("Float" | "Int")) },_) -> true
|
|
|
| _ -> false
|
|
|
in
|
|
|
let e = Type.map_expr (reduce_loop ctx) e in
|