diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-08-05 23:17:29 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-08-05 23:17:29 -0700 |
| commit | 47f2463b5c784cb7be9593f56e6b89805dbb8f06 (patch) | |
| tree | e08eed656f8d648dcf550dc7244d31a0b3846416 /lib/std | |
| parent | c03a04a58942446b48e9294df991a17a3a6f7b48 (diff) | |
| download | zig-47f2463b5c784cb7be9593f56e6b89805dbb8f06.tar.gz zig-47f2463b5c784cb7be9593f56e6b89805dbb8f06.zip | |
std.HashMap: fix getPtrAdapted. AstGen: fix fn param iteration
There was a bug in stage2 regarding iteration of function parameter AST.
This resulted in a false negative "unused parameter" compile error,
which, when fixed, revealed a bug in the std lib HashMap implementation.
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/hash_map.zig | 2 | ||||
| -rw-r--r-- | lib/std/zig/ast.zig | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/std/hash_map.zig b/lib/std/hash_map.zig index ef97e7d7fa..77d2df2efe 100644 --- a/lib/std/hash_map.zig +++ b/lib/std/hash_map.zig @@ -563,7 +563,7 @@ pub fn HashMap( return self.unmanaged.getPtrContext(key, self.ctx); } pub fn getPtrAdapted(self: Self, key: anytype, ctx: anytype) ?*V { - return self.unmanaged.getPtrAdapted(key, self.ctx); + return self.unmanaged.getPtrAdapted(key, ctx); } /// Finds the key and value associated with a key in the map diff --git a/lib/std/zig/ast.zig b/lib/std/zig/ast.zig index abcb29f8b5..61969d9699 100644 --- a/lib/std/zig/ast.zig +++ b/lib/std/zig/ast.zig @@ -2198,6 +2198,9 @@ pub const full = struct { .type_expr = param_type, }; } + if (token_tags[it.tok_i] == .comma) { + it.tok_i += 1; + } if (token_tags[it.tok_i] == .r_paren) { return null; } |
