Browse Source

bugfix (close #7166)

Nicolas Cannasse 7 năm trước cách đây
mục cha
commit
668abdaeba
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      src/generators/genhl.ml

+ 2 - 1
src/generators/genhl.ml

@@ -515,8 +515,9 @@ and real_type ctx e =
 					| TInst ({cl_kind=KTypeParameter _},_), TFun _ -> a2
 					(*
 						If we have a number, it is more accurate to cast it to the type parameter before wrapping it as dynamic
+						Ignore dynamic method (#7166)
 					*)
-					| TInst ({cl_kind=KTypeParameter _},_), t when is_number (to_type ctx t) ->
+					| TInst ({cl_kind=KTypeParameter _},_), t when is_number (to_type ctx t) && (match f with FInstance (_,_,{ cf_kind = Method MethDynamic }) -> false | _ -> true) ->
 						(name, opt, TAbstract (fake_tnull,[t]))
 					| _ ->
 						a