It seems that when I create a generic class in Objective-C, like this:
#import <Foundation/Foundation.h>
#if __has_feature(objc_generics)
@interface CSEither<LeftType, RightType> : NSObject
- (nonnull instancetype)initWithLeftValue:(nonnull LeftType)left;
- (nonnull instancetype)initWithRightValue:(nonnull RightType)right;
@property (nullable, nonatomic, readonly, strong) LeftType left;
@property (nullable, nonatomic, readonly, strong) RightType right;
@end
#endifthe generated Swift interface ends up looking like this:
import Foundation
class CSEither : NSObject {
init(leftValue left: AnyObject)
init(rightValue right: AnyObject)
}i.e. all the generic type information is stripped out, as are all properties that use them.
Is this intended behavior, or am I doing something wrong?
Thanks!