瀏覽代碼

fixed WithType TMono with TIf

Nicolas Cannasse 12 年之前
父節點
當前提交
c14ce6c1e0
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      typer.ml

+ 1 - 0
typer.ml

@@ -2657,6 +2657,7 @@ and type_expr ctx (e,p) (with_type:with_type) =
 			let t = match with_type with
 				| NoValue -> ctx.t.tvoid
 				| Value -> unify_min ctx [e1; e2]
+				| WithType t | WithTypeResume t when (match follow t with TMono _ -> true | _ -> false) -> unify_min ctx [e1; e2]
 				| WithType t | WithTypeResume t ->
 					unify ctx e1.etype t e1.epos;
 					unify ctx e2.etype t e2.epos;