I got CS0738 when class impelments an interface, and interface has a method, with return type interface.
And in class return type is a struct that implements return type interface.
Simply, this code shows the problem:
public interface IGame
{
IPlayer WhoWin();
}
public interface IPlayer
{
int ID { get; }
}
And in class:
public class MyGame : IGame
{
// ERROR CS0738
public MyPlayer WhoWin()
{
// ...
return null;
}
}
public class MyPlayer : IPlayer
{
public int ID
{
get
{
return ColorTranslator.ToWin32(Color);
}
}
public Color Color;
}
What should I do? How can I solve the problem?