blob: 583acb065622b31ab871eeabde25ffd0f43f4681 [file] [log] [blame]
Steve Naroff289d9f22008-06-01 02:43:50 +00001// RUN: clang -pedantic -fsyntax-only -verify %s
2typedef signed char BOOL;
3
4@class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator;
5
6@protocol NSObject
7- (BOOL)isEqual:(id)object;
8@end
9
10@protocol NSCoding
11- (void)encodeWithCoder:(NSCoder *)aCoder;
12@end
13
14@interface NSObject <NSObject> {}
15@end
16
17typedef float CGFloat;
18
19@interface NSResponder : NSObject <NSCoding> {}
20@end
21
22@protocol XCSelectionSource;
23
24@interface XCSelection : NSResponder {}
25- (NSObject <XCSelectionSource> *) source;
26@end
27
28extern NSString * const XCActiveSelectionLevel;
29
30@interface XCActionManager : NSResponder {}
31+defaultActionManager;
32-selectionAtLevel:(NSString *const)s;
33@end
34
35@implementation XDMenuItemsManager // expected-warning {{cannot find interface declaration for 'XDMenuItemsManager'}}
36+ (void)initialize {
37 id<XCSelectionSource, NSObject> source =
38 [[[XCActionManager defaultActionManager] selectionAtLevel:XCActiveSelectionLevel] source];
39}
40@end
Steve Naroff39579072008-10-14 22:18:38 +000041
42@protocol NSTextStorageDelegate;
43@class NSNotification;
44
45@interface NSTextStorage : NSObject
46
47- (void)setDelegate:(id <NSTextStorageDelegate>)delegate;
48- (id <NSTextStorageDelegate>)delegate;
49
50@end
51
52@protocol NSTextStorageDelegate <NSObject>
53@optional
54
55- (void)textStorageWillProcessEditing:(NSNotification *)notification;
56- (void)textStorageDidProcessEditing:(NSNotification *)notification;
57
58@end
59
60@interface SKTText : NSObject {
61 @private
62
63
64 NSTextStorage *_contents;
65}
66@end
67
68@implementation SKTText
69
70
71- (NSTextStorage *)contents {
72 [_contents setDelegate:self]; // expected-warning {{incompatible type sending 'SKTText *', expected 'id<NSTextStorageDelegate>'}}
73}
74
75@end