| 1 | #import <Foundation/Foundation.h> |
| 2 | |
| 3 | @interface MyClass : NSObject { |
| 4 | }; |
| 5 | -(void)test; |
| 6 | @end |
| 7 | |
| 8 | @implementation MyClass |
| 9 | -(void)test { |
| 10 | printf("%p\n" , self); // break here |
| 11 | } |
| 12 | @end |
| 13 | |
| 14 | @interface MyOwner : NSObject { |
| 15 | @public id ownedThing; // should be id, to test <rdar://problem/31363513> |
| 16 | }; |
| 17 | @end |
| 18 | |
| 19 | @implementation MyOwner |
| 20 | @end |
| 21 | |
| 22 | int main (int argc, char const *argv[]) { |
| 23 | @autoreleasepool { |
| 24 | MyOwner *owner = [[MyOwner alloc] init]; |
| 25 | owner->ownedThing = [[MyClass alloc] init]; |
| 26 | [(MyClass*)owner->ownedThing test]; |
| 27 | } |
| 28 | return 0; |
| 29 | } |
| 30 | |
| 31 | |