Avatar
Avatar
Iceman
@swift-5.5.3 -warn-concurrency @MainActor class ViewController { func viewDidAppear() {} } class XViewController: ViewController { override func viewDidAppear() { } } @MainActor protocol StateProtocol { } class State: StateProtocol { func f() async { let vc = ViewController() let xvc = XViewController() Task { vc.viewDidAppear() xvc.viewDidAppear() } } } (edited)
stderr:<stdin>:21:7: warning: cannot use let 'xvc' with a non-sendable type 'XViewController' from concurrently-executed code xvc.viewDidAppear() ^ (edited)