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

do not skip cast detection for the first argument of inlined constructors (fixed issue #1810)

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

+ 1 - 1
optimizer.ml

@@ -167,7 +167,7 @@ let rec type_inline ctx cf f ethis params tret config p force =
 			| TConst TNull , Some c -> mk (TConst c) v.v_type e.epos
 			(* we have to check for abstract casts here because we can't do that later. However, we have to skip the check for the
 			   first argument of abstract implementation functions. *)
-			| _ when not (first && Meta.has Meta.Impl cf.cf_meta) -> (!check_abstract_cast_ref) ctx (map_type v.v_type) e e.epos
+			| _ when not (first && Meta.has Meta.Impl cf.cf_meta && cf.cf_name <> "_new") -> (!check_abstract_cast_ref) ctx (map_type v.v_type) e e.epos
 			| _ -> e) :: loop pl al false
 		| [], (v,opt) :: al ->
 			mk (TConst (match opt with None -> TNull | Some c -> c)) v.v_type p :: loop [] al false