浏览代码

fixed field access infos for enum fields

Nicolas Cannasse 12 年之前
父节点
当前提交
e914effd7e
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      typer.ml

+ 1 - 0
typer.ml

@@ -929,6 +929,7 @@ and type_field ctx e i p mode =
 			end;
 			end;
 			let fmode, ft = (match !(a.a_status) with
 			let fmode, ft = (match !(a.a_status) with
 				| Statics c -> FStatic (c,f), field_type ctx c [] f p
 				| Statics c -> FStatic (c,f), field_type ctx c [] f p
+				| EnumStatics e -> FEnum (e,try PMap.find f.cf_name e.e_constrs with Not_found -> assert false), Type.field_type f
 				| _ -> FAnon f, Type.field_type f
 				| _ -> FAnon f, Type.field_type f
 			) in
 			) in
 			field_access ctx mode f fmode ft e p
 			field_access ctx mode f fmode ft e p