2012-04-07 02:12:22 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
|
2008-06-04 22:43:54 +08:00
|
|
|
typedef signed char BOOL;
|
|
|
|
typedef int NSInteger;
|
|
|
|
|
|
|
|
@protocol NSObject
|
|
|
|
- (BOOL)isEqual:(id)object;
|
|
|
|
- (BOOL)respondsToSelector:(SEL)s;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@interface NSObject <NSObject> {}
|
|
|
|
@end
|
|
|
|
|
|
|
|
@class NSString, NSData, NSMutableData, NSMutableDictionary, NSMutableArray;
|
|
|
|
|
|
|
|
@protocol PBXCompletionItem
|
|
|
|
- (NSString *) name;
|
|
|
|
- (NSInteger)priority;
|
|
|
|
- setPriority:(NSInteger)p;
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation PBXCodeAssistant // expected-warning{{cannot find interface declaration for 'PBXCodeAssistant'}}
|
|
|
|
static NSMutableArray * recentCompletions = ((void *)0);
|
|
|
|
+ (float) factorForRecentCompletion:(NSString *) completion
|
|
|
|
{
|
2010-12-01 09:07:24 +08:00
|
|
|
for (NSObject<PBXCompletionItem> * item in [self completionItems]) // expected-warning{{method '+completionItems' not found (return type defaults to 'id')}}
|
2008-06-04 22:43:54 +08:00
|
|
|
{
|
|
|
|
if ([item respondsToSelector:@selector(setPriority:)])
|
|
|
|
{
|
|
|
|
[(id)item setPriority:[item priority] / [PBXCodeAssistant factorForRecentCompletion:[item name]]];
|
|
|
|
}
|
|
|
|
}
|
2009-07-22 08:43:08 +08:00
|
|
|
return 0;
|
2008-06-04 22:43:54 +08:00
|
|
|
}
|
|
|
|
@end
|
|
|
|
|