On Tue, 19 May 2015 09:14:38 +0200, Uli Kusterer said:

>> It's probably feasible for the compiler to warn if you declare a
>(copy) property of a type that conforms to NSMutableCopying, on the
>assumption that -copy returns an incompatible immutable copy. You should
>file a bug about that too.
>
> I don’t understand how that would work … ? NSString conforms to
>NSMutableCopying as well, as that’s how you get from an NSString to an
>NSMutableString. The only way I see to make this work is to codify the
>class naming convention and warn about that.

You could get 90% of the way today with a regex "property.*copy.*Mutable".  I 
found 2 instances in my codebase (both in .m files, not .h at least).  In both 
cases, they are probably bugs.

So I think a compiler/analyzer warning would be nice.
<rdar://21022397>

Cheers,

-- 
____________________________________________________________
Sean McBride, B. Eng                 [email protected]
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada

 _______________________________________________
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]

Reply via email to