Factor the scope stack and lexical lookups out of Check::Context. (#3688)

This commit is contained in:
Richard Smith authored and GitHub committed 2024-02-06 00:59:52 +00:00
1 parent 524902b540
commit fdfb1fb5ef
17 files changed
+416 -289

No files matched your search

+2 -1
View File
@@ -26,7 +26,8 @@ auto HandleAnyBindingPattern(Context& context, Parse::NodeId parse_node,
// TODO: Eventually the name will need to support associations with other
// scopes, but right now we don't support qualified names here.
auto bind_name_id = context.bind_names().Add(
{.name_id = name_id, .enclosing_scope_id = context.current_scope_id()});
{.name_id = name_id,
.enclosing_scope_id = context.scope_stack().PeekNameScopeId()});
if (is_generic) {
// TODO: Create a `BindTemplateName` instead inside a `template` pattern.
return {name_node,