Steve Naroff | aa73eec | 2008-05-31 22:33:45 +0000 | [diff] [blame^] | 1 | // RUN: clang -fsyntax-only -verify -pedantic %s |
| 2 | @protocol NSObject |
| 3 | @end |
| 4 | |
| 5 | @protocol DTOutputStreams <NSObject> |
| 6 | @end |
| 7 | |
| 8 | @interface DTFilterOutputStream <DTOutputStreams> |
| 9 | - nextOutputStream; |
| 10 | @end |
| 11 | |
| 12 | @implementation DTFilterOutputStream |
| 13 | - (id)initWithNextOutputStream:(id <DTOutputStreams>) outputStream { |
| 14 | id <DTOutputStreams> nextOutputStream = [self nextOutputStream]; |
| 15 | self = nextOutputStream; |
| 16 | return nextOutputStream ? nextOutputStream : self; |
| 17 | } |
| 18 | - nextOutputStream { |
| 19 | return self; |
| 20 | } |
| 21 | @end |