Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -fsyntax-only -verify %s |
Steve Naroff | 9ad23d6 | 2008-06-04 14:43:54 +0000 | [diff] [blame] | 2 | typedef signed char BOOL; |
| 3 | typedef int NSInteger; |
| 4 | |
| 5 | @protocol NSObject |
| 6 | - (BOOL)isEqual:(id)object; |
| 7 | - (BOOL)respondsToSelector:(SEL)s; |
| 8 | @end |
| 9 | |
| 10 | @interface NSObject <NSObject> {} |
| 11 | @end |
| 12 | |
| 13 | @class NSString, NSData, NSMutableData, NSMutableDictionary, NSMutableArray; |
| 14 | |
| 15 | @protocol PBXCompletionItem |
| 16 | - (NSString *) name; |
| 17 | - (NSInteger)priority; |
| 18 | - setPriority:(NSInteger)p; |
| 19 | @end |
| 20 | |
| 21 | @implementation PBXCodeAssistant // expected-warning{{cannot find interface declaration for 'PBXCodeAssistant'}} |
| 22 | static NSMutableArray * recentCompletions = ((void *)0); |
| 23 | + (float) factorForRecentCompletion:(NSString *) completion |
| 24 | { |
| 25 | for (NSObject<PBXCompletionItem> * item in [self completionItems]) // expected-warning{{method '-completionItems' not found (return type defaults to 'id')}} |
| 26 | { |
| 27 | if ([item respondsToSelector:@selector(setPriority:)]) |
| 28 | { |
| 29 | [(id)item setPriority:[item priority] / [PBXCodeAssistant factorForRecentCompletion:[item name]]]; |
| 30 | } |
| 31 | } |
| 32 | } |
| 33 | @end |
| 34 | |