File tree Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -2330,17 +2330,14 @@ void SignatureExpansion::expandAsyncAwaitType() {
23302330 if (!nativeError.shouldReturnTypedErrorIndirectly ()) {
23312331 auto combined = combineResultAndTypedErrorType (IGM, native, nativeError);
23322332
2333- if (combined.combinedTy ->isVoidTy ()) {
2334- addErrorResult ();
2335- return ;
2336- }
2337-
2338- if (auto *structTy = dyn_cast<llvm::StructType>(combined.combinedTy )) {
2339- for (auto *elem : structTy->elements ()) {
2340- components.push_back (elem);
2333+ if (!combined.combinedTy ->isVoidTy ()) {
2334+ if (auto *structTy = dyn_cast<llvm::StructType>(combined.combinedTy )) {
2335+ for (auto *elem : structTy->elements ()) {
2336+ components.push_back (elem);
2337+ }
2338+ } else {
2339+ components.push_back (combined.combinedTy );
23412340 }
2342- } else {
2343- components.push_back (combined.combinedTy );
23442341 }
23452342 addErrorResult ();
23462343 ResultIRType = llvm::StructType::get (IGM.getLLVMContext (), components);
Original file line number Diff line number Diff line change 66
77// RUN: %target-swift-frontend -primary-file %s -emit-ir -enable-library-evolution
88
9+ // RUN: %target-swift-frontend -primary-file %s -emit-ir -O
10+
911// XFAIL: CPU=arm64e
1012// REQUIRES: PTRSIZE=64
1113
@@ -232,3 +234,16 @@ protocol Proto {
232234 // This used to crash.
233235 static func f2( ) throws ( SP) -> Int64
234236}
237+
238+ @inline ( never)
239+ @available ( SwiftStdlib 6 . 0 , * )
240+ public func passthroughAsync< T, E: Error > ( f: ( ) async throws ( E) -> T ) async throws ( E) -> T {
241+ try await f ( )
242+ }
243+
244+ @available ( SwiftStdlib 6 . 0 , * )
245+ public func reabstractAsyncVoidThrowsNever( ) async {
246+ await passthroughAsync {
247+ ( )
248+ }
249+ }
You can’t perform that action at this time.
0 commit comments