Fixed regression from latest commit

This commit is contained in:
Alexandros Naskos 2021-03-29 15:35:14 +03:00
parent 962327425d
commit e770e2bead
No known key found for this signature in database
GPG Key ID: 02BF2E72B0EA32D2

View File

@ -2701,6 +2701,11 @@ fn makeScopeInternal(
decl, decl,
); );
const name = getDeclName(tree, decl) orelse continue; 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) { if (tags[decl] == .test_decl) {
try tests.append(allocator, decl); try tests.append(allocator, decl);
continue; 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); scopes.items[scope_idx].tests = tests.toOwnedSlice(allocator);