Xcode 16 Beta: Animatable + non isolated protocol requirement errors.

Here's some simple sample code which produces warnings (or errors if using Swift 6 language mode), annotated with the errors:

struct MyEffect: GeometryEffect {
    var animatableData: CGFloat // ERROR: Main actor-isolated property 'animatableData' cannot be used to satisfy nonisolated protocol requirement

    func effectValue(size: CGSize) -> ProjectionTransform { // ERROR: Main actor-isolated instance method 'effectValue(size:)' cannot be used to satisfy nonisolated protocol requirement
        ProjectionTransform(.identity)
    }
}

I run into the same issue with Shape:

private struct MyShape: Shape {
    var foo: UnitPoint = .zero
    var animatableData: CGPoint.AnimatableData = .zero // ERROR: Main actor-isolated property 'animatableData' cannot be used to satisfy nonisolated protocol requirement

    func path(in rect: CGRect) -> Path {
        print(foo) // ERROR: Main actor-isolated property 'foo' can not be referenced from a non-isolated context
        return Path()
    }
}

It seems that by conforming to these protocols (which share Animatable conformance), all properties within the struct become annotated with @MainActor. Is this a bug?

same here:

struct ShakeEffect: GeometryEffect { var position: CGFloat var animatableData: CGFloat { //same error as in original post here get {position} set {position = newValue} }

init(shakes: Int) {
    position = CGFloat(shakes)
}

func effectValue(size: CGSize) -> ProjectionTransform { //same error as in original post here
     ProjectionTransform(CGAffineTransform(translationX: -30 * sin(position * 2 * .pi), y: 0))
}

}

Xcode 16 Beta: Animatable + non isolated protocol requirement errors.
 
 
Q