-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Description
Bugzilla Link | 3435 |
Resolution | FIXED |
Resolved on | Mar 12, 2010 00:57 |
Version | unspecified |
OS | MacOS X |
Reporter | LLVM Bugzilla Contributor |
CC | @tkremenek |
Extended Description
Constructs of the form:
@interface MyClass {
}
@property (nonatomic, readonly) BOOL virtualProperty;
@end
@implementation MyClass
@synthesize virtualProperty;
- (BOOL)virtualProperty {
return NO;
}
@end
trigger an error on the Static analyzer with the message:
error: synthesized property 'virtualProperty' must either be named the same as a compatible ivar or must explicitly name an ivar
Now I know that I should really be using @dynamic in this case, but the compiler accepts this on the grounds that (from the documentation) "You use the @synthesize keyword to tell the compiler that it should synthesize the setter and/or getter methods for the property if you do not supply them within the @implementation block."
Note that using @dynamic lets the parser go through the file without a hitch. I'll be switching to @dynamic in my code for these, but I still think that anything accepted by the compiler should also be by the analyzer.