Explorar el Código

do not constraint check against monomorphs when unifying abstract to-fields (fixed issue 1830)

Simon Krajewski hace 12 años
padre
commit
8a34e585ca
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      type.ml

+ 1 - 1
type.ml

@@ -1224,7 +1224,7 @@ and unify_to_field ab tl b (t,cfo) =
 				(* immediate constraints checking is ok here because we know there are no monomorphs *)
 				List.iter2 (fun m (name,t) -> match follow t with
 					| TInst ({ cl_kind = KTypeParameter constr },_) when constr <> [] ->
-						List.iter (fun tc -> unify m (map tc) ) constr
+						List.iter (fun tc -> match follow m with TMono _ -> raise (Unify_error []) | _ -> unify m (map tc) ) constr
 					| _ -> ()
 				) monos cf.cf_params;
 				unify_func (map t) b;