pm100
pm100

Reputation: 50210

Is the core CLR of Silverlight 4 the same as 'classic' .Net 4?

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?

Upvotes: 5

Views: 136

Answers (1)

Reed Copsey
Reed Copsey

Reputation: 564851

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't IEnumerable<out T> as it is in .NET 4).

Silverlight 5 fixes this, "officially" supporting Covariance and Contravariance.

Upvotes: 5

Related Questions