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