mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
of adding a property. This better matches what the actual implementation expects, and it avoids some possibilities of weird mismatches. However, it also requires special-case initialization, destruction, and dynamic-layout support, none of which I've added yet. In order to get NSObject default actor subclasses to use Swift refcounting (and thus avoid the need for the default actor runtime to generally use ObjC refcounting), I've had to introduce a SwiftNativeNSObject which we substitute as the superclass when inheriting directly from NSObject. This is something we could do in all NSObject subclasses; for now, I'm just doing it in actors, although it's all actors and not just default actors. We are not yet taking advantage of our special knowledge of this class anywhere except the reference-counting code. I went around in circles exploring a number of alternatives for doing this; at one point I basically had a completely parallel "ForImplementation" superclass query. That proved to be a lot of added complexity and created more problems than it solved. We also don't *really* get any benefit from this subclassing because there still wouldn't be a consistent superclass for all actors. So instead it's very ad-hoc.
2.0 KiB
2.0 KiB