mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Parse ref as operator (#6539)
This is the first step of implementing the guidance in #6342. --------- Co-authored-by: josh11b <15258583+josh11b@users.noreply.github.com>
This commit is contained in:
@@ -33,18 +33,4 @@ auto HandleParseNode(Context& context, Parse::CallExprId node_id) -> bool {
|
||||
return true;
|
||||
}
|
||||
|
||||
auto HandleParseNode(Context& context, Parse::RefTagId node_id) -> bool {
|
||||
auto expr_id = context.node_stack().Peek<Parse::NodeCategory::Expr>();
|
||||
|
||||
if (SemIR::GetExprCategory(context.sem_ir(), expr_id) !=
|
||||
SemIR::ExprCategory::DurableRef) {
|
||||
CARBON_DIAGNOSTIC(
|
||||
RefTagNotDurableRef, Error,
|
||||
"expression tagged with `ref` is not a durable reference");
|
||||
context.emitter().Emit(node_id, RefTagNotDurableRef);
|
||||
}
|
||||
context.ref_tags().Insert(expr_id, Context::RefTag::Present);
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace Carbon::Check
|
||||
|
||||
Reference in New Issue
Block a user