瀏覽代碼

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

Simon Krajewski 12 年之前
父節點
當前提交
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