Explorar o código

do not consider Void when checking return flow (fixed issue #1815)

Simon Krajewski %!s(int64=12) %!d(string=hai) anos
pai
achega
85e0deb096
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      typeload.ml

+ 1 - 1
typeload.ml

@@ -1033,7 +1033,7 @@ let type_function ctx args ret fmode f do_display p =
 	in
 	let rec loop e =
 		match e.eexpr with
-		| TReturn (Some _) -> raise Exit
+		| TReturn (Some e) -> (match follow e.etype with TAbstract({a_path = [],"Void"},[]) -> () | _ -> raise Exit)
 		| TFunction _ -> ()
 		| _ -> Type.iter loop e
 	in