#import <Foundation/Foundation.h>

@interface NSObject (NilMsgCheck)
- (NSSize) nmcZeroSize;
- (void) nmcSendNilMsg;
@end

@implementation NSObject (NilMsgCheck)

- (NSSize) nmcZeroSize
{
    return NSZeroSize;
}

- (void) nmcSendNilMsg
{
    NSSize size;

    size = [self nmcZeroSize];
    NSLog(@"[self nmcZeroSize] returned: %@", NSStringFromSize(size));

    size = [(NSObject *) nil nmcZeroSize];
    NSLog(@"[nil nmcZeroSize] returned: %@", NSStringFromSize(size));
}

@end

int main(void)
{
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    NSObject *object = [[[NSObject alloc] init] autorelease];

    [object nmcSendNilMsg];

    [pool release];
    return 0;
}

