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);