فهرست منبع

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 ()
 	| TInst({cl_path = [],"Array"},_) as t ->
 		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
 	in