mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Decouple associated constants from let (#5973)
Decouples associated constants from being special cased in let handlers. Enforces associated constant grammar restrictions in parsing instead of checking. Closes #5411
This commit is contained in:
@@ -74,15 +74,6 @@ auto HandleParseNode(Context& context, Parse::TuplePatternId node_id) -> bool {
|
||||
context.node_stack()
|
||||
.PopAndDiscardSoloNodeId<Parse::NodeKind::TuplePatternStart>();
|
||||
|
||||
if (context.scope_stack().GetCurrentScopeAs<SemIR::InterfaceDecl>()) {
|
||||
CARBON_DIAGNOSTIC(ExpectedSingleBindingInAssociatedConstant, Error,
|
||||
"found tuple pattern in associated constant declaration; "
|
||||
"expected symbolic binding pattern");
|
||||
context.emitter().Emit(node_id, ExpectedSingleBindingInAssociatedConstant);
|
||||
context.node_stack().Push(node_id, SemIR::ErrorInst::InstId);
|
||||
EndSubpatternAsNonExpr(context);
|
||||
return true;
|
||||
}
|
||||
const auto& inst_block = context.inst_blocks().Get(refs_id);
|
||||
llvm::SmallVector<SemIR::InstId> type_inst_ids;
|
||||
type_inst_ids.reserve(inst_block.size());
|
||||
|
||||
Reference in New Issue
Block a user