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

Clarify breaking-change rules for properties #112368

Open
mstefarov opened this issue Feb 10, 2025 · 5 comments
Open

Clarify breaking-change rules for properties #112368

mstefarov opened this issue Feb 10, 2025 · 5 comments
Labels
area-Meta untriaged New issue has not been triaged by the area owner

Comments

@mstefarov
Copy link

mstefarov commented Feb 10, 2025

Would moving a public property up to a base class be considered a breaking change, in any sense?

The breaking-change-rules doc mentions that moving methods up is allowed. It seems like moving properties should be allowed too. But the Microsoft.DotNet.PackageValidation tool flags this as a breaking change.

And while we're at it, how about public events and indexers?

It would be good to get a definitive answer, and to have the doc and the validation tool in sync as well.

@jnm2 @stephentoub

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Feb 10, 2025
@dotnet-policy-service dotnet-policy-service bot added the untriaged New issue has not been triaged by the area owner label Feb 10, 2025
@mstefarov
Copy link
Author

Related: #29637
The doc previously said that moving members is allowed, but this was changed to methods after concerns were raised about moving public fields.

@jnm2
Copy link
Contributor

jnm2 commented Feb 10, 2025

It might also be good to mention nested types for clarity, since "members" of a type can include types. I would assume it's a breaking change to move a nested type to be nested in Base instead of Derived.

@vcsjones vcsjones added area-Meta and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Feb 10, 2025
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-meta
See info in area-owners.md if you want to be subscribed.

@stephentoub
Copy link
Member

It should be fine to move properties from a derived type to a base type.
cc: @bartonjs

@dotMorten
Copy link

In that case the package validation tools are broken

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Meta untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

5 participants