Bläddra i källkod

filter AccRequire fields (fixed issue #1781)

Simon Krajewski 12 år sedan
förälder
incheckning
98df36b06c
1 ändrade filer med 5 tillägg och 1 borttagningar
  1. 5 1
      codegen.ml

+ 5 - 1
codegen.ml

@@ -657,7 +657,11 @@ let add_rtti ctx t =
 let remove_extern_fields ctx t = match t with
 	| TClassDecl c ->
 		let do_remove f =
-			(not ctx.in_macro && f.cf_kind = Method MethMacro) || Meta.has Meta.Extern f.cf_meta || Meta.has Meta.Generic f.cf_meta
+			Meta.has Meta.Extern f.cf_meta || Meta.has Meta.Generic f.cf_meta
+			|| (match f.cf_kind with
+				| Var {v_read = AccRequire (s,_)} -> not (Common.raw_defined ctx.com s)
+				| Method MethMacro -> not ctx.in_macro
+				| _ -> false)
 		in
 		if not (Common.defined ctx.com Define.DocGen) then begin
 			c.cl_ordered_fields <- List.filter (fun f ->