浏览代码

[matcher] generate NoValue switches as Void

closes #7206
Simon Krajewski 7 年之前
父节点
当前提交
27f4df9cdb
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/typing/matcher.ml

+ 1 - 1
src/typing/matcher.ml

@@ -1473,7 +1473,7 @@ module Match = struct
 		) cases in
 		let infer_switch_type () =
 			match with_type with
-				| NoValue -> mk_mono()
+				| NoValue -> ctx.t.tvoid
 				| Value ->
 					let el = List.map (fun (case,_,_) -> match case.Case.case_expr with Some e -> e | None -> mk (TBlock []) ctx.t.tvoid p) cases in
 					unify_min ctx el