mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 10:21:04 +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:
@@ -452,9 +452,9 @@ fn F() {
|
||||
// CHECK:STDERR: class C;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE-14]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:1: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: auto foo() -> C;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:2:7: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: class C;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo();
|
||||
}
|
||||
|
||||
@@ -451,9 +451,9 @@ fn F() {
|
||||
// CHECK:STDERR: struct S;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE-14]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:1: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: auto foo() -> S;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:2:8: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: struct S;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo();
|
||||
}
|
||||
|
||||
@@ -413,9 +413,9 @@ fn F() {
|
||||
// CHECK:STDERR: union U;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: fail_import_decl_value_return_type.carbon:[[@LINE-14]]:10: in file included here [InCppInclude]
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:4:1: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: auto foo() -> U;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR: ./decl_value_return_type.h:2:7: note: return type declared here [IncompleteReturnTypeHere]
|
||||
// CHECK:STDERR: union U;
|
||||
// CHECK:STDERR: ^
|
||||
// CHECK:STDERR:
|
||||
Cpp.foo();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user