Skip to content
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

Don't generate static XName fields for inherited properties #65

Merged
merged 4 commits into from
Feb 6, 2024

Conversation

jods4
Copy link
Contributor

@jods4 jods4 commented Feb 2, 2024

Fixes #63

This is a long-standing issue, in fact LinqToXsd.Schemas.csproj contains this:

<!-- CS0108: ... hides inherited member ... Use the new keyword if hiding was intended. -->
<NoWarn>$(NoWarn);108;114;1591</NoWarn>

I have removed the generation of static XName fields for properties that are inherited, as a field was already generated in parent and is accessible.
To ensure that it's always accessible, I added the protected modified, although you'd have to split your inherited classes accross assemblies for this to actually matter.

This fixes the instance of warning that was reported in #63, not sure if there are other situations where CS0108 could happen.

@mamift mamift merged commit 969dd37 into mamift:master Feb 6, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[regression in v3.4.3+] error CS0108: OneField of ParentType hides inherited member OneField of ChildType
2 participants