Fariborz Jahanian | 57c9934 | 2008-05-02 21:09:40 +0000 | [diff] [blame] | 1 | // RUN: clang -verify %s |
| 2 | |
| 3 | @protocol P1 @end |
| 4 | @protocol P2 @end |
| 5 | @protocol P3 @end |
| 6 | |
| 7 | @interface NSData @end |
| 8 | |
| 9 | @interface MutableNSData : NSData @end |
| 10 | |
| 11 | @interface Base : NSData <P1> |
| 12 | @property(readonly) id ref; |
| 13 | @property(readonly) Base *p_base; |
| 14 | @property(readonly) NSData *nsdata; |
| 15 | @property(readonly) NSData * m_nsdata; |
| 16 | @end |
| 17 | |
| 18 | @interface Data : Base <P1, P2> |
| 19 | @property(readonly) NSData *ref; // expected-warning {{property type 'NSData *' does not match property type inherited from 'Base'}} |
| 20 | @property(readonly) Data *p_base; // expected-warning {{property type 'Data *' does not match property type inherited from 'Base'}} |
| 21 | @property(readonly) MutableNSData * m_nsdata; // expected-warning {{property type 'MutableNSData *' does not match property type inherited from 'Base'}} |
| 22 | @end |
| 23 | |
| 24 | @interface MutedData: Data |
| 25 | @property(readonly) id p_base; // expected-warning {{property type 'id' does not match property type inherited from 'Data'}} |
| 26 | @end |
| 27 | |
| 28 | @interface ConstData : Data <P1, P2, P3> |
| 29 | @property(readonly) ConstData *p_base; // expected-warning {{property type 'ConstData *' does not match property type inherited from 'Data'}} |
| 30 | @end |
| 31 | |
Daniel Dunbar | 394d33f | 2008-08-26 07:16:44 +0000 | [diff] [blame] | 32 | void foo(Base *b, id x) { |
| 33 | [ b setRef: x ]; // expected-warning {{method '-setRef:' not found}} |
| 34 | } |