45 lines · c
1#ifndef SOMEKIT_H2#define SOMEKIT_H3 4__attribute__((objc_root_class))5#ifndef NS_ASSUME_NONNULL_BEGIN6#if __has_feature(assume_nonnull)7#define NS_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")8#define NS_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")9#else10#define NS_ASSUME_NONNULL_BEGIN11#define NS_ASSUME_NONNULL_END12#endif13#endif14 15NS_ASSUME_NONNULL_BEGIN16 17@interface A18-(null_unspecified A*)transform:(null_unspecified A*)input __attribute__((unavailable("anything but this")));19-(A*)transform:(A*)input integer:(int)integer;20 21@property (null_unspecified, nonatomic, readonly, retain) A* someA;22@property (null_unspecified, nonatomic, retain) A* someOtherA;23 24@property (nonatomic) int intValue __attribute__((unavailable("wouldn't work anyway")));25@end26 27NS_ASSUME_NONNULL_END28 29 30__attribute__((unavailable("just don't")))31@interface B : A32@end33 34@interface C : A35- (instancetype)init; // expected-warning{{pointer is missing a nullability type specifier}}36// expected-note@-1{{insert '_Nullable' if the pointer may be null}}37// expected-note@-2{{insert '_Nonnull' if the pointer should never be null}}38- (instancetype)initWithA:( A*)a __attribute__((objc_designated_initializer)); // expected-warning 2{{pointer is missing a nullability type specifier}}39// expected-note@-1 2{{insert '_Nullable' if the pointer may be null}}40// expected-note@-2 2{{insert '_Nonnull' if the pointer should never be null}}41@end42 43#endif44 45