From: Rico Tzschichholz Date: Tue, 8 Aug 2023 06:48:17 +0000 (+0200) Subject: Some cleaning X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fec6aeb227e7a87dc814314c72c1056bf6f7bad6;p=thirdparty%2Fvala.git Some cleaning --- diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala index 006247936..afa120a9c 100644 --- a/vala/valamethodcall.vala +++ b/vala/valamethodcall.vala @@ -613,10 +613,9 @@ public class Vala.MethodCall : Expression, CallableExpression { type_arg = m.return_type.infer_type_argument (type_param, target_type); } - DataType? ct = type_param.get_constrained_type (); - if (type_arg == null && ct != null) { - Report.notice (source_reference, "`%s' requires type arguments, constraining `%s' to `%s'", m.to_string (), type_param.name, ct.to_qualified_string ()); - type_arg = ct; + if (type_arg == null && type_param.has_type_constraints ()) { + type_arg = type_param.get_constrained_type (); + Report.notice (source_reference, "`%s' requires type arguments, constraining `%s' to `%s'", m.to_string (), type_param.name, type_arg.to_qualified_string ()); } if (type_arg == null) {