Explorar o código

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

Nicolas Cannasse %!s(int64=13) %!d(string=hai) anos
pai
achega
3199a42e23
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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