]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Some cleaning wip/generics-constraints
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 8 Aug 2023 06:48:17 +0000 (08:48 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 21 Apr 2024 11:46:27 +0000 (13:46 +0200)
vala/valamethodcall.vala

index 0062479369a643fd8e2f11302de2fd17fa0c5e4d..afa120a9c09fa3684e94f4cf701862c804e81440 100644 (file)
@@ -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) {