Invoking default interface method implementation from a selected interface #14127
Labels
by-design
dotnet-csharp/svc
Pri0
Indicates issues or PRs that are critical priority
⌚ Not Triaged
Not triaged
Milestone
Let's say I have the following rather contrived scenario:
Now I want a class to implement both I1 and I2:
As expected, I get the following compiler error:
> Interface member 'I0.Method()' does not have a most specific implementation. Neither 'I1.I0.Method()', nor 'I2.I0.Method()' are most specific.
I can resolve this if I provide my own implementation. Inside it, how could I invoke the implementation from one of the interfaces, e.g. I1? I'm pretty sure the following syntax used to work in a previous preview:
However, now the compiler complains:
> Use of keyword 'base' is not valid in this context
What is the correct syntax to invoke the default method implementation in interface I1? I can't find it documented anywhere.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: