2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
2009-01-20 02:16:19 +08:00
|
|
|
// Test that a property can be synthesize in a category
|
|
|
|
// implementation with no error.
|
|
|
|
|
|
|
|
@protocol MyProtocol
|
|
|
|
@property float myFloat;
|
2010-01-21 03:36:21 +08:00
|
|
|
@property float anotherFloat; // expected-warning {{property 'anotherFloat' requires method 'anotherFloat' to be defined - use @dynamic}} \
|
|
|
|
// expected-warning {{property 'anotherFloat' requires method 'setAnotherFloat:' to be defined }}
|
2009-01-20 02:16:19 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface MyObject { float anotherFloat; }
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface MyObject (CAT) <MyProtocol>
|
|
|
|
@end
|
|
|
|
|
2010-01-21 03:36:21 +08:00
|
|
|
@implementation MyObject (CAT) // expected-note 2 {{implementation is here}}
|
2009-01-20 02:16:19 +08:00
|
|
|
@dynamic myFloat; // OK
|
|
|
|
@synthesize anotherFloat; // expected-error {{@synthesize not allowed in a category's implementation}}
|
|
|
|
@end
|