Browse Source

[matcher] generate NoValue switches as Void

closes #7206
Simon Krajewski 7 years ago
parent
commit
27f4df9cdb
1 changed files with 1 additions and 1 deletions
  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