| 1 | // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s |
| 2 | |
| 3 | typedef struct NSSize { |
| 4 | int width; |
| 5 | struct { |
| 6 | int dim; |
| 7 | } inner; |
| 8 | } NSSize; |
| 9 | |
| 10 | @interface Foo { |
| 11 | NSSize _size; |
| 12 | } |
| 13 | @property NSSize size; |
| 14 | @end |
| 15 | |
| 16 | void foo() { |
| 17 | Foo *f; |
| 18 | f.size.width = 2.2; // expected-error {{expression is not assignable}} |
| 19 | f.size.inner.dim = 200; // expected-error {{expression is not assignable}} |
| 20 | } |
| 21 | |
| 22 | // radar 7628953 |
| 23 | |
| 24 | @interface Gorf { |
| 25 | } |
| 26 | - (NSSize)size; |
| 27 | @end |
| 28 | |
| 29 | @implementation Gorf |
| 30 | - (void)MyView_sharedInit { |
| 31 | self.size.width = 2.2; // expected-error {{expression is not assignable}} |
| 32 | } |
| 33 | - (NSSize)size {} |
| 34 | @end |
| 35 | |