-
Notifications
You must be signed in to change notification settings - Fork 507
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
[release/7.0.1xx-xcode14-rc2] [UIKit] Change UITextInput.SelectedTextRange to not be ArgumentSemantic.Copy. Fixes #15677. #16277
Conversation
…ic.Copy. Fixes xamarin#15677. When a property is declared as ArgumentSemantic.Copy, we'll copy the input value in property setters. Unfortunately this makes UIKit crash, because for UITextField.SelectedTextRange UIKit might use a custom UITextRange subclass, with a broken 'copy' implementation (doesn't copy all the fields), that subsequently makes the app crash. On the other hand, UITextRange doesn't conform to NSCopying, and as such is in theory not necessarily copyable, and thus I believe the bug is really that the property is declared as a 'copy' property. Fixes xamarin#15677.
🔥 [PR Build] Build failed 🔥Build failed for the job 'Build packages' Pipeline on Agent |
🔥 Failed to compare API and create generator diff 🔥 Failed to run apidiff Pipeline on Agent |
❌ [PR Build] Tests on macOS Mac Catalina (10.15) failed ❌No test package could be found for tests on macOS Mac Catalina (10.15) Pipeline on Agent |
❌ [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌No test package could be found for tests on macOS M1 - Mac Big Sur (11.5) Pipeline on Agent |
🔥 [CI Build] Test results 🔥Test results❌ Tests failed on VSTS: simulator tests 1 tests crashed, 0 tests failed, 160 tests passed. Failures❌ mmp tests🔥 Failed catastrophically on VSTS: simulator tests - mmp (no summary found). Html Report (VSDrops) Download Successes✅ bcl: All 59 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
🚀 [CI Build] Test results 🚀Test results✅ All tests passed on VSTS: simulator tests. 🎉 All 160 tests passed 🎉 Tests counts✅ bcl: All 59 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
When a property is declared as ArgumentSemantic.Copy, we'll copy the input value in property setters.
Unfortunately this makes UIKit crash, because for
UITextField.SelectedTextRange UIKit might use a custom UITextRange subclass,
with a broken 'copy' implementation (doesn't copy all the fields), that
subsequently makes the app crash.
On the other hand, UITextRange doesn't conform to NSCopying, and as such is in
theory not necessarily copyable, and thus I believe the bug is really that the
property is declared as a 'copy' property.
Fixes #15677.
Backport of #16201