[.NET] Allow forcing the enum suffix to avoid hiding members#120395
Open
raulsntos wants to merge 1 commit into
Open
[.NET] Allow forcing the enum suffix to avoid hiding members#120395raulsntos wants to merge 1 commit into
raulsntos wants to merge 1 commit into
Conversation
Can also be used to avoid breaking compatibility later if a new member is added that matches the name of the enum.
Member
|
Do we want to use this to limit current usages of |
Member
Author
|
Changing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem(s) does this PR solve?
A property and and enum can often have matching names after they are converted to PascalCase to follow C# naming conventions. When the property and the enum are declared in the same class this is not a problem because the bindings generator detects this and adds an
Enumsuffix to the enum type.But when the property is declared in a derived class, it hides the enum type instead, which is now a CI error unless we explicitly suppress it, which we don't want to do often. This allows specifying which enums should always add the
Enumsuffix in the generated C# bindings, which solves these 2 issues:Additional information
This can be used by #117107 to fix the current CI errors with a change like this: