mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 15:31:08 +01:00
When converting an expression to type type, retain the resulting instruction as well as the TypeId. (#4355)
The `TypeId` is lossy, as it represents only the canonical type, and not the specific computation that produced it.
This commit is contained in:
@@ -43,7 +43,7 @@ auto HandleParseNode(Context& context, Parse::FunctionIntroducerId node_id)
|
||||
auto HandleParseNode(Context& context, Parse::ReturnTypeId node_id) -> bool {
|
||||
// Propagate the type expression.
|
||||
auto [type_node_id, type_inst_id] = context.node_stack().PopExprWithNodeId();
|
||||
auto type_id = ExprAsType(context, type_node_id, type_inst_id);
|
||||
auto type_id = ExprAsType(context, type_node_id, type_inst_id).type_id;
|
||||
// TODO: Use a dedicated instruction rather than VarStorage here.
|
||||
context.AddInstAndPush<SemIR::VarStorage>(
|
||||
node_id, {.type_id = type_id, .name_id = SemIR::NameId::ReturnSlot});
|
||||
|
||||
Reference in New Issue
Block a user