Browse Source

avoid assertion failure when switching over EnumValue (fixed issue #1636)

Simon Krajewski 12 năm trước cách đây
mục cha
commit
b2a41c24fd
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      matcher.ml

+ 1 - 1
matcher.ml

@@ -181,7 +181,7 @@ let mk_subs st con =
 	match con.c_def with
 	| CFields (_,fl) -> List.map (fun (s,cf) -> mk_st (SField(st,s)) (map cf.cf_type) st.st_pos) fl
 	| CEnum (en,({ef_type = TFun _} as ef)) ->
-		let pl = match follow con.c_type with TEnum(_,pl) | TAbstract({a_this = TEnum(_)},pl)-> pl | _ -> assert false in
+		let pl = match follow con.c_type with TEnum(_,pl) | TAbstract({a_this = TEnum(_)},pl)-> pl | TAbstract({a_path = [],"EnumValue"},[]) -> [] | _ -> assert false in
 		begin match apply_params en.e_types pl (monomorphs ef.ef_params ef.ef_type) with
 			| TFun(args,r) ->
 				ExtList.List.mapi (fun i (_,_,t) ->