33NSString * const TNSConstant = @" TNSConstant" ;
44
55void functionThrowsException () {
6- @throw [NSException exceptionWithName: NSGenericException reason: @" No reason" userInfo: nil ];
6+ @throw [NSException exceptionWithName: NSGenericException reason: @" No reason" userInfo: nil ];
77}
88
99@implementation TNSApi {
10- int _property;
10+ int _property;
1111}
1212
1313- (int )customGetter {
14- return _property;
14+ return _property;
1515}
1616- (void )customSetter : (int )value {
17- _property = value;
17+ _property = value;
1818}
1919
2020+ (void )methodThrowsException {
21- @throw [NSException exceptionWithName: NSGenericException reason: @" No reason" userInfo: nil ];
21+ @throw [NSException exceptionWithName: NSGenericException reason: @" No reason" userInfo: nil ];
2222}
2323
2424- (void )methodThrowsException {
25- @throw [NSException exceptionWithName: NSGenericException reason: @" No reason" userInfo: nil ];
25+ @throw [NSException exceptionWithName: NSGenericException reason: @" No reason" userInfo: nil ];
2626}
2727
2828- (void )methodCalledInDealloc {
29- // TODO
30- // [TNSGetOutput() appendString:@"methodCalledInDealloc called"];
29+ // TODO
30+ // [TNSGetOutput() appendString:@"methodCalledInDealloc called"];
3131}
3232
3333- (void )dealloc {
34- [self methodCalledInDealloc ];
34+ [self methodCalledInDealloc ];
3535}
3636
3737- (BOOL )method : (NSInteger )errorCode error : (NSError **)outError {
38- if (outError) {
39- if (errorCode != 0 ) {
40- *outError = [NSError errorWithDomain: @" TNSErrorDomain" code: errorCode userInfo: nil ];
41- } else {
42- *outError = nil ;
43- }
38+ if (outError) {
39+ if (errorCode != 0 ) {
40+ *outError = [NSError errorWithDomain: @" TNSErrorDomain" code: errorCode userInfo: nil ];
41+ } else {
42+ *outError = nil ;
4443 }
45- return errorCode == 0 ;
44+ }
45+ return errorCode == 0 ;
46+ }
47+
48+ - (BOOL )methodNullable : (NSInteger )errorCode error : (NSError * _Nullable* _Nullable)outError {
49+ if (outError) {
50+ if (errorCode != 0 ) {
51+ *outError = [NSError errorWithDomain: @" TNSErrorDomain" code: errorCode userInfo: nil ];
52+ } else {
53+ *outError = nil ;
54+ }
55+ }
56+ return errorCode == 0 ;
4657}
4758
4859@end
@@ -56,19 +67,19 @@ - (void)method:(long long)x {
5667
5768@implementation TNSConflictingSelectorTypes2
5869+ (id )method : (id )x {
59- return nil ;
70+ return nil ;
6071}
6172- (id )method : (id )x {
62- return nil ;
73+ return nil ;
6374}
6475@end
6576
6677@implementation TNSSwizzleKlass
6778+ (int )staticMethod : (int )x {
68- return x;
79+ return x;
6980}
7081- (int )instanceMethod : (int )x {
71- return x;
82+ return x;
7283}
7384@end
7485
@@ -79,7 +90,7 @@ @implementation TNSPropertyMethodConflictClass
7990@implementation RectClass
8091
8192- (CGRect)getRect {
82- return CGRectMake (1 , 2 , 3 , 4 );
93+ return CGRectMake (1 , 2 , 3 , 4 );
8394}
8495
8596@end
0 commit comments