Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Fariborz Jahanian | b16308f | 2008-11-26 20:33:54 +0000 | [diff] [blame] | 2 | |
| 3 | @interface ReadOnly |
| 4 | { |
| 5 | id _object; |
| 6 | id _object1; |
| 7 | } |
Fariborz Jahanian | 567c8df | 2008-12-06 01:12:43 +0000 | [diff] [blame] | 8 | @property(readonly) id object; |
Fariborz Jahanian | a6f14e1 | 2009-11-02 22:45:15 +0000 | [diff] [blame^] | 9 | @property(readwrite, assign) id object1; // expected-note {{property declared here}} |
Fariborz Jahanian | b16308f | 2008-11-26 20:33:54 +0000 | [diff] [blame] | 10 | @end |
| 11 | |
| 12 | @interface ReadOnly () |
Fariborz Jahanian | 9bfb2a2 | 2008-12-08 18:47:29 +0000 | [diff] [blame] | 13 | @property(readwrite, copy) id object; |
Fariborz Jahanian | a6f14e1 | 2009-11-02 22:45:15 +0000 | [diff] [blame^] | 14 | @property(readonly) id object1; // expected-error {{property declaration in continuation class of 'ReadOnly' is to change a 'readonly' property to 'readwrite'}} |
Fariborz Jahanian | b16308f | 2008-11-26 20:33:54 +0000 | [diff] [blame] | 15 | @end |
Fariborz Jahanian | a6f14e1 | 2009-11-02 22:45:15 +0000 | [diff] [blame^] | 16 | |
| 17 | @protocol Proto |
| 18 | @property (copy) id fee; // expected-note {{property declared here}} |
| 19 | @end |
| 20 | |
| 21 | @protocol Foo<Proto> |
| 22 | @property (copy) id foo; // expected-note {{property declared here}} |
| 23 | @end |
| 24 | |
| 25 | @interface Bar <Foo> { |
| 26 | id _foo; |
| 27 | id _fee; |
| 28 | } |
| 29 | @end |
| 30 | |
| 31 | @interface Bar () |
| 32 | @property (copy) id foo; // expected-error {{property declaration in continuation class of 'Bar' is to change a 'readonly' property to 'readwrite'}} |
| 33 | @property (copy) id fee; // expected-error {{property declaration in continuation class of 'Bar' is to change a 'readonly' property to 'readwrite'}} |
| 34 | @end |
| 35 | |
| 36 | @implementation Bar |
| 37 | @synthesize foo = _foo; |
| 38 | @synthesize fee = _fee; |
| 39 | @end |
| 40 | |