2
0
Эх сурвалжийг харах

apply type parameters before checking type equality for abstract casts (fixed issue #1770)

Simon Krajewski 12 жил өмнө
parent
commit
bfbe196fac
1 өөрчлөгдсөн 6 нэмэгдсэн , 2 устгасан
  1. 6 2
      codegen.ml

+ 6 - 2
codegen.ml

@@ -1387,13 +1387,17 @@ module Abstract = struct
 				eright
 			| TAbstract({a_impl = Some c} as a,pl),t2 when not (Meta.has Meta.MultiType a.a_meta) ->
 				begin match find_to a pl t2 with
-					| tcf,None -> if tcf == tleft then eright else check_cast ctx (apply_params a.a_types pl tcf) eright p
+					| tcf,None ->
+						let tcf = apply_params a.a_types pl tcf in
+						if type_iseq tcf tleft then eright else check_cast ctx tcf eright p
 					| _,Some cf ->
 						recurse cf (fun () -> make_static_call ctx c cf a pl [eright] tleft p)
 				end
 			| t1,(TAbstract({a_impl = Some c} as a,pl) as t2) when not (Meta.has Meta.MultiType a.a_meta) ->
 				begin match find_from a pl t1 t2 with
-					| tcf,None -> if tcf == tleft then eright else check_cast ctx (apply_params a.a_types pl tcf) eright p
+					| tcf,None ->
+						let tcf = apply_params a.a_types pl tcf in
+						if type_iseq tcf tleft then eright else check_cast ctx tcf eright p
 					| _,Some cf ->
 						recurse cf (fun () -> make_static_call ctx c cf a pl [eright] tleft p)
 				end