Ver Fonte

don't follow away Null<Void> in function returns

Simon Krajewski há 1 ano atrás
pai
commit
4e20f008f8
2 ficheiros alterados com 10 adições e 2 exclusões
  1. 2 2
      src/compiler/hxb/hxbWriter.ml
  2. 8 0
      src/core/tFunctions.ml

+ 2 - 2
src/compiler/hxb/hxbWriter.ml

@@ -512,9 +512,9 @@ class ['a] hxb_writer
 			chunk#write_byte 20;
 			self#write_abstract_ref a;
 			self#write_types tl
-		| TFun([],t) when ExtType.is_void (follow t) ->
+		| TFun([],t) when ExtType.is_void (follow_lazy_and_mono t) ->
 			chunk#write_byte 30;
-		| TFun(args,t) when ExtType.is_void (follow t) ->
+		| TFun(args,t) when ExtType.is_void (follow_lazy_and_mono t) ->
 			chunk#write_byte 31;
 			chunk#write_list args write_function_arg;
 		| TFun(args,t) ->

+ 8 - 0
src/core/tFunctions.ml

@@ -607,6 +607,14 @@ let rec follow_without_type t =
 		follow_without_type t
 	| _ -> t
 
+let rec follow_lazy_and_mono t = match t with
+	| TMono {tm_type = Some t} ->
+		follow_lazy_and_mono t
+	| TLazy f ->
+		follow_lazy_and_mono (lazy_type f)
+	| _ ->
+		t
+
 let rec ambiguate_funs t =
 	match follow t with
 	| TFun _ -> TFun ([], t_dynamic)