-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Draft spec for extended partial methods #3417
Labels
Comments
43 tasks
Can't explicit implementation of an interface method be partial? interface I
{
int M();
}
partial class C : I
{
private partial int I.M(); // requires access modifier but explicit implementation bans it
}
partial class C : I
{
private partial int I.M() { }
} (modified |
Maybe the explicit implementation syntax needs to optionally allow a |
The feature as shipped in VS 16.7-preview2 does not support partial explicit interface implementations. The compiler team may reconsider this limitation based on user feedback. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related to #3301
Proposal: https://github.com/dotnet/csharplang/blob/master/proposals/csharp-9.0/extending-partial-methods.md
C# 9 introduces a new kind of partial method called an extended partial method. An extended partial method must have both a defining declaration and an implementing declaration.
They are required to have explicit accessibility modifiers, which must be identical on both declarations. They are permitted to have
out
parameters and to have non-void
return types. They are permitted to use thevirtual
,override
,sealed
, andnew
modifiers. Both declarations must contain identical combinations of these modifiers, although they may be present in a different order in each declaration.A single declaration of an extended partial method is said to be an implementing partial declaration if it has a body or if it has an
extern
modifier. Only the implementing declaration is permitted to have anextern
modifier.The text was updated successfully, but these errors were encountered: