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