1 // RUN: %clang_cc1 %s -fsyntax-only -verify
3 // <rdar://problem/6497242> Inherited overridden protocol declared objects don't work
5 @protocol NSObject @end
6 @interface NSObject @end
8 @protocol FooDelegate<NSObject>
13 @protocol BarDelegate<NSObject, FooDelegate>
18 @interface Foo : NSObject {
21 @property(nonatomic, assign) id<FooDelegate> delegate;
22 @property(nonatomic, assign) id<BarDelegate> delegate2;
24 @interface Bar : Foo {
26 @property(nonatomic, assign) id<BarDelegate> delegate;
27 @property(nonatomic, assign) id<FooDelegate> delegate2; // expected-warning{{property type 'id<FooDelegate>' is incompatible with type 'id<BarDelegate>' inherited from 'Foo'}}
30 @interface NSData @end
32 @interface NSMutableData : NSData @end
34 @interface Base : NSData
35 @property(assign) id ref;
36 @property(assign) Base *p_base;
37 @property(assign) NSMutableData *p_data;
40 @interface Data : Base
41 @property(assign) NSData *ref;
42 @property(assign) Data *p_base;
43 @property(assign) NSData *p_data; // expected-warning{{property type 'NSData *' is incompatible with type 'NSMutableData *' inherited from 'Base'}}