1 // RUN: %clang_cc1 -fsyntax-only -verify -disable-objc-default-synthesize-properties %s
3 @interface NSObject @end
6 @property (readonly) id myString; // expected-note {{property}}
9 @protocol SubProtocol <TopProtocol>
12 @interface TopClass : NSObject <TopProtocol> {}
15 @interface SubClass : TopClass <SubProtocol> {}
18 @interface SubClass1 : TopClass {}
21 @implementation SubClass1 @end // Test1 - No Warning
23 @implementation TopClass // expected-warning {{property 'myString' requires method 'myString' to be defined}}
26 @implementation SubClass // Test3 - No Warning
29 @interface SubClass2 : TopClass<TopProtocol>
32 @implementation SubClass2 @end // Test 4 - No Warning
34 @interface SubClass3 : TopClass<SubProtocol> @end
35 @implementation SubClass3 @end // Test 5 - No Warning
37 @interface SubClass4 : SubClass3 @end
38 @implementation SubClass4 @end // Test 5 - No Warning
41 @property (readonly) id myNewString; // expected-note {{property}}
44 @interface SubClass5 : SubClass4 <NewProtocol> @end
45 @implementation SubClass5 @end // expected-warning {{property 'myNewString' requires method 'myNewString' to be defined}}
47 @protocol SuperProtocol
50 @interface Super <SuperProtocol>
53 @protocol ProtocolWithProperty <SuperProtocol>
54 @property (readonly, assign) id invalidationBacktrace; // expected-note {{property}}
57 @interface INTF : Super <ProtocolWithProperty>
60 @implementation INTF @end // expected-warning{{property 'invalidationBacktrace' requires method 'invalidationBacktrace' to be defined}}