Код: Выделить всё
interface IFruit { }
interface IApple : IFruit { }
interface IBag { }
// This works
IBag ConvertBag(IBag fruits) => fruits;
// Error: Cannot implicitly convert IBag to IBag
IBag ConvertBag(IBag fruits) where F : IFruit => fruits;
Но почему я не могу преобразовать IBag в IBag, если я знаю, что F является IFruit?
Подробнее здесь: https://stackoverflow.com/questions/790 ... in-c-sharp