Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify %s |
Steve Naroff | 8970fea | 2008-10-22 22:40:28 +0000 | [diff] [blame] | 2 | |
| 3 | typedef signed char BOOL; |
| 4 | typedef unsigned int NSUInteger; |
| 5 | typedef struct _NSZone NSZone; |
| 6 | @class NSInvocation, NSMethodSignature, NSCoder, NSString, NSEnumerator; |
| 7 | @protocol NSObject - (BOOL)isEqual:(id)object; @end |
Fariborz Jahanian | 61c8d3e | 2010-10-29 23:20:05 +0000 | [diff] [blame] | 8 | @protocol NSCopying - (id)copyWithZone:(NSZone *)zone; @end // expected-note {{method declared here}} |
Steve Naroff | 8970fea | 2008-10-22 22:40:28 +0000 | [diff] [blame] | 9 | @protocol NSMutableCopying - (id)mutableCopyWithZone:(NSZone *)zone; @end |
| 10 | @protocol NSCoding - (void)encodeWithCoder:(NSCoder *)aCoder; @end |
| 11 | @interface NSObject <NSObject> {} @end |
| 12 | typedef struct {} NSFastEnumerationState; |
| 13 | @protocol NSFastEnumeration - (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(id *)stackbuf count:(NSUInteger)len; @end |
| 14 | @interface NSDictionary : NSObject <NSCopying, NSMutableCopying, NSCoding, NSFastEnumeration> - (NSUInteger)count; @end |
| 15 | @interface NSMutableDictionary : NSDictionary - (void)removeObjectForKey:(id)aKey; @end |
| 16 | extern NSString * const NSTaskDidTerminateNotification; |
| 17 | |
Fariborz Jahanian | 8822f7c | 2010-03-27 19:02:17 +0000 | [diff] [blame] | 18 | @interface XCPropertyExpansionContext : NSObject <NSCopying> { // expected-note {{required for direct or indirect protocol 'NSCopying'}} |
Steve Naroff | 8970fea | 2008-10-22 22:40:28 +0000 | [diff] [blame] | 19 | NSMutableDictionary * _propNamesToPropValuesCache; |
| 20 | } @end |
| 21 | |
| 22 | @protocol XCPropertyValues <NSObject, NSCopying> |
| 23 | - (NSString *)evaluateAsStringInContext:(XCPropertyExpansionContext *)context withNestingState:(const void *)state; |
| 24 | @end |
| 25 | |
Fariborz Jahanian | 61c8d3e | 2010-10-29 23:20:05 +0000 | [diff] [blame] | 26 | @implementation XCPropertyExpansionContext // expected-warning {{incomplete implementation}} \ |
Richard Trieu | 2fe9b7f | 2011-12-15 00:38:15 +0000 | [diff] [blame] | 27 | // expected-warning {{method in protocol not implemented}} |
Steve Naroff | 8970fea | 2008-10-22 22:40:28 +0000 | [diff] [blame] | 28 | - (NSString *)expandedValueForProperty:(NSString *)property { |
| 29 | id <XCPropertyValues> cachedValueNode = [_propNamesToPropValuesCache objectForKey:property]; // expected-warning {{method '-objectForKey:' not found (return type defaults to 'id')}} |
Steve Naroff | a8069f1 | 2008-11-17 19:49:16 +0000 | [diff] [blame] | 30 | if (cachedValueNode == ((void *)0)) { } |
Steve Naroff | 8970fea | 2008-10-22 22:40:28 +0000 | [diff] [blame] | 31 | NSString * expandedValue = [cachedValueNode evaluateAsStringInContext:self withNestingState:((void *)0)]; |
| 32 | return expandedValue; |
| 33 | } |
Fariborz Jahanian | 63e963c | 2009-11-16 18:57:01 +0000 | [diff] [blame] | 34 | @end |