| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 |
// expected-no-diagnostics |
| 3 |
|
| 4 |
@interface NSObject {} |
| 5 |
|
| 6 |
@end |
| 7 |
|
| 8 |
@interface MyClass : NSObject {} |
| 9 |
|
| 10 |
@end |
| 11 |
|
| 12 |
@interface MyClass (MyCategorie) |
| 13 |
|
| 14 |
@end |
| 15 |
|
| 16 |
@interface MySubClass : MyClass {} |
| 17 |
|
| 18 |
@end |
| 19 |
|
| 20 |
@interface MySubSubClass : MySubClass {} |
| 21 |
|
| 22 |
@end |
| 23 |
|
| 24 |
@implementation NSObject (NSObjectCategory) |
| 25 |
- (void)rootMethod {} |
| 26 |
@end |
| 27 |
|
| 28 |
@implementation MyClass |
| 29 |
|
| 30 |
+ (void)myClassMethod { } |
| 31 |
- (void)myMethod { } |
| 32 |
|
| 33 |
@end |
| 34 |
|
| 35 |
@implementation MyClass (MyCategorie) |
| 36 |
+ (void)myClassCategoryMethod { } |
| 37 |
- (void)categoryMethod {} |
| 38 |
@end |
| 39 |
|
| 40 |
@implementation MySubClass |
| 41 |
|
| 42 |
- (void)mySubMethod {} |
| 43 |
|
| 44 |
- (void)myTest { |
| 45 |
[self mySubMethod]; |
| 46 |
// should lookup method in superclass implementation if available |
| 47 |
[self myMethod]; |
| 48 |
[super myMethod]; |
| 49 |
|
| 50 |
[self categoryMethod]; |
| 51 |
[super categoryMethod]; |
| 52 |
|
| 53 |
// instance method of root class |
| 54 |
[MyClass rootMethod]; |
| 55 |
|
| 56 |
[MyClass myClassMethod]; |
| 57 |
[MySubClass myClassMethod]; |
| 58 |
|
| 59 |
[MyClass myClassCategoryMethod]; |
| 60 |
[MySubClass myClassCategoryMethod]; |
| 61 |
} |
| 62 |
|
| 63 |
@end |