浏览代码

support abstract-wrapped enums

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

+ 1 - 1
codegen.ml

@@ -1631,7 +1631,7 @@ module PatternMatchConversion = struct
 			let p = st.st_pos in
 			let e_st = convert_st cctx st in
 			let e_subject,exh = match follow st.st_type with
-				| TEnum(_) ->
+				| TEnum(_) | TAbstract({a_this = TEnum(_)},_)->
 					let cf = PMap.find "enumIndex" cctx.ttype.cl_statics in
 					let ec = (!type_module_type_ref) cctx.ctx (TClassDecl cctx.ttype) None p in
 					let ef = mk (TField(ec, FStatic(cctx.ttype,cf))) (tfun [t_dynamic] cctx.ctx.t.tint) p in