mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Remove node_stack Peek templating where possible (#4801)
The "templated for consistency" variants felt a little confusing when I was working on #4795, so suggesting to remove templating where it's not helpful to instantiate (particularly when there were both templated and non-templated variants). Note this leaves a `PeekIs<IdT>` because there's indirection there, but that's more the exception than the rule.
This commit is contained in:
@@ -77,7 +77,7 @@ static auto HandleAnyBindingPattern(Context& context, Parse::NodeId node_id,
|
||||
|
||||
// A `self` binding can only appear in an implicit parameter list.
|
||||
if (name_id == SemIR::NameId::SelfValue &&
|
||||
!context.node_stack().PeekIs<Parse::NodeKind::ImplicitParamListStart>()) {
|
||||
!context.node_stack().PeekIs(Parse::NodeKind::ImplicitParamListStart)) {
|
||||
CARBON_DIAGNOSTIC(
|
||||
SelfOutsideImplicitParamList, Error,
|
||||
"`self` can only be declared in an implicit parameter list");
|
||||
|
||||
Reference in New Issue
Block a user