Avatar
@swift-5.5.3 -Xfrontend -parse-as-library import Foundation @main struct Entrypoint { static func main() async throws { let _: () = await withUnsafeContinuation { c in test2 { // com.apple.root.default-qos.cooperative print(Thread.current) c.resume(returning: ()) } } let _: () = await withUnsafeContinuation { c in test2 { @MainActor () in // com.apple.main-thread print(Thread.current) c.resume(returning: ()) } } } } private func test1(_ f: @MainActor @escaping () async -> Void) { Task.detached { await f() } } private func test2(_ f: @escaping () async -> Void) { test1(f) } (edited)