1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
4 -(float) x; // expected-note {{declared here}}
5 @property int x; // expected-warning {{type of property 'x' does not match type of accessor 'x'}}
9 @property int moo; // expected-note {{previous definition is here}}
12 @implementation A (Cat)
16 -(void) setMoo: (float) x { // expected-warning {{conflicting parameter types in implementation of 'setMoo:': 'int' vs 'float'}}
22 typedef void (F)(void);
25 @property(assign) T p2; // expected-error {{property cannot have array or function type 'T'}}
27 @property(assign) F f2; // expected-error {{property cannot have array or function type 'F'}}
35 @property(nonatomic,readonly,retain) SSyncSet* syncSet;
38 @class SSyncSet_iDisk;
40 @interface SPeer_iDisk_remote1 : SPeer
41 - (SSyncSet_iDisk*) syncSet; // expected-note {{declared here}}
44 @interface SPeer_iDisk_local
45 - (SSyncSet_iDisk*) syncSet;
51 @interface SSyncSet_iDisk
52 @property(nonatomic,readonly,retain) SPeer_iDisk_local* localPeer;
55 @interface SPeer_iDisk_remote1 (protected)
58 @implementation SPeer_iDisk_remote1 (protected)
59 - (id) preferredSource1
61 return self.syncSet.localPeer; // expected-warning {{type of property 'syncSet' does not match type of accessor 'syncSet'}}
65 @interface NSArray @end
67 @interface NSMutableArray : NSArray
72 NSMutableArray* pieces;
76 @property (readonly) NSArray* pieces; // expected-warning {{type of property 'pieces' does not match type of accessor 'pieces'}}
77 @property (readonly) NSMutableArray* first;
79 - (NSMutableArray*) pieces; // expected-note 2 {{declared here}}
82 // Don't warn about setter-like methods for readonly properties.
83 - (void)setFirst:(char)val;
84 - (void)setPieces:(char)val;
94 @implementation Class2
98 return container.pieces; // expected-warning {{type of property 'pieces' does not match type of accessor 'pieces'}}
103 return container.first;