Fariborz Jahanian | 2129212 | 2009-01-10 18:43:55 +0000 | [diff] [blame^] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | @interface I0 |
| 4 | @property(readonly) int x; |
| 5 | @property(readonly) int y; |
| 6 | @property(readonly) int z; |
| 7 | -(void) setY: (int) y0; |
| 8 | @end |
| 9 | |
| 10 | @interface I0 (Cat0) |
| 11 | -(void) setX: (int) a0; |
| 12 | @end |
| 13 | |
| 14 | @implementation I0 |
| 15 | @dynamic x; |
| 16 | @dynamic y; |
| 17 | @dynamic z; |
| 18 | -(void) setY: (int) y0{} |
| 19 | |
| 20 | -(void) im0 { |
| 21 | self.x = 0; |
| 22 | self.y = 2; |
| 23 | self.z = 2; // expected-error {{assigning to property with 'readonly' attribute not allowed}} |
| 24 | } |
| 25 | @end |