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

This commit is contained in:
Richard Smith
2024-02-06 00:59:52 +00:00
committed by GitHub
parent 524902b540
commit fdfb1fb5ef
17 changed files with 416 additions and 289 deletions
+2 -2
View File
@@ -144,7 +144,7 @@ auto HandleClassDefinitionStart(Context& context,
}
// Enter the class scope.
context.PushScope(class_decl_id, class_info.scope_id);
context.scope_stack().Push(class_decl_id, class_info.scope_id);
// Introduce `Self`.
context.AddNameToLookup(SemIR::NameId::SelfType,
@@ -329,7 +329,7 @@ auto HandleClassDefinition(Context& context,
auto class_id =
context.node_stack().Pop<Parse::NodeKind::ClassDefinitionStart>();
context.inst_block_stack().Pop();
context.PopScope();
context.scope_stack().Pop();
context.decl_name_stack().PopScope();
// The class type is now fully defined.