I am currently trying to compile OCMock with GCC4.2 (original: 4.0) and start getting the following warning:
warning: passing argument 1 of 'partialMockForObject:' from distinct Objective-C type
the calling method is:
- (void)forwardInvocationForRealObject:(NSInvocation *)anInvocation
{
// in here "self" is a reference to the real object, not the mock
OCPartialMockObject *mock = [OCPartialMockObject partialMockForObject:(id)self];
// ...
}
and the called method is:
+ (id)partialMockForObject:(NSObject *)anObject;
prefixing the argument with a cast to id fixes the problem. I thought all objects were subclass of NSObject and though the cast would be made implicit (super class substitution: a super class can always be replaced by any child class of it)