Thanks a lot, Miguel!

2012/11/5 Miguel de Icaza <[email protected]>

> Hello,
>
> The following code compiles well on win platform, but causing "Cannot
>> implicitly convert type List<IChild> to IEnumerable<IBase>" compilation
>> error on MT:
>>
>> public interface IBase { }
>> public interface IChild : IBase { }
>>
>> public IEnumerable<IBase> Tst()
>> {
>>     var result = new List<IChild>();
>>     return result;
>> }
>>
>>
>> I've googled for it, and it doesn't seem like a well-known problem.
>>
>> Am I doing something wrong and that should work?
>> Is result.Cast<IBase>() the best solution for that case?
>>
>
> The code that you are showing requires the .NET 4.0 support for covariance
> and contravariance in C# which is not available in MonoTouch.
>
> We are upgrading MonoTouch to be 4.5 based, but it wont be out in
> production until some time in March or April.
>
> Miguel
>
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to