mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-27 14:54:05 +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
@@ -415,7 +415,6 @@ class NodeStack {
|
||||
case Parse::NodeKind::FieldNameAndType:
|
||||
case Parse::NodeKind::IfExprThen:
|
||||
case Parse::NodeKind::RequireIntroducer:
|
||||
case Parse::NodeKind::ReturnType:
|
||||
case Parse::NodeKind::ShortCircuitOperandAnd:
|
||||
case Parse::NodeKind::ShortCircuitOperandOr:
|
||||
case Parse::NodeKind::StructLiteralField:
|
||||
@@ -447,6 +446,8 @@ class NodeStack {
|
||||
case Parse::NodeKind::DefaultLibrary:
|
||||
case Parse::NodeKind::LibraryName:
|
||||
return Id::KindFor<SemIR::LibraryNameId>();
|
||||
case Parse::NodeKind::ReturnType:
|
||||
return Id::KindFor<SemIR::InstId>();
|
||||
case Parse::NodeKind::AssociatedConstantInitializer:
|
||||
case Parse::NodeKind::AssociatedConstantIntroducer:
|
||||
case Parse::NodeKind::BuiltinName:
|
||||
|
||||
Reference in new issue
Block a user