Explorar el Código

[server] fix @:keep @:keep @:keep @:keep @:keep ...

Rudy Ges hace 1 año
padre
commit
99bd8ef8fd
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/typing/finalization.ml

+ 1 - 1
src/typing/finalization.ml

@@ -43,7 +43,7 @@ let get_main ctx types =
 			| _ -> raise_typing_error ("Invalid -main : " ^ s_type_path path ^ " has invalid main function") c.cl_pos
 		in
 		if not (ExtType.is_void (follow r)) then raise_typing_error (Printf.sprintf "Return type of main function should be Void (found %s)" (s_type (print_context()) r)) f.cf_name_pos;
-		f.cf_meta <- (Dce.mk_keep_meta f.cf_pos) :: f.cf_meta;
+		if not (Meta.has Meta.Keep f.cf_meta) then f.cf_meta <- (Dce.mk_keep_meta f.cf_pos) :: f.cf_meta;
 		let emain = type_module_type ctx (TClassDecl c) null_pos in
 		let main = mk (TCall (mk (TField (emain,fmode)) ft null_pos,[])) r null_pos in
 		let call_static path method_name =