File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -280,4 +280,29 @@ public func withErrorReporting<R>(
280280 }
281281 }
282282}
283+
284+ @_transparent
285+ @_unsafeInheritExecutor
286+ public func withErrorReporting< R> (
287+ _ message: @autoclosure ( ) -> String ? = nil ,
288+ to reporters: [ any IssueReporter ] ? = nil ,
289+ fileID: StaticString = #fileID,
290+ filePath: StaticString = #filePath,
291+ line: UInt = #line,
292+ column: UInt = #column,
293+ // DO NOT FIX THE WHITESPACE IN THE NEXT LINE UNTIL 5.10 IS UNSUPPORTED
294+ // https://github.com/swiftlang/swift/issues/79285
295+ catching body: ( ) async throws -> sending R? ) async -> R ? {
296+ (
297+ await withErrorReporting (
298+ message ( ) ,
299+ to: reporters,
300+ fileID: fileID,
301+ filePath: filePath,
302+ line: line,
303+ column: column,
304+ catching: body
305+ ) as R ??
306+ ) ?? nil
307+ }
283308#endif
You can’t perform that action at this time.
0 commit comments