blob: 35f4e75314bd196f0e434ad5d07fb8610aaa57c9 [file] [log] [blame]
Fariborz Jahanianb1071432011-04-18 21:16:59 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
Andy Gibbsc6e68da2012-10-19 12:44:48 +00002// expected-no-diagnostics
Fariborz Jahanianb1071432011-04-18 21:16:59 +00003
Douglas Gregorc5e07f52015-07-07 03:58:01 +00004// rdar://9296866
Fariborz Jahanianb1071432011-04-18 21:16:59 +00005@interface NSResponder
6@end
7
8
9@interface NSView : NSResponder
10@end
11
12@interface WebView : NSView
13@end
14
15@protocol WebDocumentView
16@end
17
18@implementation NSView
19
20- (void) FUNC : (id)s {
21 WebView *m_webView;
22 NSView <WebDocumentView> *documentView;
23 NSView *coordinateView = s ? documentView : m_webView;
24}
25@end
26
Douglas Gregorc5e07f52015-07-07 03:58:01 +000027// rdar://problem/19572837
28@protocol NSObject
29@end
30
31__attribute__((objc_root_class))
32@interface NSObject <NSObject>
33@end
34
35@protocol Goable <NSObject>
36- (void)go;
37@end
38
39@protocol Drivable <Goable>
40- (void)drive;
41@end
42
43@interface Car : NSObject
44- (NSObject <Goable> *)bestGoable:(NSObject <Goable> *)drivable;
45@end
46
47@interface Car(Category) <Drivable>
48@end
49
50@interface Truck : Car
51@end
52
53@implementation Truck
54- (NSObject <Goable> *)bestGoable:(NSObject <Goable> *)drivable value:(int)value{
55 return value > 0 ? self : drivable;
56}
57@end