'Sendable' class 'ABC' cannot inherit from another class other than 'NSObject'

I got this error in a package which compiled perfectly up to recently.

There is a public inner class in it that inherit form an open master class in an other package. Sure, if I cut the inheritance the problem is also cut off.

Someone would have and idea on it?
Thanks in advance

Does anybody have an idea about this issue. I have found a bug report (#2146) that reported a similar problem.

As per Apple Developer Documentation:

To satisfy the requirements of the Sendable protocol, a class must [...] have no superclass or have NSObject as the superclass.


Classes that don’t meet the requirements above can be marked as @unchecked Sendable, disabling compile-time correctness checks, after you manually verify that they satisfy the Sendable protocol’s semantic requirements.

1 Like

Thanks a lot. Very helpful.

For the sake of posterity, I just want to re-emphasize this part of the passage that @aley quoted:

@unchecked Sendable should not be used as an easy 'escape hatch' for satisfying the compiler. You should be very sure that the base class does not violate Sendable semantics before doing this (and the same for your subclass, since you'll lose compiler checking on any new functionality you introduce by using @unchecked).

1 Like