You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
64 lines
1.3 KiB
64 lines
1.3 KiB
9 years ago
|
/*
|
||
6 years ago
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
||
9 years ago
|
*
|
||
7 years ago
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
9 years ago
|
*/
|
||
9 years ago
|
|
||
|
#import <Foundation/NSString.h>
|
||
|
|
||
8 years ago
|
@interface NullableA : NSObject {
|
||
9 years ago
|
@public
|
||
|
int fld;
|
||
9 years ago
|
}
|
||
|
|
||
|
@end
|
||
|
|
||
8 years ago
|
@interface NullableB : NSObject
|
||
9 years ago
|
|
||
|
@property int prop;
|
||
|
|
||
9 years ago
|
- (void)method;
|
||
9 years ago
|
|
||
|
@end
|
||
|
|
||
8 years ago
|
int derefNullableParamDirect(NullableA* __nullable param) { return param->fld; }
|
||
9 years ago
|
|
||
8 years ago
|
int derefNullableParamIndirect(NullableA* __nullable param) {
|
||
|
NullableA* local = param;
|
||
9 years ago
|
return local->fld;
|
||
9 years ago
|
}
|
||
|
|
||
8 years ago
|
NullableA* derefNullableParamOk(NullableA* __nullable param) {
|
||
9 years ago
|
if (!param)
|
||
8 years ago
|
param = [NullableA new];
|
||
9 years ago
|
param->fld = 7;
|
||
9 years ago
|
return param;
|
||
|
}
|
||
9 years ago
|
|
||
9 years ago
|
int parameter_nullable_ok(NSString* body,
|
||
8 years ago
|
NSString* __nullable linkTapAction,
|
||
|
NullableA* options) {
|
||
9 years ago
|
return options->fld;
|
||
|
}
|
||
|
|
||
8 years ago
|
int parameter_nullable_bug(NullableA* __nullable options,
|
||
9 years ago
|
NSAttributedString* body,
|
||
|
NSString* linkTapAction)
|
||
|
|
||
|
{
|
||
|
return options->fld;
|
||
|
}
|
||
|
|
||
8 years ago
|
int readNullableParamPropertyOk(NullableB* __nullable param) {
|
||
|
return param.prop;
|
||
|
}
|
||
9 years ago
|
|
||
8 years ago
|
void writeNullableParamPropertyOk(NullableB* __nullable param) {
|
||
|
param.prop = 7;
|
||
|
}
|
||
9 years ago
|
|
||
8 years ago
|
void methodCallOnNullableParamOk(NullableB* __nullable param) {
|
||
|
[param method];
|
||
|
}
|