- Home /
Question by
Elisvaldo · Jun 04, 2015 at 01:35 PM ·
c#ienumerable
IEnumerable doesn't seem to be covariant, what is the workaround?
I've been using Unity to learn C# and I believe the answer to this is quite explicit, but I need some confirmation before blaming C# instead of blaming myself.
According to the source of the IEnumerable, it doesn't seem to be covariant:
using System;
using System.Runtime.CompilerServices;
namespace System.Collections.Generic
{
[TypeDependency ("System.SZArrayHelper")]
public interface IEnumerable<T> : IEnumerable
{
//
// Methods
//
IEnumerator<T> GetEnumerator ();
}
}
So if it isn't covariant, what are the usual workarounds into this issue?
Thank you!
Comment
I have the same question. Looking into solutions myself now and I'll let you know if I find any.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
Illuminating a 3D object's edges OnMouseOver (script in c#)? 1 Answer
Flip over an object (smooth transition) 3 Answers