Skip to content

Add breaking change rule for adding partial modifier to interface methods #114537

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

Merged
merged 2 commits into from
May 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/coding-guidelines/breaking-change-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@ successfully bind to that overload, if simply passing an `int` value. However, i

* Adding a reference type field, a `ref` field, or a field involving a generic type parameter without the `unmanaged` constraint, to a value type that formerly had none of those field kinds. If the value type already contains at least one such field, adding another is non-breaking. This rule applies recursively to new fields that contain value types that may also introduce a new field kind.

* Adding `partial` modifier to an interface method

Roslyn has [a spec violation](https://github.com/dotnet/roslyn/blob/6f6d64494dc75614f14ef1ac66dde3cc8d2d0092/docs/compilers/CSharp/Deviations%20from%20Standard.md#interface-partial-methods) that makes partial interface methods implicitly non-virtual. When you add the `partial` modifier to an interface method that was previously implicitly virtual, be sure to also include the `virtual` modifier to avoid a breaking change.

### Signatures
✓ **Allowed**
* Adding `params` to a parameter
Expand Down