-
Notifications
You must be signed in to change notification settings - Fork 15.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add nullable qualifier to return types that can be nil, to support Swift 2 try-catch syntax #1712
Conversation
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok to test. |
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
@@ -137,7 +137,7 @@ CF_EXTERN_C_END | |||
/// reason if the data can not be parsed. | |||
/// | |||
/// @return A new instance of the class messaged. | |||
+ (instancetype)parseFromCodedInputStream:(GPBCodedInputStream *)input | |||
+ (nullable instancetype)parseFromCodedInputStream:(GPBCodedInputStream *)input | |||
extensionRegistry: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you fix the indent on these so the colons still all line up?
Add the `nullable` qualifier to return types of Objective-C methods that can return a nil due to errors. This change makes these methods compatible with the Swift 2 try-catch syntax.
568f778
to
523bfd4
Compare
@thomasvl sure, I've pushed the branch with the indentation fixed. |
Thanks and thanks for the patch! |
This change adds the
nullable
qualifier to return types of Objective-C methods that can return anil
due to errors. This change makes these methods compatible with the Swift 2 try-catch syntax. In other words, before the change, you had to do this:After the change, you can use the try-catch syntax in Swift 2: