File tree 2 files changed +22
-10
lines changed
2 files changed +22
-10
lines changed Original file line number Diff line number Diff line change @@ -2330,17 +2330,14 @@ void SignatureExpansion::expandAsyncAwaitType() {
2330
2330
if (!nativeError.shouldReturnTypedErrorIndirectly ()) {
2331
2331
auto combined = combineResultAndTypedErrorType (IGM, native, nativeError);
2332
2332
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 );
2341
2340
}
2342
- } else {
2343
- components.push_back (combined.combinedTy );
2344
2341
}
2345
2342
addErrorResult ();
2346
2343
ResultIRType = llvm::StructType::get (IGM.getLLVMContext (), components);
Original file line number Diff line number Diff line change 6
6
7
7
// RUN: %target-swift-frontend -primary-file %s -emit-ir -enable-library-evolution
8
8
9
+ // RUN: %target-swift-frontend -primary-file %s -emit-ir -O
10
+
9
11
// XFAIL: CPU=arm64e
10
12
// REQUIRES: PTRSIZE=64
11
13
@@ -232,3 +234,16 @@ protocol Proto {
232
234
// This used to crash.
233
235
static func f2( ) throws ( SP) -> Int64
234
236
}
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