1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
4 - (void) setMoo: (int) x; // expected-note {{previous definition is here}}
5 - (int) setMoo1: (int) x; // expected-note {{previous definition is here}}
6 - (int) setOk : (int) x : (double) d;
10 -(void) setMoo: (float) x {} // expected-warning {{conflicting parameter types in implementation of 'setMoo:': 'int' vs 'float'}}
11 - (char) setMoo1: (int) x { return 0; } // expected-warning {{conflicting return type in implementation of 'setMoo1:': 'int' vs 'char'}}
12 - (int) setOk : (int) x : (double) d { return 0; }
18 + (void) cMoo: (int) x; // expected-note 2 {{previous definition is here}}
22 +(float) cMoo: // expected-warning {{conflicting return type in implementation of 'cMoo:': 'void' vs 'float'}}
23 (float) x { return 0; } // expected-warning {{conflicting parameter types in implementation of 'cMoo:': 'int' vs 'float'}}
28 - (void) setCat: (int) x; // expected-note 2 {{previous definition is here}}
29 + (void) cCat: (int) x; // expected-note {{previous definition is here}}
32 @implementation A(CAT)
33 -(float) setCat: // expected-warning {{conflicting return type in implementation of 'setCat:': 'void' vs 'float'}}
34 (float) x { return 0; } // expected-warning {{conflicting parameter types in implementation of 'setCat:': 'int' vs 'float'}}
35 + (int) cCat: (int) x { return 0; } // expected-warning {{conflicting return type in implementation of 'cCat:': 'void' vs 'int'}}
38 // test that when implementation implements method in a category, types match.
39 @interface testObject {}
42 @interface testObject(Category)
43 - (float)returnCGFloat; // expected-note {{previous definition is here}}
46 @implementation testObject
47 - (double)returnCGFloat { // expected-warning {{conflicting return type in implementation of 'returnCGFloat': 'float' vs 'double'}}