Explorar o código

[gencommon] fix double return in reflection helper exprs (also make mk_return type the TReturn as t_dynamic, like we do in other places)

Dan Korostelev %!s(int64=8) %!d(string=hai) anos
pai
achega
f6eaeea76a
Modificáronse 2 ficheiros con 4 adicións e 4 borrados
  1. 1 1
      src/generators/gencommon.ml
  2. 3 3
      src/generators/gencommon/reflectionCFs.ml

+ 1 - 1
src/generators/gencommon.ml

@@ -1007,7 +1007,7 @@ let get_real_fun gen t =
 	| TFun(args,t) -> TFun(List.map (fun (n,o,t) -> n,o,gen.greal_type t) args, gen.greal_type t)
 	| _ -> t
 
-let mk_return e = { eexpr = TReturn (Some e); etype = e.etype; epos = e.epos }
+let mk_return e = { eexpr = TReturn (Some e); etype = t_dynamic; epos = e.epos }
 
 let v_nativearray = alloc_var "__array__" t_dynamic
 let mk_nativearray_decl gen t el pos =

+ 3 - 3
src/generators/gencommon/reflectionCFs.ml

@@ -1087,15 +1087,15 @@ let implement_get_set ctx cl =
 				(do_default, tf_args @ [ handle_prop,None; ])
 			end in
 
-				let get_field cf cf_type ethis cl name =
+			let get_field cf cf_type ethis cl name =
 				match cf.cf_kind with
 					| Var { v_read = AccCall } when Type.is_extern_field cf ->
-						mk_return (mk_this_call_raw ("get_" ^ cf.cf_name) (TFun(["value",false,cf.cf_type], cf.cf_type)) [	])
+						mk_this_call_raw ("get_" ^ cf.cf_name) (TFun(["value",false,cf.cf_type], cf.cf_type)) []
 					| Var { v_read = AccCall } ->
 						{
 							eexpr = TIf(
 								handle_prop_local,
-								mk_return (mk_this_call_raw ("get_" ^ cf.cf_name) (TFun(["value",false,cf.cf_type], cf.cf_type)) [	]),
+								mk_this_call_raw ("get_" ^ cf.cf_name) (TFun(["value",false,cf.cf_type], cf.cf_type)) [],
 								Some { eexpr = TField (ethis, FInstance(cl, List.map snd cl.cl_params, cf)); etype = cf_type; epos = pos }
 							);
 							etype = cf_type;