Fariborz Jahanian | 2514a30 | 2009-12-15 23:59:41 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %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; |
Fariborz Jahanian | 90c7126 | 2010-03-18 18:50:41 +0000 | [diff] [blame] | 18 | f.size.width = 2.2; // expected-error {{expression is not assignable using property assignment syntax}} |
| 19 | f.size.inner.dim = 200; // expected-error {{expression is not assignable using property assignment syntax}} |
Fariborz Jahanian | 2514a30 | 2009-12-15 23:59:41 +0000 | [diff] [blame] | 20 | } |
Fariborz Jahanian | e9ff443 | 2010-02-11 01:11:34 +0000 | [diff] [blame] | 21 | |
| 22 | // radar 7628953 |
| 23 | |
| 24 | @interface Gorf { |
| 25 | } |
| 26 | - (NSSize)size; |
| 27 | @end |
| 28 | |
| 29 | @implementation Gorf |
| 30 | - (void)MyView_sharedInit { |
Fariborz Jahanian | 90c7126 | 2010-03-18 18:50:41 +0000 | [diff] [blame] | 31 | self.size.width = 2.2; // expected-error {{expression is not assignable using property assignment syntax}} |
Fariborz Jahanian | e9ff443 | 2010-02-11 01:11:34 +0000 | [diff] [blame] | 32 | } |
| 33 | - (NSSize)size {} |
| 34 | @end |