| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 |
// Test that a property can be synthesize in a category |
| 3 |
// implementation with no error. |
| 4 |
|
| 5 |
@protocol MyProtocol |
| 6 |
@property float myFloat; |
| 7 |
@property float anotherFloat; // expected-note 2 {{property declared}} |
| 8 |
@end |
| 9 |
|
| 10 |
@interface MyObject { float anotherFloat; } |
| 11 |
@end |
| 12 |
|
| 13 |
@interface MyObject (CAT) <MyProtocol> |
| 14 |
@end |
| 15 |
|
| 16 |
@implementation MyObject (CAT) // expected-warning {{property 'anotherFloat' requires method}} \ |
| 17 |
// expected-warning {{property 'anotherFloat' requires method 'setAnotherFloat:'}} |
| 18 |
@dynamic myFloat; // OK |
| 19 |
@synthesize anotherFloat; // expected-error {{@synthesize not allowed in a category's implementation}} |
| 20 |
@end |