Change Context::IsImplFile to File::is_impl (#4931)

Note this mirrors parse_tree().packaging_decl().is_impl, but I'm
preferring to keep the version that doesn't access the parse tree so
that we could change tree storage without hurting as much.
This commit is contained in:
Jon Ross-Perkins
2025-02-12 19:42:07 +00:00
committed by GitHub
parent 71c91eaf14
commit 8af64ceca6
9 changed files with 35 additions and 32 deletions
+3 -2
View File
@@ -111,7 +111,8 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
// A `var` binding in a class scope declares a field, not a true binding,
// so we handle it separately.
if (auto parent_class_decl = context.GetCurrentScopeAs<SemIR::ClassDecl>();
if (auto parent_class_decl =
context.scope_stack().GetCurrentScopeAs<SemIR::ClassDecl>();
parent_class_decl.has_value() &&
node_kind == Parse::NodeKind::VarBindingPattern) {
cast_type_id = AsConcreteType(
@@ -152,7 +153,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
// A binding in an interface scope declares an associated constant, not a
// true binding, so we handle it separately.
if (auto parent_interface_decl =
context.GetCurrentScopeAs<SemIR::InterfaceDecl>();
context.scope_stack().GetCurrentScopeAs<SemIR::InterfaceDecl>();
parent_interface_decl.has_value() && is_generic) {
cast_type_id = AsCompleteType(context, cast_type_id, type_node, [&] {
CARBON_DIAGNOSTIC(IncompleteTypeInAssociatedDecl, Error,