Avatar
Avatar
kntk
@swift-5.7.3 @swift-5.6.3 func nonIsolatedFunc() async { print(Thread.isMainThread) try? await Task.sleep(nanoseconds: 1_000_000) print(Thread.isMainThread) } Task { @MainActor in await nonIsolatedFunc() }
exit status: 1 with <stdin>:2:11: error: cannot find 'Thread' in scope print(Thread.isMainThread) ^~~~~~ <stdin>:5:11: error: cannot find 'Thread' in scope print(Thread.isMainThread) ^~~~~~