Browse Source

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

Simon Krajewski 12 years ago
parent
commit
85e0deb096
1 changed files with 1 additions and 1 deletions
  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