C#C
C#2y ago
LastExceed

✅ how can i let an interface implement a function of a super-interface, instead of shadowing it?

public class MyClass : IOne;

public interface IOne : ITwo
{
    public void Foo()
    {
        Console.WriteLine();
    }
}

public interface ITwo
{
    public void Foo();
}

this doesnt compile, because IOne.Foo is considered a separate function that shadows ITwo.Foo. how do i tell IOne to provide a default implementation for ITwo.Foo instead of shadowing it?
Was this page helpful?