mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Separate pattern types from expression types (#5360)
This is a step toward treating patterns as compile-time constants, so that we can import them more easily.
This commit is contained in:
@@ -72,12 +72,13 @@ auto HandleParseNode(Context& context, Parse::ReturnTypeId node_id) -> bool {
|
||||
FullPatternStack::Kind::ExplicitParamList);
|
||||
}
|
||||
|
||||
auto pattern_type_id = GetPatternType(context, as_type.type_id);
|
||||
auto return_slot_pattern_id = AddPatternInst<SemIR::ReturnSlotPattern>(
|
||||
context, node_id,
|
||||
{.type_id = as_type.type_id, .type_inst_id = as_type.inst_id});
|
||||
{.type_id = pattern_type_id, .type_inst_id = as_type.inst_id});
|
||||
auto param_pattern_id = AddPatternInst<SemIR::OutParamPattern>(
|
||||
context, node_id,
|
||||
{.type_id = as_type.type_id,
|
||||
{.type_id = pattern_type_id,
|
||||
.subpattern_id = return_slot_pattern_id,
|
||||
.index = SemIR::CallParamIndex::None});
|
||||
context.node_stack().Push(node_id, param_pattern_id);
|
||||
|
||||
Reference in New Issue
Block a user