Avatar
Avatar
Iceman
@swift-5.7.3 import Foundation protocol P: Sendable { func f() } final class C: P { @MainActor func f() { print(Thread.isMainThread) } } let c = C() let p: P = C() Task { print(Thread.isMainThread) await c.f() p.f() } RunLoop.main.run(until: Date().addingTimeInterval(0.3)) (edited)
swift57 BOT 6/9/2022 2:20 AM
false true false (edited)