forgot to make "#auto" work with compound declarations
authorBrendan Hansen <brendan.f.hansen@gmail.com>
Wed, 5 Oct 2022 00:20:34 +0000 (19:20 -0500)
committerBrendan Hansen <brendan.f.hansen@gmail.com>
Wed, 5 Oct 2022 00:20:34 +0000 (19:20 -0500)
compiler/src/parser.c

index 8c878f61db36ebcb9d25dc8734727391ef572a40..4d1ed8886043f23bc35604fb26c60939173c1e6f 100644 (file)
@@ -1299,7 +1299,13 @@ static i32 parse_possible_compound_symbol_declaration(OnyxParser* parser, AstNod
         prev_local->next = (AstNode *) assignment;
 
     } else {
-        AstType* type_for_all = parse_type(parser);
+        AstType* type_for_all = NULL;
+
+        // See comment in parse_possible_symbol_declaration about "#auto"
+        if (!parse_possible_directive(parser, "auto")) {
+            type_for_all = parse_type(parser);
+        }
+
         forll (AstLocal, local, first_local, next) {
             local->type_node = type_for_all;
         }