-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[BGen] Simplify BindAs for smart enums. #22222
base: main
Are you sure you want to change the base?
Conversation
This changes does two things: 1. Adds a GetValue internal helper for non value backend smart enums. 2. Uses the GetValue functions as the builder for the NSArray. The new method (1) is only added to those smart enums that use a none value type backing field that looks like the following: ```csharp internal static ASAuthorizationProviderAuthorizationOperation GetValue (NativeHandle handle) { using var str = Runtime.GetNSObject<NSString> (handle); return GetValue (str); } ``` This is later used to retrieve the enum values from the handle in a BindAs decorated method/property. This is very similar to what we did in #22216 and has the same performance considerations (there is no performance change after C# 11 and later).
|
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
❌ [CI Build #f58e68d] Tests on macOS M1 - Mac Monterey (12) failed ❌Tests on macOS M1 - Mac Monterey (12) failed for unknown reasons. Pipeline on Agent |
❌ [CI Build #f58e68d] Tests on macOS M1 - Mac Ventura (13) failed ❌Tests on macOS M1 - Mac Ventura (13) failed for unknown reasons. Pipeline on Agent |
❌ [CI Build #f58e68d] Tests on macOS arm64 - Mac Sequoia (15) failed ❌Tests on macOS arm64 - Mac Sequoia (15) failed for unknown reasons. Pipeline on Agent |
❌ [CI Build #f58e68d] Tests on macOS X64 - Mac Sonoma (14) failed ❌Tests on macOS X64 - Mac Sonoma (14) failed for unknown reasons. 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.
…rin/xamarin-macios into dev/mandel/smart-enum-from-nsstring
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 #605ab68] Build failed (Build macOS tests) 🔥Build failed for the job 'Build macOS tests' (with job status 'Failed') Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
🔥 Failed to compare API and create generator diff 🔥 Error: 'make' failed for the hash 30cce24. Pipeline on Agent |
🔥 [CI Build #605ab68] Test results 🔥Test results❌ Tests failed on VSTS: test results 0 tests crashed, 73 tests failed, 39 tests passed. Failures❌ dotnettests tests (iOS)
Html Report (VSDrops) Download ❌ dotnettests tests (MacCatalyst)
Html Report (VSDrops) Download ❌ dotnettests tests (macOS)
Html Report (VSDrops) Download ❌ dotnettests tests (tvOS)
Html Report (VSDrops) Download ❌ generator tests
Html Report (VSDrops) Download ❌ interdependent-binding-projects tests
Html Report (VSDrops) Download ❌ linker tests
Html Report (VSDrops) Download ❌ monotouch tests (iOS)
Html Report (VSDrops) Download ❌ monotouch tests (MacCatalyst)
Html Report (VSDrops) Download ❌ monotouch tests (macOS)
Html Report (VSDrops) Download ❌ monotouch tests (tvOS)
Html Report (VSDrops) Download Successes✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
✅ [PR Build #2272a97] Build passed (Build packages) ✅Pipeline on Agent |
✅ [PR Build #2272a97] Build passed (Detect API changes) ✅Pipeline on Agent |
This changes does two things:
The new method (1) is only added to those smart enums that use a none value type backing field that looks like the following:
This is later used to retrieve the enum values from the handle in a BindAs decorated method/property. This is very similar to what we did in #22216 and has the same performance considerations (there is no performance change after C# 11 and later).