소스 검색

minor type constraint relax.

Nicolas Cannasse 19 년 전
부모
커밋
41d55e7cbb
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      typer.ml

+ 2 - 2
typer.ml

@@ -974,7 +974,7 @@ and type_switch ctx e cases def need_val p =
 			unify ctx e.etype e1.etype e1.epos;
 			CExpr e1
 		) in
-		let e2 = type_expr ctx e2 in
+		let e2 = type_expr ctx ~need_val e2 in
 		locals();
 		if need_val then unify ctx e2.etype t e2.epos;
 		(e1,e2)
@@ -993,7 +993,7 @@ and type_switch ctx e cases def need_val p =
 			);
 			None
 		| Some e ->
-			let e = type_expr ctx e in
+			let e = type_expr ctx ~need_val e in
 			if need_val then unify ctx e.etype t e.epos;
 			Some e
 	) in