浏览代码

re-unify unbound context type parameters after parsing the pattern (fixed issue #1800)

Simon Krajewski 12 年之前
父节点
当前提交
2fa999bba9
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      matcher.ml

+ 1 - 0
matcher.ml

@@ -1170,6 +1170,7 @@ let match_expr ctx e cases def with_type p =
 								(fun () -> v.v_type <- t) :: acc
 							) ctx.locals []
 					in
+					List.iter2 (fun m (_,t) -> match follow m with TMono _ -> Type.unify m t | _ -> ()) monos ctx.type_params;
 					pl,restore,(match with_type with
 						| WithType t -> WithType (apply_params ctx.type_params monos t)
 						| WithTypeResume t -> WithTypeResume (apply_params ctx.type_params monos t)