When I have a default implementation of a method in an interface and then have a struct with this interface, the method does not exist as member of the struct. Why? Or what am I understanding wrong? Example:
using System;
namespace test
{
public interface ITestInterface
{
public bool TestMe() => true;
public bool TestMe2();
}
public struct teststruct : ITestInterface
{
public int somevalue;
// implementing this will create a NEW method but not implement the interface
// public bool TestMe() => true;
public bool TestMe2() => false;
}
class a
{
public static void Main()
{
var ts = new teststruct();
ts.TestMe(); // this doesnt exist
}
}
}
With this example, the method TestMe() is non existent in the struct, but TestMe2() must be implemented (as expected).