-
Notifications
You must be signed in to change notification settings - Fork 518
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
[RGen] Add a roslyn based implementation of the GetValueTypeSize. #22037
[RGen] Add a roslyn based implementation of the GetValueTypeSize. #22037
Conversation
Roslyn has no access to reflection. Add an implementation of the IsBuiltInType method using the Roslyn APIs and test one method against the other. Tests show that the implementations return the same values for the same inputs.
Add a roslyn based implemenation of the GetValueTypeSize method that calulcates the size of a struct type based on the target platform. Tests are written so that we can compare the output of the reflection based implementation with the roslyn one.
|
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.
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (1)
src/rgen/Microsoft.Macios.Generator/Extensions/TypeSymbolExtensions.Core.cs:359
- [nitpick] The error message for unhandled 'MarshalAs' attributes could be more descriptive. Include more context about the field and the attribute causing the issue.
throw new Exception ($"Unhandled MarshalAs attribute: {marshalAs.Value} on field {field.ToDisplayString ()}");
/// </summary> | ||
/// <param name="symbol">The symbol whose fields to retireve.</param> | ||
/// <returns>an array with all the none static fields of a struct.</returns> | ||
public static IFieldSymbol [] GetStrutFields (this ITypeSymbol symbol) |
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.
The method name 'GetStrutFields' contains a spelling error. It should be 'GetStructFields'.
public static IFieldSymbol [] GetStrutFields (this ITypeSymbol symbol) | |
public static IFieldSymbol [] GetStructFields (this ITypeSymbol symbol) |
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
src/rgen/Microsoft.Macios.Generator/Extensions/TypeSymbolExtensions.Core.cs
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
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.
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.
…om:xamarin/xamarin-macios into dev/mandel/stret-getvalue-type-size-roslyn
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Failing tests are unrelated to the failure and we have the same tests passing in other platforms. |
✅ [CI Build] Build passed (Build packages) ✅Pipeline on Agent |
✅ [CI Build] Build passed (Detect API changes) ✅Pipeline on Agent |
✅ [CI Build] Build passed (Build macOS tests) ✅Pipeline on Agent |
✅ API diff for current PR / commit.NET ( No breaking changes )❗ API diff vs stable (Breaking changes).NET ( ❗ Breaking changes ❗ )ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
💻 [CI Build] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
💻 [CI Build] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [CI Build] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build] Windows Integration Tests passed 💻✅ All Windows Integration Tests passed. Pipeline on Agent |
🚀 [CI Build] Test results 🚀Test results✅ All tests passed on VSTS: test results. 🎉 All 115 tests passed 🎉 Tests counts✅ cecil: All 1 tests passed. Html Report (VSDrops) Download Pipeline on Agent |
Add a roslyn based implemenation of the GetValueTypeSize method that calulcates the size of a struct type based on the target platform.
Tests are written so that we can compare the output of the reflection based implementation with the roslyn one.