mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Refactor function return type representation (#6463)
This separates the return type from the return pattern, and replaces the return pattern with a block of return patterns. This is a step toward support for `ref` returns (where there's no corresponding return pattern) and compund-form returns (where there may be multiple return patterns).
This commit is contained in:
@@ -156,7 +156,7 @@ static auto PopImplIntroducerAndParamsAsNameComponent(
|
||||
// because `impl`s are never actually called at runtime.
|
||||
auto call_params_id =
|
||||
CalleePatternMatch(context, *implicit_param_patterns_id,
|
||||
SemIR::InstBlockId::None, SemIR::InstId::None);
|
||||
SemIR::InstBlockId::None, SemIR::InstBlockId::None);
|
||||
CARBON_CHECK(call_params_id == SemIR::InstBlockId::Empty ||
|
||||
llvm::all_of(context.inst_blocks().Get(call_params_id),
|
||||
[](SemIR::InstId inst_id) {
|
||||
@@ -186,7 +186,6 @@ static auto PopImplIntroducerAndParamsAsNameComponent(
|
||||
.params_loc_id = Parse::NodeId::None,
|
||||
.param_patterns_id = SemIR::InstBlockId::None,
|
||||
.call_params_id = SemIR::InstBlockId::None,
|
||||
.return_slot_pattern_id = SemIR::InstId::None,
|
||||
.pattern_block_id = pattern_block_id};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user