-
Notifications
You must be signed in to change notification settings - Fork 547
Add a [NativeName] attribute we can use to declare the native name for a type (enum/struct). #14918
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
Conversation
…r a type (enum/struct). We already have a few attributes that can specify the native name for a type, whenever the native name doesn't match the managed name: * [Register ("DifferentClassName"): specifies the Objective-C class name * [Native ("DifferentEnumName")]: specifies the Objective-C enum name (and also that it's a native-sized enum) * [Protocol ("DifferentProtocolName")]: specifies the Objective-C protocol name * [Category ("DifferentCategoryName")]: specifies the Objective-C category name Unfortunately this leaves (at least) two cracks: * Objective-C structs. * Objective-C enums which aren't native-sized. So I'm adding a [NativeName] attribute for this purpose, and updating numerous types to specify the native name (either using an existing [Native] attribute for enums that already have one, or by adding a new [NativeName] attribute). The static registrar needs to know the native name for such types, in case they appear as parameter types in function signatures. This also allows us to simplify xtro a bit, to not have a separate map of managed name given a native name, because we can now build that map dynamically.
This comment has been minimized.
This comment has been minimized.
😔 |
📋 [PR Build] API Diff 📋API Current PR diffℹ️ API Diff (from PR only) (please review changes) View dotnet API diffView dotnet legacy API diffAPI diff✅ API Diff from stable View dotnet API diffView dotnet legacy API diffGenerator diffℹ️ Generator Diff (please review changes) Pipeline on Agent XAMBOT-1023.Monterey |
📚 [CI Build] Artifacts 📚Artifacts were not provided. Pipeline on Agent XAMBOT-1044.Monterey' |
💻 [PR Build] Tests on macOS Mac Catalina (10.15) passed 💻✅ All tests on macOS Mac Catalina (10.15) passed. Pipeline on Agent |
❌ [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌Failed tests are:
Pipeline on Agent |
❌ [CI Build] Tests failed on VSTS: simulator tests iOS ❌Tests failed on VSTS: simulator tests iOS. Test results22 tests failed, 212 tests passed.Failed tests
Pipeline on Agent XAMBOT-1044.Monterey' |
Test failures are all network related (https://github.com/xamarin/maccore/issues/1067). |
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.
Ahh, something to take into account this summer!
We already have a few attributes that can specify the native name for a type, whenever the native name doesn't match the managed name:
Unfortunately this leaves (at least) two cracks:
So I'm adding a [NativeName] attribute for this purpose, and updating numerous
types to specify the native name (either using an existing [Native] attribute
for enums that already have one, or by adding a new [NativeName] attribute).
The static registrar needs to know the native name for such types, in case
they appear as parameter types in function signatures.
This also allows us to simplify xtro a bit, to not have a separate map of
managed name given a native name, because we can now build that map
dynamically.