Basic support for associated constant declarations (#3737)

This commit is contained in:
Richard Smith
2024-03-04 21:23:06 +00:00
committed by GitHub
parent fea2651e7c
commit 8e956baca8
26 changed files with 778 additions and 82 deletions
-8
View File
@@ -30,14 +30,6 @@ auto HandleLetAfterPattern(Context& context) -> void {
if (auto equals = context.ConsumeIf(Lex::TokenKind::Equal)) {
context.AddLeafNode(NodeKind::LetInitializer, *equals);
context.PushState(State::Expr);
} else {
if (!state.has_error) {
CARBON_DIAGNOSTIC(
ExpectedInitializerAfterLet, Error,
"Expected `=`; `let` declaration must have an initializer.");
context.emitter().Emit(*context.position(), ExpectedInitializerAfterLet);
}
context.ReturnErrorOnState();
}
}