]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Allow "set" method of an container to return void or bool
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 31 Jul 2023 17:27:50 +0000 (19:27 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 31 Jul 2023 17:27:50 +0000 (19:27 +0200)
vala/valaelementaccess.vala

index ce6281870601f0f28b12d38d0ba0c7d1d8e733bd..00f1a22c4be74107be0e95828698a7311424b49f 100644 (file)
@@ -224,7 +224,8 @@ public class Vala.ElementAccess : Expression {
                        if (lvalue) {
                                var set_method = container.value_type.get_member ("set") as Method;
                                unowned Assignment? assignment = parent_node as Assignment;
-                               if (set_method != null && set_method.return_type is VoidType && assignment != null) {
+                               if (assignment != null && set_method != null
+                                   && (set_method.return_type is VoidType || set_method.return_type is BooleanType)) {
                                        return !error;
                                }
                        } else {