SwiftFormat icon indicating copy to clipboard operation
SwiftFormat copied to clipboard

Removing `return` in front of `try await`

Open knutanderss opened this issue 6 months ago • 1 comments

Hi, we had an instance in our codebase where SwiftFormat removed return as redundant in front of try await withCheckedThrowingContinuation { ... }, which caused a type error. The outer function returns Void, and withCheckedThrowingContinuation is generic on its return type, so without return the compiler is not able to infer that the generic parameter should be Void too.

It seems perhaps that return is not redundant in front of try await ...?

Anyway, disabling redundantReturn for that line works for now.

knutanderss avatar Aug 14 '24 13:08 knutanderss