-
Notifications
You must be signed in to change notification settings - Fork 518
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
[coretext] Add nullability to (generated and manual) bindings #14978
Conversation
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.
This comment has been minimized.
This comment has been minimized.
@rolfbjarne before I go through all the files and make these changes, I wanted to confirm that I am on the right track with this file? https://gist.github.com/tj-devel709/1ad14fd0c52616dd2bd684c07c57ca6a |
Yes, that's on the right track! I think you can simplify things a bit though:
|
@rolfbjarne for the first two suggestions, if I instead add the null checks in the |
@tj-devel709 for the first suggestion, you can change the For the second suggestion, I'd put an exclamation on all the callsites to It's a bit weird that the Get and Set methods have different semantics, but these are internal methods, so it doesn't matter all that much. |
Apologies, did not mean to push yet, not ready to be merged! |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@rolfbjarne I think I made all the changes. I wasn't quite sure of where to do the following however:
|
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.
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.
✅ API diff for current PR / commitLegacy Xamarin (No breaking changes).NET (No breaking changes)❗ API diff vs stable (Breaking changes)Legacy Xamarin (No breaking changes).NET (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
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.
✅ API diff for current PR / commitLegacy Xamarin (No breaking changes)
NET (empty diffs)
✅ API diff vs stableLegacy Xamarin (No breaking changes).NET (No breaking changes)✅ Generator diffGenerator diff is empty Pipeline on Agent |
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 M1 - Mac Big Sur (11.5) failed ❌Tests on macOS M1 - Mac Big Sur (11.5) failed for unknown reasons. Pipeline on Agent |
✅ API diff for current PR / commitLegacy Xamarin (No breaking changes)
NET (empty diffs)
✅ API diff vs stableLegacy Xamarin (No breaking changes).NET (No breaking changes)✅ Generator diffGenerator diff is empty Pipeline on Agent |
💻 [PR Build] Tests on macOS Mac Catalina (10.15) passed 💻✅ All tests on macOS Mac Catalina (10.15) passed. Pipeline on Agent |
This PR aims to bring nullability changes to CoreText.
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
I decided to mark the GetStringConstants that deal with handles with a
!
since these GetX (handle) methods tend to be safe with nullability from previous PRs and there were already some files in CoreText following this pattern.Dlfcn.GetStringConstant (handle, "kCTFontCopyrightNameKey")!;