[Async Refactoring] Remove assertions for nil result values in async wrapper

Since we aren’t checking that all result arguments are `nil` if there was an `error` in all the other refactorings, also remove the assertions in the async wrapper.
This commit is contained in:
Alex Hoppen
2021-07-06 18:39:17 +02:00
parent 6cbbb7cb1f
commit 06219cdfa2
2 changed files with 0 additions and 12 deletions

View File

@@ -6082,17 +6082,9 @@ private:
OS << *ErrName << " " << tok::equal << " " << *ErrName << " ";
OS << tok::l_brace << "\n";
for (auto Idx : indices(SuccessParamNames)) {
auto &Name = SuccessParamNames[Idx];
auto ParamTy = SuccessParams[Idx].getParameterType();
if (!HandlerDesc.shouldUnwrap(ParamTy))
continue;
// assert(res == nil, "Expected nil-success param 'res' for non-nil
// error")
OS << "assert" << tok::l_paren << Name << " == " << tok::kw_nil;
OS << tok::comma << " \"Expected nil success param '" << Name;
OS << "' for non-nil error\"";
OS << tok::r_paren << "\n";
}
// continuation.resume(throwing: err)

View File

@@ -85,7 +85,6 @@ func foo6(_ completion: @escaping (String?, Error?) -> Void) {}
// FOO6-NEXT: return try await withCheckedThrowingContinuation { continuation in
// FOO6-NEXT: foo6() { result, error in
// FOO6-NEXT: if let error = error {
// FOO6-NEXT: assert(result == nil, "Expected nil success param 'result' for non-nil error")
// FOO6-NEXT: continuation.resume(throwing: error)
// FOO6-NEXT: return
// FOO6-NEXT: }
@@ -104,7 +103,6 @@ func foo7(_ completion: @escaping (String?, Int, Error?) -> Void) {}
// FOO7-NEXT: return try await withCheckedThrowingContinuation { continuation in
// FOO7-NEXT: foo7() { result1, result2, error in
// FOO7-NEXT: if let error = error {
// FOO7-NEXT: assert(result1 == nil, "Expected nil success param 'result1' for non-nil error")
// FOO7-NEXT: continuation.resume(throwing: error)
// FOO7-NEXT: return
// FOO7-NEXT: }
@@ -123,8 +121,6 @@ func foo8(_ completion: @escaping (String?, Int?, Error?) -> Void) {}
// FOO8-NEXT: return try await withCheckedThrowingContinuation { continuation in
// FOO8-NEXT: foo8() { result1, result2, error in
// FOO8-NEXT: if let error = error {
// FOO8-NEXT: assert(result1 == nil, "Expected nil success param 'result1' for non-nil error")
// FOO8-NEXT: assert(result2 == nil, "Expected nil success param 'result2' for non-nil error")
// FOO8-NEXT: continuation.resume(throwing: error)
// FOO8-NEXT: return
// FOO8-NEXT: }