瀏覽代碼

fixed missing mark_used_enum

Nicolas Cannasse 13 年之前
父節點
當前提交
8d8612c045
共有 1 個文件被更改,包括 6 次插入1 次删除
  1. 6 1
      typer.ml

+ 6 - 1
typer.ml

@@ -472,7 +472,12 @@ let field_access ctx mode f t e p =
 	let fnormal() = AKField ((mk (TField (e,f.cf_name)) t p),f) in
 	let normal() =
 		match follow e.etype with
-		| TAnon a -> (match !(a.a_status) with EnumStatics e -> AKField ((mk (TEnumField (e,f.cf_name)) t p),f) | _ -> fnormal())
+		| TAnon a -> 
+			(match !(a.a_status) with
+			| EnumStatics e -> 
+				mark_used_enum ctx e;
+				AKField ((mk (TEnumField (e,f.cf_name)) t p),f)
+			| _ -> fnormal())
 		| _ -> fnormal()
 	in
 	match f.cf_kind with