This repository was archived by the owner on May 28, 2025. It is now read-only.

Description
Using the latest pre-release 0.2.180221-dev-20180516000001 -[NSObject conformsToProtocol:] does not work.
To reproduce the issue the Protocol, the object that implements the Protocol, and the code that calls -[NSObject conformsToProtocol:] need to be in separate source files.
If all 3 are defined in the same source file then it works as expected.
For example:
TestProtocol.h
#import <Foundation/Foundation.h>
@protocol TestProtocol <NSObject>
@end
TestObject.h
#import <Foundation/Foundation.h>
#import "TestProtocol.h"
@interface TestObject : NSObject <TestProtocol>
@end
TestObject.m
#import "TestObject.h"
@implementation TestObject
@end
In some other source file...
TestObject *to = [[TestObject alloc] init];
if ([to conformsToProtocol:@protocol(TestProtocol)]) {
NSLog(@"YES");
} else {
NSLog(@"NO");
}
This will result in conformsToProtocol: to return FALSE and printing NO.