Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %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}} |
| 15 | @synthesize Z=Y; // expected-error {{synthesized properties 'Z' and 'Y' both claim ivar 'Y'}} |
| 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 | |
| 33 | + (void)_componentCellWithRepresentedObject { |
| 34 | self.gradientStyle; // expected-error {{property 'gradientStyle' not found on object of type 'Class'}} |
| 35 | } |
| 36 | @end |