mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-01 21:25:57 +01:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user