I too, am running into this problem. I have a full reproducible example for something that works in XCode 16.4 but does not work in XCode 26, Beta 1.
protocol TestProtocol:Sendable {
var version: Int { get }
}
actor TestManager {
private let migrations: TestProtocol
init(migrations: TestProtocol) {
self.migrations = migrations
if migrations.version < 5 {
}
}
func doSomething() async throws {
if migrations.version < 5 {
}
}
}
This gives me:
Main actor-isolated property 'version' can not be referenced from a nonisolated context; this is an error in the Swift 6 language mode
I can store the property, then await the value before my check - which I guess is fine...
func doSomething() async throws {
let ver = await migrations.version
if ver < 5 {
}
}
Though this is a PITA when doing logging all over the app, or constantly accessing members of the object itself. For example, the attached screenshot shows I can't access version - despite the fact that the DatabaseMigration protocol is Sendable. Even more confusing for me is that I await a call to migration.build() and yet I still can't access member variables on the results of the awaited function...
If I run this code in XCode 16.4, there's no actor-isolated warnings for Swift 6, even on a file->new project. I can't tell if this is a bug in XCode 26, or not. If it's not, I don't know what the expected developer workflow is for this going forward.
Topic:
UI Frameworks
SubTopic:
AppKit
Tags: