Main actor-isolated class 'FetchedDataSource' has different actor isolation from nonisolated superclass 'DataSource'

I'm trying to get our project to compile on Xcode 13 beta 5. Previous betas have failed to compile the project because of a dependency, but thankfully that change was rolled back in beta 5 so now all of our dependencies are compiling, but I don't know if the app code was broken before now.

I'm getting an error on one of my subclasses about actor isolation. I have made no changes from what compiles successfully in Xcode 12, so nothing in the app (or dependencies) is explicitly marked @MainActor. What's very odd is that if I pull out this class and it's superclass into a new project, they compile just fine. I'm not sure where to even begin to figure out how to resolve this as I don't see how it's becoming actor isolated.

I've also run into this issue. Check to see if your child class is conforming to a UIKit/Apple protocol that has a @MainActor attribute. In my case, it was a UIGestureRecognizerDelegate. A solution would be to mark your parent class with @MainActor, however this will bring about more compile errors that you'd need to address.

Terms of Service

Privacy Policy

Cookie Policy