Initial support for return forms (#6556)

The main changes here are:
- Introducing `InitForm` and `RefForm` to represent initializing and
reference forms (the two return forms currently supported by the
parser).
- Introducing the `FormType` singleton inst to represent their type
(i.e. `Core.Form`).
- Emitting an inst representing a function's declared return form as
part of handling the function signature.

The return form inst is currently ignored. Subsequent PRs will expose it
in `SemIR::Function` and use it to determine the form of call
expressions.
This commit is contained in:
Geoff Romer
2026-01-07 00:54:18 +00:00
committed by GitHub
parent 444c18dfa3
commit 505b1c86b9
225 changed files with 4164 additions and 2583 deletions
-2
View File
@@ -139,8 +139,6 @@ auto CheckFunctionDefinitionSignature(Context& context,
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();
}
// Check the parameter types are complete.