Explorar el Código

revert of accidental change

Caue Waneck hace 12 años
padre
commit
1a81f24f0f
Se han modificado 1 ficheros con 6 adiciones y 1 borrados
  1. 6 1
      typeload.ml

+ 6 - 1
typeload.ml

@@ -161,7 +161,11 @@ let make_module ctx mpath file tdecls loadp =
 						{ f with cff_name = "_new"; cff_access = AStatic :: f.cff_access; cff_kind = FFun fu; cff_meta = (Meta.Impl,[],p) :: f.cff_meta }
 					| FFun fu when not stat ->
 						if Meta.has Meta.From f.cff_meta then error "@:from cast functions must be static" f.cff_pos;
-						let fu = { fu with f_args = ("this",false,Some this_t,None) :: fu.f_args } in
+						let first = if List.mem AMacro f.cff_access
+							then CTPath ({ tpackage = ["haxe";"macro"]; tname = "Expr"; tsub = Some ("ExprOf"); tparams = [TPType this_t] })
+							else this_t
+						in
+						let fu = { fu with f_args = ("this",false,Some first,None) :: fu.f_args } in
 						{ f with cff_kind = FFun fu; cff_access = AStatic :: f.cff_access; cff_meta = (Meta.Impl,[],p) :: f.cff_meta }
 					| _ ->
 						f
@@ -694,6 +698,7 @@ let rec get_overloads c i =
 	in
 	ret @ (List.filter (fun (t,f) -> not (List.exists (fun (t2,f2) -> same_overload_args t t2 f f2) ret)) rsup)
 
+
 let check_overloads ctx c =
 	(* check if field with same signature was declared more than once *)
 	List.iter (fun f ->