]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
genie: Accept INTERR token before type arguments when parsing type
authorRico Tzschichholz <ricotz@ubuntu.com>
Wed, 3 Nov 2021 17:47:31 +0000 (18:47 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Wed, 3 Nov 2021 17:51:38 +0000 (18:51 +0100)
Fixes https://gitlab.gnome.org/GNOME/vala/issues/1245

vala/valagenieparser.vala

index 92a92be651f426eefd42f53a502568bd204f6c80..a9ef565138db629a7dcccb7147d00bb976a4a559 100644 (file)
@@ -506,6 +506,7 @@ public class Vala.Genie.Parser : CodeVisitor {
 
                bool is_dynamic = accept (TokenType.DYNAMIC);
                bool value_owned = owned_by_default;
+               bool is_nullable = false;
 
                if (owned_by_default) {
                        if (accept (TokenType.UNOWNED)) {
@@ -562,6 +563,8 @@ public class Vala.Genie.Parser : CodeVisitor {
                                sym = parse_symbol_name ();
                        }
 
+                       is_nullable = accept (TokenType.INTERR);
+
                        type_arg_list = parse_type_argument_list (false);
 
                        type = new UnresolvedType.from_symbol (sym, get_src (begin));
@@ -577,7 +580,7 @@ public class Vala.Genie.Parser : CodeVisitor {
                }
 
                if (!(type is PointerType)) {
-                       type.nullable = accept (TokenType.INTERR);
+                       type.nullable = is_nullable;
                }
 
                if (is_array) {