Question based on Do C# 8 default interface implementations allow for multiple inheritance
One of the new features in c#-8.0 allows you to implement methods from an interface .
For example:
public interface A { int Foo() => 1; }
public interface B { int Foo() => 2; }
public class C : A, B { }
Which raises the next question,
What will happen if we instantiate C
and try to call Foo()
?
C c = new C();
c.Foo();
According to Mads Torgersen on his blog
Therefore, following the example of the question:
This cannot be done:
However, the following if possible