浏览代码

[dce] do not modify properties on interfaces because they typically do not have accessor methods

Simon Krajewski 11 年之前
父节点
当前提交
6232ddbc00
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      dce.ml

+ 1 - 1
dce.ml

@@ -535,7 +535,7 @@ let run com main full =
 
 
 	(* extra step to adjust properties that had accessors removed (required for Php and Cpp) *)
 	(* extra step to adjust properties that had accessors removed (required for Php and Cpp) *)
 	List.iter (fun mt -> match mt with
 	List.iter (fun mt -> match mt with
-		| (TClassDecl c) ->
+		| (TClassDecl c) when not c.cl_interface ->
 			let rec has_accessor c n stat =
 			let rec has_accessor c n stat =
 				PMap.mem n (if stat then c.cl_statics else c.cl_fields)
 				PMap.mem n (if stat then c.cl_statics else c.cl_fields)
 				|| match c.cl_super with Some (csup,_) -> has_accessor csup n stat | None -> false
 				|| match c.cl_super with Some (csup,_) -> has_accessor csup n stat | None -> false