Stop adding malformed container decls into scopes

This commit is contained in:
Alexandros Naskos 2020-06-11 03:20:44 +03:00
parent 80dd19dd8b
commit 28e9d08f03

View File

@ -1081,7 +1081,6 @@ pub fn iterateSymbolsGlobal(
}
for (scope.uses) |use| {
// @TODO Resolve uses, iterate over their symbols.
const use_expr = (try resolveTypeOfNode(store, arena, .{ .node = use.expr, .handle = handle })) orelse continue;
try iterateSymbolsContainer(store, arena, use_expr, handle, callback, context);
}
@ -1304,6 +1303,12 @@ fn makeScopeInternal(
continue;
}
if (decl.cast(ast.Node.ContainerField)) |field| {
if (field.type_expr == null and field.value_expr == null) {
continue;
}
}
if (try scopes.items[scope_idx].decls.put(name, .{ .ast_node = decl })) |existing| {
// TODO Record a redefinition error.
}