Browse Source

one more dynamic fix

Nicolas Cannasse 16 năm trước cách đây
mục cha
commit
99349d9ce5
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      typer.ml

+ 6 - 0
typer.ml

@@ -537,11 +537,17 @@ let unify_int ctx e k =
 			(try is_dynamic (PMap.find f a.a_fields).cf_type with Not_found -> true)
 		| _ -> true
 	in
+	let is_dynamic_return t =
+		match follow t with
+		| TFun (_,r) -> is_dynamic r
+		| _ -> true
+	in
 	let maybe_dynamic_mono() =
 		match e.eexpr with		
 		| TLocal _ when not (is_dynamic e.etype)  -> false
 		| TArray({ etype = t },_) when not (is_dynamic_array t) -> false
 		| TField({ etype = t },f) when not (is_dynamic_field t f) -> false
+		| TCall({ etype = t },_) when not (is_dynamic_return t) -> false
 		| _ -> true
 	in
 	match k with