On May 18, 2015, at 16:35 , James Dovey <[email protected]> wrote: > > frequently the point of using a copying property setter is to ensure you get > an immutable instance from a mutable one
In that case, the property type would be expected to be declared as NSDictionary, not NSMutableDictionary. As I tried to say before, there’s a problem beyond the mutability of the result — the result actually has the wrong class (NSDictionary for a property declared as NSMutableDictionary). > the ObjC runtime isn’t necessarily going to record all the details of the > property’s type beyond ‘id’, If the copy message is sent from within a function within the run-time, then there would need to be two run-time functions that do copying, with the choice of which to use being made at compile time. But I’m not proposing this change, just commenting that it does’t seem as impossible as Mike thought. (Unless it is.) > That’s also assuming that there’s any sort of heuristic that can be applied > to determine whether any given object is mutable or immutable, including > those created by third parties. Again as I said before, it’s the class of the property that would matter, not the class of the value/instance.
_______________________________________________ Do not post admin requests to the list. They will be ignored. Objc-language mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/objc-language/archive%40mail-archive.com This email sent to [email protected]
