-
Notifications
You must be signed in to change notification settings - Fork 547
[RGen] Add validations for the BindingType attribute for a Category. #23798
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
base: dev/mandel/category-no-property-no-constructor
Are you sure you want to change the base?
[RGen] Add validations for the BindingType attribute for a Category. #23798
Conversation
Ensure that the correct named parameters are used when using the Category flag. This will raise the following: 1. Name contains spaces (error). 2. Category type is not a INativeObject (error). 3. DefaultCtorVisibility is ignored (warning). 4. ErrorDomain is ignored (warning). 5. IntPtrCtorVisibility is ignored (warning). 6. ModelName is ignored (warning). 7. StringCtorVisibility is ignored (warning). We updated the way the BingdingTypeAttribute is parsed to get all the data and use that data to decide if named parameters were used that are not supported.
// validate the name if specified | ||
if (data.Name is not null) { | ||
// validate that we do not have any whitespaces in the name | ||
if (string.IsNullOrWhiteSpace (data.Name) || data.Name.Contains (' ')) { |
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.
Would be better to use 'char.IsWhiteSpace' to check for whitespace instead of just checking spaces
}", | ||
"RBI0049", | ||
DiagnosticSeverity.Error, | ||
"Category 'TestClass' type 'TestNamespace.MyClass' does not implement INativeObject" |
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.
I think you can make it stricter, the category must be for NSObject, not INativeObject.
This comment has been minimized.
This comment has been minimized.
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.
After Rolf's 👍
✅ [CI Build #7ce4c2e] Build passed (Build packages) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [PR Build #7ce4c2e] Build passed (Detect API changes) ✅Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ API diff for current PR / commit.NET ( No breaking changes )✅ API diff vs stable.NET ( No breaking changes )ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
✅ [CI Build #7ce4c2e] Build passed (Build macOS tests) ✅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.
💻 [CI Build #7ce4c2e] Tests on macOS X64 - Mac Sonoma (14) passed 💻✅ All tests on macOS X64 - Mac Sonoma (14) passed. Pipeline on Agent |
💻 [CI Build #7ce4c2e] Tests on macOS arm64 - Mac Sequoia (15) passed 💻✅ All tests on macOS arm64 - Mac Sequoia (15) passed. Pipeline on Agent |
💻 [CI Build #7ce4c2e] Tests on macOS M1 - Mac Ventura (13) passed 💻✅ All tests on macOS M1 - Mac Ventura (13) passed. Pipeline on Agent |
💻 [CI Build #7ce4c2e] Tests on macOS M1 - Mac Monterey (12) passed 💻✅ All tests on macOS M1 - Mac Monterey (12) passed. Pipeline on Agent |
This comment has been minimized.
This comment has been minimized.
🚀 [CI Build #7ce4c2e] 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 |
Ensure that the correct named parameters are used when using the Category flag. This will raise the following:
We updated the way the BingdingTypeAttribute is parsed to get all the data and use that data to decide if named parameters were used that are not supported.