• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// 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
30        dict["name"] = @666; // expected-error {{indexing expression is invalid because subscript type 'char *' is not an objective-C pointer}}
31
32	return 0;
33}
34
35