浏览代码

bugfix : constructors with parameters were no longer checked for coverage in switch

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

+ 1 - 1
typer.ml

@@ -1564,7 +1564,7 @@ and type_switch_old ctx e cases def need_val with_type p =
 		| None ->
 			let tenum = TEnum(enum,enparams) in
 			let l = PMap.fold (fun c acc ->
-				let t = monomorphs enum.e_types (monomorphs c.ef_params c.ef_type) in
+				let t = monomorphs enum.e_types (monomorphs c.ef_params (match c.ef_type with TFun (_,t) -> t | t -> t)) in
 				if Hashtbl.mem used_cases c.ef_name || not (try unify_raise ctx t tenum c.ef_pos; true with Error (Unify _,_) -> false) then acc else c.ef_name :: acc
 			) enum.e_constrs [] in
 			match l with