在C#中,IList继承自IEnumerable。那么下面的代码为什么会显示编译时错误?
public class MyClass : MyInterface
{
public IList<string> Words { get ; set ; } // compile-time error; must use IEnumerable as type here
}
public interface MyInterface
{
IEnumerable<string> Words { get; set; }
}