I ask this because I have been chasing down a co/contravariance issue in SL4. I asked it twice in SO and got answers along the lines of – “It just works, make sure you are using .net 4”. I tried my failing code (and the samples people posted) in SL4 and .Net 4 and the results are different (work in .net fail in sl). So is SL4 actually running on a < 4 version. Or are there just some features left out (accidentally or on purpose). If so what features
What about SL 5?
The core compiler in Silverlight 4 supports Covariance and Contravariance, but the framework interfaces (ie:
IEnumerable<T>) unfortunately were not marked as covariant (note in the docs that it isn’tIEnumerable<out T>as it is in .NET 4).Silverlight 5 fixes this, “officially” supporting Covariance and Contravariance.