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