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:
Jon Ross-Perkins
2025-01-15 22:12:22 +00:00
committed by GitHub
parent e0f9c40f47
commit f7269482fe
4 changed files with 12 additions and 29 deletions
+1 -1
View File
@@ -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");