Added support of __nullable and __nonnull for module exported method signature (#23731)

Summary:
For the `NullabilityPostfix`, we can use `_Nullable` or `__nullable`. Please see https://developer.apple.com/swift/blog/?id=25 , and we also use it in our code.

[iOS] [Added] - Added support of __nullable and __nonnull for module exported method signature
Pull Request resolved: https://github.com/facebook/react-native/pull/23731

Differential Revision: D14298483

Pulled By: cpojer

fbshipit-source-id: 4dd3188f51be3808ea2b97ce19aa7a85ea1f4a9e
This commit is contained in:
zhongwuzw
2019-03-03 20:01:22 -08:00
committed by Facebook Github Bot
parent 65c014d19f
commit d8d42c7310

View File

@@ -106,9 +106,11 @@ static RCTNullability RCTParseNullability(const char **input)
static RCTNullability RCTParseNullabilityPostfix(const char **input)
{
if (RCTReadString(input, "_Nullable")) {
if (RCTReadString(input, "_Nullable") ||
RCTReadString(input, "__nullable")) {
return RCTNullable;
} else if (RCTReadString(input, "_Nonnull")) {
} else if (RCTReadString(input, "_Nonnull") ||
RCTReadString(input, "__nonnull")) {
return RCTNonnullable;
}
return RCTNullabilityUnspecified;