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



commit 332de9a3371f35c0028bac1aab5dd61be5332ad0
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 e23eb15a1..d9c4b7a2e 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 699046fb4..cf54919f1 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]