From e770e2bead05b84a0d86596a2ca3967b33eb6af4 Mon Sep 17 00:00:00 2001 From: Alexandros Naskos Date: Mon, 29 Mar 2021 15:35:14 +0300 Subject: [PATCH] Fixed regression from latest commit --- src/analysis.zig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/analysis.zig b/src/analysis.zig index 6405ffb..2fb3869 100644 --- a/src/analysis.zig +++ b/src/analysis.zig @@ -2701,6 +2701,11 @@ fn makeScopeInternal( decl, ); const name = getDeclName(tree, decl) orelse continue; + + if (try scopes.items[scope_idx].decls.fetchPut(name, .{ .ast_node = decl })) |existing| { + // TODO Record a redefinition error. + } + if (tags[decl] == .test_decl) { try tests.append(allocator, decl); continue; @@ -2727,10 +2732,6 @@ fn makeScopeInternal( }, {}); } } - - if (try scopes.items[scope_idx].decls.fetchPut(name, .{ .ast_node = decl })) |existing| { - // TODO Record a redefinition error. - } } scopes.items[scope_idx].tests = tests.toOwnedSlice(allocator);