Avatar
Avatar
Yuta Saito
@swift-5.5.3 @MainActor struct View { init() {} } func nonIsolated() { _ = View() }
swift55 BOT 3/9/2022 6:19 AM
exit status: 1 with stderr:<stdin>:6:7: error: call to main actor-isolated initializer 'init()' in a synchronous nonisolated context _ = View() ^ <stdin>:2:3: note: calls to initializer 'init()' from outside of its actor context are implicitly asynchronous init() {} ^ <stdin>:5:6: note: add '@MainActor' to make global function 'nonIsolated()' part of global actor 'MainActor' func nonIsolated() { ^ @MainActor