1 // RUN: %clang_cc1 -Wmethod-signatures -fsyntax-only -verify -Wno-objc-root-class %s
2 // RUN: %clang_cc1 -x objective-c++ -Wmethod-signatures -fsyntax-only -verify -Wno-objc-root-class %s
8 - (void) test1:(A*) object; // expected-note {{previous definition is here}}
9 - (void) test2:(B*) object;
13 - (void) test1:(B*) object {} // expected-warning {{conflicting parameter types in implementation of 'test1:': 'A *' vs 'B *'}}
14 - (void) test2:(A*) object {}
18 - (void) test1:(id) object; // expected-note {{previous definition is here}}
19 - (void) test2:(A*) object;
23 - (void) test1:(A*) object {} // expected-warning {{conflicting parameter types in implementation of 'test1:': 'id' vs 'A *'}}
24 - (void) test2:(id) object {}
29 - (B*) test2; // expected-note {{previous definition is here}}
33 - (B*) test1 { return 0; }
34 - (A*) test2 { return 0; } // expected-warning {{conflicting return type in implementation of 'test2': 'B *' vs 'A *'}}
37 // The particular case of overriding with an id return is permitted.
43 - (A*) test1 { return 0; }
44 - (id) test2 { return 0; }
48 typedef long long int64_t;
50 @interface NSObject @end
53 @property (nonatomic,readonly,assign) int64_t sequenceNumber; // expected-note {{previous definition is here}}
58 @interface CKIMMessage : NSObject<CKMessage>
61 @implementation CKIMMessage
62 - (int32_t)sequenceNumber { // expected-warning {{conflicting return type in implementation of 'sequenceNumber': 'int64_t' (aka 'long long') vs 'int32_t' (aka 'int')}}
67 // Tests that property inherited indirectly from a nested protocol
68 // is seen by the method implementation type matching logic before
69 // method in super class is seen. This fixes the warning coming
70 // out of that method mismatch.
71 @interface NSObject (NSDict)
72 - (void)setValue:(id)value;
76 @protocol ProtocolWithValue
77 @property (nonatomic) unsigned value;
80 @protocol InterveningProtocol <ProtocolWithValue>
83 @interface UsesProtocolWithValue : NSObject <ProtocolWithValue>
86 @implementation UsesProtocolWithValue
87 @synthesize value=_value;
92 - (void) setValue:(unsigned)value
99 @interface UsesInterveningProtocol : NSObject <InterveningProtocol>
102 @implementation UsesInterveningProtocol
104 @synthesize value=_value;
109 - (void) setValue:(unsigned)value