浏览代码

declare fakeEnum matches as exhaustive

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

+ 2 - 0
matcher.ml

@@ -928,6 +928,8 @@ let convert_switch ctx st cases loop =
 		mk_index_call ()
 		mk_index_call ()
 	| TInst({cl_path = [],"Array"},_) as t ->
 	| TInst({cl_path = [],"Array"},_) as t ->
 		mk (TField (e_st,quick_field t "length")) ctx.t.tint p
 		mk (TField (e_st,quick_field t "length")) ctx.t.tint p
+	| TAbstract(a,_) when Meta.has Meta.FakeEnum a.a_meta ->
+		mk (TMeta((Meta.Exhaustive,[],p), e_st)) e_st.etype e_st.epos
 	| _ ->
 	| _ ->
 		e_st
 		e_st
 	in
 	in