blob: 673dc25aa8120dc6254c0c9f978c61eda42f6593 [file] [log] [blame]
Fariborz Jahanianb7611f22008-11-22 18:40:47 +00001// RUN: clang -fsyntax-only -verify %s
2
3@interface A
4 -(int) x;
5@property (readonly) int x;
6@property int ok;
7@end
8
Fariborz Jahanianba8d2d62008-11-22 20:25:50 +00009@interface B
10 -(void) setOk:(int)arg;
11 -(int) x;
12 -(int) ok;
13@end
14
15void f0(A *a, B* b) {
Fariborz Jahanianb7611f22008-11-22 18:40:47 +000016 a.x = 10; // expected-error {{assigning to property with 'readonly' attribute not allowed}}
17 a.ok = 20;
Fariborz Jahanianba8d2d62008-11-22 20:25:50 +000018 b.x = 10; // expected-error {{setter method is needed to assign to object using property assignment syntax}}
19 b.ok = 20;
Fariborz Jahanianb7611f22008-11-22 18:40:47 +000020}
21