1 // RUN: %clang_cc1 -fsyntax-only -verify %s
7 @interface ReadOnly : Object
12 @property(readonly) int object;
13 @property(readonly) int Anotherobject;
16 @interface ReadOnly ()
17 @property(readwrite) int object;
18 @property(readwrite, setter = myAnotherobjectSetter:) int Anotherobject;
21 @implementation ReadOnly
22 @synthesize object = _object;
23 @synthesize Anotherobject = _Anotherobject;
24 - (void) myAnotherobjectSetter : (int)val {
27 - (int) Anotherobject { return _Anotherobject; }
30 int main(int argc, char **argv) {
31 ReadOnly *test = [ReadOnly new];
33 test.Anotherobject = 200;
34 return test.object - 12345 + test.Anotherobject - 200;
40 @property(readonly) int p0; // expected-warning {{property 'p0' requires method 'p0' to be defined}}
49 @implementation I0 // expected-note {{implementation is here}}
51 self.p0 = 0; // expected-error {{assigning to property with 'readonly' attribute not allowed}}