1 /* { dg-do run { target *-*-darwin* } } */
3 #include <objc/Object.h>
6 typedef struct MyWidget {
10 MyWidget gWidget = { 17 };
16 @interface Foo: Object
19 @interface Bar: Foo <MyProto>
22 @interface Container: Object
23 + (MyWidget *)elementForView:(Foo *)view;
30 - (MyWidget *)widget {
35 @implementation Container
36 + (MyWidget *)elementForView:(Foo *)view
38 MyWidget *widget = nil;
39 if ([view conformsTo:@protocol(MyProto)]) {
40 widget = [(Foo <MyProto> *)view widget];
48 MyWidget *w = [Container elementForView: view];