Przeglądaj źródła

prevented several errors when "not enough arguments".

Nicolas Cannasse 19 lat temu
rodzic
commit
d58119f2d5
1 zmienionych plików z 4 dodań i 2 usunięć
  1. 4 2
      typer.ml

+ 4 - 2
typer.ml

@@ -710,8 +710,10 @@ let unify_call_params ctx t el args p =
 				error true;
 				error true;
 				loop (null p :: acc) [] [])
 				loop (null p :: acc) [] [])
 		| [] , (_,opt,_) :: l ->
 		| [] , (_,opt,_) :: l ->
-			if not opt then error true;
-			if is_flash_extern t then 
+			if not opt then begin
+				error true;
+				List.rev acc
+			end else if is_flash_extern t then 
 				loop acc [] l
 				loop acc [] l
 			else
 			else
 				loop (null p :: acc) [] l
 				loop (null p :: acc) [] l