2
0
Эх сурвалжийг харах

keep inline fields that come from interfaces when DCE is active

Simon Krajewski 13 жил өмнө
parent
commit
84f00d3076
1 өөрчлөгдсөн 2 нэмэгдсэн , 0 устгасан
  1. 2 0
      typeload.ml

+ 2 - 0
typeload.ml

@@ -446,6 +446,8 @@ let rec check_interface ctx c p intf params =
 		try
 			let t2, f2 = class_field_no_interf c i in
 			ignore(follow f2.cf_type); (* force evaluation *)
+			if ctx.com.dead_code_elimination && not (List.exists  (fun (n,_,_) -> n = ":?used") f2.cf_meta) then
+				f2.cf_meta <- (":?used",[],p) :: f2.cf_meta;
 			let p = (match f2.cf_expr with None -> p | Some e -> e.epos) in
 			let mkind = function
 				| MethNormal | MethInline -> 0