#import #include #define _CF_TYPED_ENUM __attribute__((swift_wrapper(enum))) #define NS_STRING_ENUM _CF_TYPED_ENUM #define NS_SWIFT_NAME(Name) __attribute__((swift_name(#Name))) typedef NSString * GenericOption NS_STRING_ENUM; GenericOption const GenericOptionMultithreaded NS_SWIFT_NAME(multithreaded); @interface GenericClass : NSObject - (id)initWithThing:(T)thing; - (id)initWithArrayOfThings:(NSArray *_Nonnull)things; - (id)initWithOptions:(nullable NSDictionary *)options; - (void)dealloc; - (_Nullable T)thing; - (int)count; + (_Nullable T)classThing; - (_Nonnull NSArray *)arrayOfThings; - (void)setArrayOfThings:(NSArray *_Nonnull)things; - (T _Nonnull)objectAtIndexedSubscript:(uint16_t)i; - (void)setObject:(T _Nonnull)object atIndexedSubscript:(uint16_t)i; - (void)performBlockOnThings:(T _Nonnull (^_Nonnull)(T _Nonnull))block; - (T _Nonnull (^_Nonnull)(T _Nonnull))blockForPerformingOnThings; @property(nonatomic) _Nullable T propertyThing; @property(nonatomic) _Nullable NSArray *propertyArrayOfThings; @end @interface GenericClass(Private) - (_Nullable T)otherThing; + (_Nullable T)otherClassThing; @end void takeGenericClass(_Nullable GenericClass *thing); @interface GenericSubclass : GenericClass @end @protocol Pettable - (nonnull instancetype)initWithFur:(nonnull id)fur; - (nonnull instancetype)other; + (nonnull instancetype)adopt; - (void)pet; - (void)petWith:(nonnull id )other; @property (nonatomic, class) _Nonnull id needingMostPets; @end @interface Animal : NSObject - (nonnull instancetype)initWithNoise:(nonnull id)noise; - (nonnull instancetype)another; + (nonnull instancetype)create; - (void)eat:(Animal*)prey; @property (nonatomic, readonly) Animal *_Nonnull buddy; @property (nonatomic, class) Animal *_Nonnull apexPredator; - (Animal *_Nonnull)objectAtIndexedSubscript:(NSInteger)i; - (void)setObject:(Animal *_Nonnull)x atIndexedSubscript:(NSInteger)i; @end @interface PettableOverextendedMetaphor: NSObject @end @protocol Fungible @end @interface FungibleContainer> : NSObject @end @interface PettableContainer> : NSObject @end @interface AnimalContainer : NSObject @end @interface PettableAnimalContainer *> : NSObject @end @interface FungibleAnimalContainer *> : NSObject @end @interface TestConstrainedTypeParam : NSObject - (void)doThing:(_Nonnull T)thing; @end typedef id FungibleObject; @interface Panda // Unqualified reference to generic type + (AnimalContainer *)getContainer; + (FungibleAnimalContainer *)getFungibleContainer; @end @interface First<__covariant T> : NSObject @end @interface Second<__covariant T> : First @end @class Third; @interface Third : Second @end typedef void (^ _Nonnull BlockPointerType)(void); @interface HasBlockArray : NSObject - (NSArray * _Nonnull)blockArray; - (BlockPointerType)blockPointerType; @end