-
Notifications
You must be signed in to change notification settings - Fork 516
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
[Foundation] Unify a few NSAttributedString constructor implementations. #16804
[Foundation] Unify a few NSAttributedString constructor implementations. #16804
Conversation
Unify the code for the following constructors: + NSAttributedString (NSData data, NSDictionary options, out NSDictionary resultDocumentAttributes, ref/out NSError error); + NSAttributedString (NSUrl url, NSAttributedStringDocumentAttributes options, out NSDictionary resultDocumentAttributes, ref/out NSError error); + NSAttributedString (NSData data, NSAttributedStringDocumentAttributes options, out NSDictionary resultDocumentAttributes, ref/out NSError error); These functions use 'ref' arguments instead of 'out' arguments for mobile platforms (likely due to the generator not having proper 'out' parameter support when these functions were implemented), so improve to use 'out' parameters in XAMCORE_5_0 (and macOS, where they already use 'out' parameters). Also fix nullability. Ref: xamarin#15216
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.
Test failure is unrelated (https://github.com/xamarin/maccore/issues/2632). |
✅ API diff for current PR / commitLegacy Xamarin (No breaking changes)
NET (empty diffs)
❗ API diff vs stable (Breaking changes)Legacy Xamarin (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:).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 |
📚 [PR Build] Artifacts 📚Artifacts were not provided. Pipeline on Agent XAMBOT-1104.Monterey' |
💻 [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed 💻✅ All tests on macOS M1 - Mac Big Sur (11.5) passed. Pipeline on Agent |
🔥 [CI Build] Test results 🔥Test results❌ Tests failed on VSTS: simulator tests 0 tests crashed, 5 tests failed, 218 tests passed. Failures❌ bcl tests
Html Report (VSDrops) Download Successes✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
Test failures are unrelated (https://github.com/xamarin/maccore/issues/2629). |
…ns. (xamarin#16804) Unify the code for the following constructors: * NSAttributedString (NSData data, NSDictionary options, out NSDictionary resultDocumentAttributes, ref/out NSError error); * NSAttributedString (NSUrl url, NSAttributedStringDocumentAttributes options, out NSDictionary resultDocumentAttributes, ref/out NSError error); * NSAttributedString (NSData data, NSAttributedStringDocumentAttributes options, out NSDictionary resultDocumentAttributes, ref/out NSError error); These functions use 'ref' arguments instead of 'out' arguments for mobile platforms (likely due to the generator not having proper 'out' parameter support when these functions were implemented), so improve to use 'out' parameters in XAMCORE_5_0 (and macOS, where they already use 'out' parameters). Also fix nullability. Ref: xamarin#15216
@rolfbjarne can these constructors ever return a non-null NSError?
or
What is the correct way to use these constructors? Just wrap them in try-catch instead of inspecting the |
Managed constructors can't fail gracefully, which means that constructors with an "out NSError" parameter doesn't make much sense. Instead bind these constructors using a factory method. Ref: #16804 (comment)
This is rather unfortunate, these constructors should really be bound as factory methods instead. For now, I guess the best is to wrap them in a try-catch, but then you won't be able to inspect the I've created a PR to create factory methods for them instead: #21727
That's a fairly generic issue saying there are problems with the NSAttributedString ctors, which is true enough. |
… (#21727) Managed constructors can't fail gracefully, which means that constructors with an "out NSError" parameter doesn't make much sense. Instead bind these constructors using a factory method. Ref: #16804 (comment) Fixes #14489.
Managed constructors can't fail gracefully, which means that constructors with an "out NSError" parameter doesn't make much sense. Instead bind these constructors using a factory method. References: * #16804 (comment) * #21727 Missing: * Manual tests.
…21803) Managed constructors can't fail gracefully, which means that constructors with an "out NSError" parameter doesn't make much sense. Instead bind these constructors using a factory method. References: * #16804 (comment) * #21727
Unify the code for the following constructors:
These functions use 'ref' arguments instead of 'out' arguments for mobile
platforms (likely due to the generator not having proper 'out' parameter
support when these functions were implemented), so improve to use 'out'
parameters in XAMCORE_5_0 (and macOS, where they already use 'out'
parameters).
Also fix nullability.
Ref: #15216