Skip to content

Commit 55252e5

Browse files
committed
Revert "Merge pull request swiftlang#76302 from drexin/wip-typed-throws-empty"
This reverts commit cf2af68, reversing changes made to 0c30f55.
1 parent 617a089 commit 55252e5

File tree

2 files changed

+10
-22
lines changed

2 files changed

+10
-22
lines changed

lib/IRGen/GenCall.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,14 +2330,17 @@ void SignatureExpansion::expandAsyncAwaitType() {
23302330
if (!nativeError.shouldReturnTypedErrorIndirectly()) {
23312331
auto combined = combineResultAndTypedErrorType(IGM, native, nativeError);
23322332

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);
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);
23402341
}
2342+
} else {
2343+
components.push_back(combined.combinedTy);
23412344
}
23422345
addErrorResult();
23432346
ResultIRType = llvm::StructType::get(IGM.getLLVMContext(), components);

test/IRGen/typed_throws.swift

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
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-
119
// XFAIL: CPU=arm64e
1210
// REQUIRES: PTRSIZE=64
1311

@@ -234,16 +232,3 @@ protocol Proto {
234232
// This used to crash.
235233
static func f2() throws(SP) -> Int64
236234
}
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-
}

0 commit comments

Comments
 (0)