Sfoglia il codice sorgente

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

Simon Krajewski 12 anni fa
parent
commit
85e0deb096
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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