open class Operation : NSObject, @unchecked Sendable {
open var completionBlock: (@Sendable () -> Void)?
}
< /code>
open class TTOperation : Operation {
override open var completionBlock: (@Sendable() -> Void)? {
//code
}
}
< /code>
This was getting build successfully on Xcode 15.4 but when I have updated Xcode to 16.2 it gives me error like below:
Property 'completionBlock' with type '(@Sendable () -> Void)?' cannot override a property with type '(@MainActor @Sendable () -> Void)?'
- I have tried to add @unchecked Sendable for sub class declaration
}
< /code>
but it is giving same error
Property 'completionBlock' with type '(@Sendable () -> Void)?' cannot override a property with type '(@MainActor @Sendable () -> Void)?'
- I have also tried to add @MainActor while overriding property
}
< /code>
but it giving error like below:
Property 'completionBlock' with type '(@MainActor @Sendable () -> Void)?' cannot override a property with type '(@Sendable () -> Void)?'
Подробнее здесь: https://stackoverflow.com/questions/794 ... n-xcode-16
Мобильная версия