I'm doing some code refactoring but facing a problem that clang has no any warning for this situation:
@protocol CommonProtocol <NSObject>
- (void)common;
@end
=========
@interface Foo : NSObject <CommonProtocol>
- (void)foo;
@end
=========
@interface Bar : NSObject <CommonProtocol>
@end
=========
static id<CommonProtocol> getObject(void) {
return [Bar new];
}
Foo *casting = getObject(); /// ⚠️ there is no warning for this
[casting common];
[casting foo]; ///