From fec6aeb227e7a87dc814314c72c1056bf6f7bad6 Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Tue, 8 Aug 2023 08:48:17 +0200 Subject: [PATCH] Some cleaning --- vala/valamethodcall.vala | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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) { -- 2.47.2