Про вариантность отношении
От: Hamlet Армения  
Дата: 24.11.12 12:59
Оценка:
Привет. Вот, пролистал блог Ерика Липперта и наталкнулся на статью 3-х летней давности (статью можно найти здесь),и обратил внимание на одну фразу:

Now consider a projection from types to types. Say, the projection "T goes to IEnumerable<T>". That is, we have a projection that takes a type, say, Giraffe, and gives you back a new type, IEnumerable<Giraffe>. Is that projection covariant in C# 4? Yes. It preserves the direction of ordering. A Giraffe may be assigned to a variable of type Animal, and therefore an sequence of Giraffes may be assigned to a variable that can hold a sequence of Animals.


А разве не нарушена причино-седственная связь в этой фразе?
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.