-
Notifications
You must be signed in to change notification settings - Fork 517
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
[videosubscriberaccount] Add nullability to (generated and manual) bindings #14948
[videosubscriberaccount] Add nullability to (generated and manual) bindings #14948
Conversation
if (value.GetConstants () is not null) | ||
SupportedAuthenticationSchemesString = value.GetConstants ()!; | ||
else | ||
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (value)); |
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.
IMHO using a temporary variable here would be better:
if (value.GetConstants () is not null) | |
SupportedAuthenticationSchemesString = value.GetConstants ()!; | |
else | |
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (value)); | |
var constants = value.GetConstants (); | |
if (constants is null) | |
ObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (value)); | |
SupportedAuthenticationSchemesString = constants; |
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.
Okay changing this to the proposed code!
However, the value.GetConstants ();
returns a NSString?[]
so I went with this code and added a !
to the last line after constants. Internally, these methods throw an exception if it does find a null item inside the constants array and I believe this is what was recommended last time a similar thing happened
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.
Please implement the change from @rolfbjarne
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
💻 [PR Build] Tests on macOS Mac Catalina (10.15) passed 💻✅ All tests on macOS Mac Catalina (10.15) passed. Pipeline on Agent |
❌ [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌Failed tests are:
Pipeline on Agent |
❌ [CI Build] Tests failed on VSTS: simulator tests iOS ❌Tests failed on VSTS: simulator tests iOS. Test results22 tests failed, 126 tests passed.Failed tests
Pipeline on Agent XAMBOT-1166.Monterey' |
Merging since the test failures are unrelated timeouts! |
This PR aims to bring nullability changes to VideoSubscriberAccount.
Following the steps here:
nullable enable
to all manual files that are not "API_SOURCES" in src/frameworks.sources and making the required nullability changesthrow new ArgumentNullException ("object"));
toObjCRuntime.ThrowHelper.ThrowArgumentNullException (nameof (object));
for size saving optimization as well to mark that this framework contains nullability changes== null
or!= null
tois null
andis not null