1*67e74705SXin Li// RUN: %clang_cc1 -fsyntax-only -verify %s 2*67e74705SXin Li// rdar://10904488 3*67e74705SXin Li 4*67e74705SXin Li@interface Test 5*67e74705SXin Li- (int)objectAtIndexedSubscript:(int)index; // expected-note {{method 'objectAtIndexedSubscript:' declared here}} 6*67e74705SXin Li- (void)setObject:(int)object atIndexedSubscript:(int)index; // expected-note {{parameter of type 'int' is declared here}} 7*67e74705SXin Li@end 8*67e74705SXin Li 9*67e74705SXin Li@interface NSMutableDictionary 10*67e74705SXin Li- (int)objectForKeyedSubscript:(id)key; // expected-note {{method 'objectForKeyedSubscript:' declared here}} 11*67e74705SXin Li- (void)setObject:(int)object forKeyedSubscript:(id)key; // expected-note {{parameter of type 'int' is declared here}} 12*67e74705SXin Li@end 13*67e74705SXin Li 14*67e74705SXin Liint main() { 15*67e74705SXin Li Test *array; 16*67e74705SXin Li int i = array[10]; // expected-error {{method for accessing array element must have Objective-C object return type instead of 'int'}} 17*67e74705SXin Li array[2] = i; // expected-error {{cannot assign to this array because assigning method's 2nd parameter of type 'int' is not an Objective-C pointer type}} 18*67e74705SXin Li 19*67e74705SXin Li NSMutableDictionary *dict; 20*67e74705SXin Li id key, val; 21*67e74705SXin Li val = dict[key]; // expected-error {{method for accessing dictionary element must have Objective-C object return type instead of 'int'}} \ 22*67e74705SXin Li // expected-warning {{incompatible integer to pointer conversion assigning to 'id' from 'int'}} 23*67e74705SXin Li dict[key] = val; // expected-error {{method object parameter type 'int' is not object type}} 24*67e74705SXin Li} 25*67e74705SXin Li 26