Xcode-6.3-Beta (6D520o): Incorrect -Wunused-getter-return-value warning
| Originator: | segiddins | ||
| Number: | rdar://19773512 | Date Originated: | 09-Feb-2015 03:47 PM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode-6.3-Beta (6D520o) |
| Classification: | Other Bug | Reproducible: | Always |
Summary:
When calling a method that is also the declared getter for a property, the unused-getter-return-value warning is given when the return value of that method call are unused.
Steps to Reproduce:
@interface Model
@property (nonatomic, readonly, getter=getOrCreateGroup) id group;
@end
@implementation Model {
id _group;
}
- (void)method {
[self getOrCreateGroup];
}
- (id)getOrCreateGroup {
if (!_group) {
_group = @"group"; // Perform potentially mutating method
}
return _group;
}
@end
Expected Results:
There should be no warning on `[self getOrCreateGroup]` since it is a method call, not accessing the property through dot syntax.
Actual Results:
An unused-getter-return-value warning is given.
Regression:
This warning is not given in Xcode 6.2 Beta and before, is given in 6.3 Beta 1.
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!