Explorar o código

[matcher] generate NoValue switches as Void

closes #7206
Simon Krajewski %!s(int64=7) %!d(string=hai) anos
pai
achega
27f4df9cdb
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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