diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/SemaObjC/property-category-4.m | 69 | ||||
-rw-r--r-- | test/SemaObjC/property.m | 5 |
2 files changed, 71 insertions, 3 deletions
diff --git a/test/SemaObjC/property-category-4.m b/test/SemaObjC/property-category-4.m index e7939b32c1..f99bd52998 100644 --- a/test/SemaObjC/property-category-4.m +++ b/test/SemaObjC/property-category-4.m @@ -16,3 +16,72 @@ @dynamic d_selectedObjects; // expected-error {{property declared in category 'CAT' cannot be implemented in class implementation}} @end + +// rdar://13713098 +// Test1 +@interface NSArray +- (int)count; +@end + +@protocol MyCountable +@property (readonly) int count; +@end + + +@interface NSArray(Additions) <MyCountable> +@end + +@implementation NSArray(Additions) +@end + +// Test2 +@protocol NSProtocol +- (int)count; +@end + +@interface NSArray1 <NSProtocol> +@end + +@interface NSArray1(Additions) <MyCountable> +@end + +@implementation NSArray1(Additions) +@end + +// Test3 +@interface Super <NSProtocol> +@end + +@interface NSArray2 : Super @end + +@interface NSArray2(Additions) <MyCountable> +@end + +@implementation NSArray2(Additions) +@end + +// Test3 +@interface Super1 <NSProtocol> +@property (readonly) int count; +@end + +@protocol MyCountable1 +@end + +@interface NSArray3 : Super1 <MyCountable1> +@end + +@implementation NSArray3 +@end + +// Test4 +@interface I +@property int d1; +@end + +@interface I(CAT) +@property int d1; +@end + +@implementation I(CAT) +@end diff --git a/test/SemaObjC/property.m b/test/SemaObjC/property.m index 76fdf5b242..7485447173 100644 --- a/test/SemaObjC/property.m +++ b/test/SemaObjC/property.m @@ -11,7 +11,7 @@ @end @interface I(CAT) -@property int d1; // expected-note 2 {{property declared here}} +@property int d1; @end @implementation I @@ -22,8 +22,7 @@ @synthesize name; // OK! property with same name as an accessible ivar of same name @end -@implementation I(CAT) // expected-warning {{property 'd1' requires method 'd1' to be defined }} \ - // expected-warning {{property 'd1' requires method 'setD1:' to be defined }} +@implementation I(CAT) @synthesize d1; // expected-error {{@synthesize not allowed in a category's implementation}} @dynamic bad; // expected-error {{property implementation must have its declaration in the category 'CAT'}} @end |