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;
|
2011-08-28 05:55:47 +08:00
|
|
|
@property float anotherFloat; // expected-note 2 {{property declared}}
|
2009-01-20 02:16:19 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@interface MyObject { float anotherFloat; }
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface MyObject (CAT) <MyProtocol>
|
|
|
|
@end
|
|
|
|
|
2011-08-28 05:55:47 +08:00
|
|
|
@implementation MyObject (CAT) // expected-warning {{property 'anotherFloat' requires method}} \
|
|
|
|
// expected-warning {{property 'anotherFloat' requires method 'setAnotherFloat:'}}
|
2009-01-20 02:16:19 +08:00
|
|
|
@dynamic myFloat; // OK
|
|
|
|
@synthesize anotherFloat; // expected-error {{@synthesize not allowed in a category's implementation}}
|
|
|
|
@end
|