I thought the following would have been resolved with Pull Request #82383
I’m using default actor isolation of MainActor as well as approachable concurrency. But when I have a protocol conforming to Equatable
, I still need to use @MainActor
on conforming types:
protocol P1: Equatable { }
struct S1: P1 { }
// Error: Conformance of 'S1' to protocol 'P1' crosses into main actor-isolated code an can cause data races
struct S1Workaround: @MainActor P1 { } // OK
// Another potential workaround if `Equatable` conformance can be moved to the conforming type.
protocol P2 { }
struct S2: Equatable, P2 { } // OK
I filed Issue 83610 last week but not responses yet. Thus, posting here to see if anyone has insights to include if this is perhaps working as expected. Thank you.