Patrick Beard | b2f6820 | 2012-04-06 18:12:22 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s |
Fariborz Jahanian | ae6f6fd | 2008-12-05 22:32:48 +0000 | [diff] [blame] | 2 | |
| 3 | @interface I { |
| 4 | int Y; |
| 5 | } |
| 6 | @property int X; |
| 7 | @property int Y; |
| 8 | @property int Z; |
| 9 | @end |
| 10 | |
| 11 | @implementation I |
| 12 | @dynamic X; // expected-note {{previous declaration is here}} |
| 13 | @dynamic X; // expected-error {{property 'X' is already implemented}} |
| 14 | @synthesize Y; // expected-note {{previous use is here}} |
Fariborz Jahanian | 59ed9e4 | 2012-09-24 22:00:36 +0000 | [diff] [blame] | 15 | @synthesize Z=Y; // expected-error {{synthesized properties 'Z' and 'Y' both claim instance variable 'Y'}} |
Fariborz Jahanian | ae6f6fd | 2008-12-05 22:32:48 +0000 | [diff] [blame] | 16 | @end |
Fariborz Jahanian | 74b2756 | 2010-12-03 23:37:08 +0000 | [diff] [blame] | 17 | |
| 18 | // rdar://8703553 |
| 19 | @interface IDEPathCell |
| 20 | { |
| 21 | @private |
| 22 | id _gradientStyle; |
| 23 | } |
| 24 | |
| 25 | @property (readwrite, assign, nonatomic) id gradientStyle; |
| 26 | @end |
| 27 | |
| 28 | @implementation IDEPathCell |
| 29 | |
| 30 | @synthesize gradientStyle = _gradientStyle; |
| 31 | - (void)setGradientStyle:(id)value { } |
| 32 | |
Anna Zaks | e61354b | 2012-07-27 19:07:44 +0000 | [diff] [blame] | 33 | + (id)_componentCellWithRepresentedObject { |
| 34 | return self.gradientStyle; |
Fariborz Jahanian | 74b2756 | 2010-12-03 23:37:08 +0000 | [diff] [blame] | 35 | } |
| 36 | @end |
Fariborz Jahanian | 9abf88c | 2012-05-15 22:37:04 +0000 | [diff] [blame] | 37 | |
Fariborz Jahanian | bdccce5 | 2012-05-29 19:59:25 +0000 | [diff] [blame] | 38 | // rdar://11054153 |
| 39 | @interface rdar11054153 |
Fariborz Jahanian | 9abf88c | 2012-05-15 22:37:04 +0000 | [diff] [blame] | 40 | @property int P; // expected-error {{type of property 'P' ('int') does not match type of accessor 'P' ('void')}} |
| 41 | - (void)P; // expected-note {{declared here}} |
| 42 | |
| 43 | @property int P1; // expected-warning {{type of property 'P1' does not match type of accessor 'P1'}} |
| 44 | - (double) P1; // expected-note {{declared here}} |
| 45 | |
| 46 | @property int P2; // expected-error {{type of property 'P2' ('int') does not match type of accessor 'P2' ('double *')}} |
| 47 | - (double*)P2; // expected-note {{declared here}} |
| 48 | |
| 49 | @end |