I have encountered a pretty strange run-time error in Swift 6 mode with the following code:
protocol P {
var key: String { get }
}
@globalActor
actor GA {
static var shared = GA()
}
@GA
class A: P {
let key: String = "SomeKey"
}
let p: P = A()
print(p.key) // <- run-time error here
Looks like it's a result of a combination of a global actor and protocol. If I make A a normal actor, or if I remove the protocol and use an instance of A directly the error is not triggered.
What is the reason for this error and how do I fix it?
Also why would Swift 6 fail at run-time in such a trivial situation when it's supposed to guarantee concurrency safety at compile time?
Sorry I should have mentioned that the app crashes with SIGABRT and the last thing I can see in the logs is the phrase "Incorrect actor executor assumption" and nothing else.
Could someone point me where I should file an issue exactly?