No warning when user attempts to override an implicit strong reference

Originator:jay
Number:rdar://14216425 Date Originated:20-Jun-2013 11:22 AM
Status:Open Resolved:
Product:Developer Tools Product Version:
Classification: Reproducible:always
 
Summary:

When a user creates a property and declares it to have attributes (nonatomic, readonly, strong), but then redefines it in a category to have attributes (nonatomic, weak), Xcode helpfully displays a warning:

warning: property attribute in class extension does not match the primary class

However, if a property is declared with attributes (nonatomic, readonly) and redefined in a category as (nonatomic, weak), there is no such warning. Since the default storage mode is strong, the property is implicitly a strong reference.

In both cases, the resulting attribute, checked at runtime, is strong.

Steps to Reproduce:

Open the attached sample project. [available at http://tertiumquid.org/radar14216425/Strong%20References.zip]

Expected Results:

Xcode warnings on lines 13 and 14 of ReferenceTest.m, where defaultRefString and strongRefString are redeclared as weak.

Actual Results:

Xcode warning only on line 14.

Notes:

Tested with Xcode 4.6.3 (4H1503) and with 5.0 (5A11314m).

The sample project, when run, prints the attributes of the properties and shows that both defaultRefString and strongRefString are strong references.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!