#import #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