| 1 |
// RUN: %clang_cc1 -fsyntax-only -verify %s |
| 2 |
// expected-no-diagnostics |
| 3 |
|
| 4 |
@interface NSResponder |
| 5 |
@end |
| 6 |
|
| 7 |
|
| 8 |
@interface NSView : NSResponder |
| 9 |
@end |
| 10 |
|
| 11 |
@interface WebView : NSView |
| 12 |
@end |
| 13 |
|
| 14 |
@protocol WebDocumentView |
| 15 |
@end |
| 16 |
|
| 17 |
@implementation NSView |
| 18 |
|
| 19 |
- (void) FUNC : (id)s { |
| 20 |
WebView *m_webView; |
| 21 |
NSView <WebDocumentView> *documentView; |
| 22 |
NSView *coordinateView = s ? documentView : m_webView; |
| 23 |
} |
| 24 |
@end |
| 25 |
|
| 26 |
@protocol NSObject |
| 27 |
@end |
| 28 |
|
| 29 |
__attribute__((objc_root_class)) |
| 30 |
@interface NSObject <NSObject> |
| 31 |
@end |
| 32 |
|
| 33 |
@protocol Goable <NSObject> |
| 34 |
- (void)go; |
| 35 |
@end |
| 36 |
|
| 37 |
@protocol Drivable <Goable> |
| 38 |
- (void)drive; |
| 39 |
@end |
| 40 |
|
| 41 |
@interface Car : NSObject |
| 42 |
- (NSObject <Goable> *)bestGoable:(NSObject <Goable> *)drivable; |
| 43 |
@end |
| 44 |
|
| 45 |
@interface Car(Category) <Drivable> |
| 46 |
@end |
| 47 |
|
| 48 |
@interface Truck : Car |
| 49 |
@end |
| 50 |
|
| 51 |
@implementation Truck |
| 52 |
- (NSObject <Goable> *)bestGoable:(NSObject <Goable> *)drivable value:(int)value{ |
| 53 |
return value > 0 ? self : drivable; |
| 54 |
} |
| 55 |
@end |