-
Notifications
You must be signed in to change notification settings - Fork 486
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
[ObjCRuntime] Make BlockLiteral a ref struct in XAMCORE_5_0. #17658
Conversation
A ref struct has a few limitations that makes a lot of sense for blocks: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/ref-struct, so by making BlockLiteral a ref struct, we're getting the C# compiler to help us not writing broken code by accident. The limitations also mean that it's a breaking change, so we can't do it before XAMCORE_5_0.
❌ [PR Build] Tests on macOS M1 - Mac Ventura (13.0) failed ❌Failed tests are:
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 M1 - Mac Big Sur (11.5) passed 💻✅ All tests on macOS M1 - Mac Big Sur (11.5) passed. Pipeline on Agent |
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.
Maybe we can consider this for .NET 8? We can document breaking changes
This comment has been minimized.
This comment has been minimized.
I believe every third-party binding project (if they use blocks at least) would have to be rebuilt, which makes it a pretty big breaking change... |
🔥 [CI Build] Test results 🔥Test results❌ Tests failed on VSTS: simulator tests 0 tests crashed, 2 tests failed, 223 tests passed. Failures❌ monotouch tests [attempt 2]
Html Report (VSDrops) Download Successes✅ bcl: All 69 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
Test failures are unrelated (#17649). |
A ref struct has a few limitations that makes a lot of sense for blocks:
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/ref-struct,
so by making BlockLiteral a ref struct, we're getting the C# compiler to help
us not writing broken code by accident.
The limitations also mean that it's a breaking change, so we can't do it
before XAMCORE_5_0.