mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Model type expressions as regions (#4698)
This is a precondition for enabling the new pattern-matching subsystem to support binding patterns that have `if` expressions in the type position. --------- Co-authored-by: Richard Smith <richard@metafoo.co.uk>
This commit is contained in:
co-authored by
Richard Smith
parent
95c9634c60
commit
a112cbde5c
@@ -378,9 +378,9 @@ static auto HandleFunctionDefinitionAfterSignature(
|
||||
// Create the function scope and the entry block.
|
||||
context.return_scope_stack().push_back({.decl_id = decl_id});
|
||||
context.inst_block_stack().Push();
|
||||
context.PushRegion(context.inst_block_stack().PeekOrAdd());
|
||||
context.scope_stack().Push(decl_id);
|
||||
StartGenericDefinition(context);
|
||||
context.AddCurrentCodeBlockToFunction();
|
||||
|
||||
CheckFunctionDefinitionSignature(context, function);
|
||||
|
||||
@@ -441,8 +441,10 @@ auto HandleParseNode(Context& context, Parse::FunctionDefinitionId node_id)
|
||||
context.return_scope_stack().pop_back();
|
||||
context.decl_name_stack().PopScope();
|
||||
|
||||
// If this is a generic function, collect information about the definition.
|
||||
auto& function = context.functions().Get(function_id);
|
||||
function.body_block_ids = context.PopRegion();
|
||||
|
||||
// If this is a generic function, collect information about the definition.
|
||||
FinishGenericDefinition(context, function.generic_id);
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user