3 ms·
Well, if List<T> is invariant on the T, then you cannot usefully have lists parameterized on interfaces, which is losing a useful ability. I'd say that classifi
by Peaker 14y ago
Well, if List<T> is invariant on the T, then you cannot usefully have lists parameterized on interfaces, which is losing a useful ability. I'd say that classifies as a thorny edge case.
In Haskell, I can represent the type:
(Show a, Ord a) => [a]
It seems like the same is impossible in C# due to generics' interaction with inheritance.