[vala/0.52] vala: More thorough check of ValueType and set CodeNode.error on failure



commit 97f0ff85f1b155c143ed561f33d87c2157b85be6
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Fri Oct 15 12:02:21 2021 +0200

    vala: More thorough check of ValueType and set CodeNode.error on failure

 vala/valadelegatetype.vala |  2 ++
 vala/valaobjecttype.vala   |  2 ++
 vala/valavaluetype.vala    | 13 ++++++++++++-
 3 files changed, 16 insertions(+), 1 deletion(-)
---
diff --git a/vala/valadelegatetype.vala b/vala/valadelegatetype.vala
index 9821a9e70..9d831954a 100644
--- a/vala/valadelegatetype.vala
+++ b/vala/valadelegatetype.vala
@@ -96,11 +96,13 @@ public class Vala.DelegateType : CallableType {
                }
 
                if (!delegate_symbol.check (context)) {
+                       error = true;
                        return false;
                }
 
                // check whether there is the expected amount of type-arguments
                if (!check_type_arguments (context, true)) {
+                       error = true;
                        return false;
                }
 
diff --git a/vala/valaobjecttype.vala b/vala/valaobjecttype.vala
index 8e08ade76..11047ed4a 100644
--- a/vala/valaobjecttype.vala
+++ b/vala/valaobjecttype.vala
@@ -100,11 +100,13 @@ public class Vala.ObjectType : ReferenceType {
 
        public override bool check (CodeContext context) {
                if (!type_symbol.check (context)) {
+                       error = true;
                        return false;
                }
 
                // check whether there is the expected amount of type-arguments
                if (!check_type_arguments (context, true)) {
+                       error = true;
                        return false;
                }
 
diff --git a/vala/valavaluetype.vala b/vala/valavaluetype.vala
index aa97f7c39..a9a6b7fd0 100644
--- a/vala/valavaluetype.vala
+++ b/vala/valavaluetype.vala
@@ -49,6 +49,17 @@ public abstract class Vala.ValueType : DataType {
        }
 
        public override bool check (CodeContext context) {
-               return type_symbol.check (context);
+               if (!type_symbol.check (context)) {
+                       error = true;
+                       return false;
+               }
+
+               // check whether there is the expected amount of type-arguments
+               if (!check_type_arguments (context, true)) {
+                       error = true;
+                       return false;
+               }
+
+               return true;
        }
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]