blob: 0b6da4a77ba402cfd936a6b1a8327a84758c8ebc [file] [log] [blame]
Fariborz Jahaniana78eca22012-03-28 17:56:49 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2// rdar://11062080
3
4@interface NSNumber
5+ (NSNumber *)numberWithChar:(char)value;
6+ (NSNumber *)numberWithInt:(int)value;
7@end
8
9@protocol NSCopying @end
10typedef unsigned long NSUInteger;
11typedef long NSInteger;
12
13@interface NSDictionary
14+ (id)dictionaryWithObjects:(const id [])objects forKeys:(const id <NSCopying> [])keys count:(NSUInteger)cnt;
15- (void)setObject:(id)object forKeyedSubscript:(id)key;
16@end
17
18@interface NSString<NSCopying>
19@end
20
21@interface NSArray
22- (id)objectAtIndexedSubscript:(NSInteger)index;
23- (void)setObject:(id)object atIndexedSubscript:(NSInteger)index;
24@end
25
26int main() {
27 NSDictionary *dict = @{ @"name":@666 };
28 dict[@"name"] = @666;
29
Jordan Roseb13291a2012-07-19 18:10:18 +000030 dict["name"] = @666; // expected-error {{indexing expression is invalid because subscript type 'char *' is not an Objective-C pointer}}
Fariborz Jahaniana78eca22012-03-28 17:56:49 +000031
32 return 0;
33}
34