Browse Source

delay arg check against Void (#6201)

Aleksandr Kuzmenko 6 years ago
parent
commit
cfd3c99fb8
1 changed files with 4 additions and 2 deletions
  1. 4 2
      src/typing/typeloadFunction.ml

+ 4 - 2
src/typing/typeloadFunction.ml

@@ -29,9 +29,11 @@ open Common
 open Error
 
 let type_function_arg ctx t e opt p =
-	(match follow t with
+	delay ctx PTypeField (fun() ->
+		match follow t with
 		| TAbstract ({a_path = [],"Void"},_) -> error "Arguments of type Void are not allowed" p
-		| _ -> ());
+		| _ -> ()
+	);
 	if opt then
 		let e = (match e with None -> Some (EConst (Ident "null"),null_pos) | _ -> e) in
 		ctx.t.tnull t, e