On May 19, 2015, at 2:59 AM, Mike Abdullah <[email protected]> wrote: > >> On 19 May 2015, at 01:56, Quincey Morris >> <[email protected] >> <mailto:[email protected]>> wrote: >> >> On May 18, 2015, at 16:35 , James Dovey <[email protected] >> <mailto:[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.) > > I’m not saying impossible, just very messy :-)
And given how rarely it’s ever a good idea to expose mutable instance variables as properties, almost certainly not worth the ugliness it would add to the language. Charles
_______________________________________________ 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]
