فهرست منبع

[display] don't emit deprecation warnings on overloaded constructors

closes #8557
Simon Krajewski 6 سال پیش
والد
کامیت
c1226243c5
1فایلهای تغییر یافته به همراه5 افزوده شده و 1 حذف شده
  1. 5 1
      src/context/display/deprecationCheck.ml

+ 5 - 1
src/context/display/deprecationCheck.ml

@@ -63,7 +63,11 @@ let run_on_expr com e =
 		| TNew(c,_,el) ->
 			List.iter expr el;
 			check_class com c e.epos;
-			(match c.cl_constructor with None -> () | Some cf -> check_cf com cf e.epos)
+			begin match c.cl_constructor with
+				(* The AST doesn't carry the correct overload for TNew, so let's ignore this case... (#8557). *)
+				| Some cf when cf.cf_overloads = [] -> check_cf com cf e.epos
+				| _ -> ()
+			end
 		| TTypeExpr(mt) | TCast(_,Some mt) ->
 			check_module_type com mt e.epos
 		| TMeta((Meta.Deprecated,_,_) as meta,e1) ->