mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-18 18:20:29 +00: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:
1 parent
77918d023b
commit
bf45b1cbf5
57 files changed
+1668
-1532
No files matched your search
@@ -135,9 +135,8 @@ auto CheckFunctionDefinitionSignature(Context& context,
|
||||
context.inst_blocks().GetOrEmpty(function.call_params_id);
|
||||
|
||||
// Check the return type is complete.
|
||||
if (function.return_slot_pattern_id.has_value()) {
|
||||
CheckFunctionReturnType(context,
|
||||
SemIR::LocId(function.return_slot_pattern_id),
|
||||
if (function.return_type_inst_id.has_value()) {
|
||||
CheckFunctionReturnType(context, SemIR::LocId(function.return_type_inst_id),
|
||||
function, SemIR::SpecificId::None);
|
||||
// Don't re-check the return type below.
|
||||
params_to_complete.consume_back();
|
||||
|
||||
Reference in new issue
Block a user