@protocol NSObject
@end
@protocol DTOutputStreams <NSObject>
@end
@interface DTFilterOutputStream <DTOutputStreams>
- nextOutputStream;
@end
@implementation DTFilterOutputStream
- (id)initWithNextOutputStream:(id <DTOutputStreams>) outputStream {
id <DTOutputStreams> nextOutputStream = [self nextOutputStream];
self = nextOutputStream;
return nextOutputStream ? nextOutputStream : self;
}
- nextOutputStream {
return self;
}
@end
@interface DTFilterOutputStream2
- nextOutputStream; @end
@implementation DTFilterOutputStream2 - (id)initWithNextOutputStream:(id <DTOutputStreams>) outputStream {
id <DTOutputStreams> nextOutputStream = [self nextOutputStream];
self = nextOutputStream; return nextOutputStream ? nextOutputStream : self; }
@end
@implementation DTFilterOutputStream3 - (id)initWithNextOutputStream:(id <DTOutputStreams>) outputStream {
id <DTOutputStreams> nextOutputStream = [self nextOutputStream]; self = nextOutputStream; return nextOutputStream ? nextOutputStream : self; }
@end
@protocol P0
@property int intProp;
@end
@protocol P1
@end
@protocol P2
@end
@protocol P3 <P1>
@end
@protocol P4 <P1>
@end
@interface A <P0>
@end
@interface B : A
@end
@interface C
@end
@interface D
@end
@interface E : A
@end
void f0(id<P0> x) {
x.intProp = 1;
}
void f1(int cond, id<P0> x, id<P0> y) {
(cond ? x : y).intProp = 1;
}
void f2(int cond, id<P0> x, A *y) {
(cond ? x : y).intProp = 1;
}
void f3(int cond, id<P0> x, B *y) {
(cond ? x : y).intProp = 1;
}
void f4(int cond, id x, B *y) {
(cond ? x : y).intProp = 1; }
void f5(int cond, id<P0> x, C *y) {
(cond ? x : y).intProp = 1; }
void f6(int cond, C *x, D *y) {
(cond ? x : y).intProp = 1; }
id f7(int a, id<P0> x, A* p) {
return a ? x : p;
}
int f8(int a, A<P0> *x, A *y) {
return [ (a ? x : y ) intProp ];
}
void f9(int a, A<P0> *x, A<P1> *y) {
id l0 = (a ? x : y ); A<P0> *l1 = (a ? x : y ); A<P1> *l2 = (a ? x : y ); (void)[ (a ? x : y ) intProp ]; }
void f10(int a, id<P0> x, id y) {
[ (a ? x : y ) intProp ];
}
void f11(int a, id<P0> x, id<P1> y) {
[ (a ? x : y ) intProp ]; }
void f12(int a, A<P0> *x, A<P1> *y) {
A<P1>* l0 = (a ? x : y ); }
void f13(int a, B<P3, P0> *x, E<P0, P4> *y) {
int *ip = a ? x : y; }