It seems the information deluge has started, and the first piece of good news about C# 4.0 is the introduction of contravariance and covariance for delegates and interfaces.

Charlie Calvert has a useful summary that I’d suggest you read.

On first glance, it looks as though the support hinges on adding a in and out modifiers to type parameters as hints for further use.

I’d like to know if the compiler will be doing any checking/enforcing in this area - are the in and out modifiers just hints, or will the compiler be doing some semantic checking to enforce the rules.


blog comments powered by Disqus
Next Post
Linq Aggregates  30 Oct 2008
Prior Post
The right knowledge for each problem ...  25 Oct 2008
Related Posts
When (not) to use Var  16 Jul 2016
Semantic Types Redux  05 Jun 2016
Semantic Types in C#6  27 May 2016
Property Enhancements for C#  20 Dec 2015
Language Extensions for C#  19 May 2014
When should methods be Static?  09 Oct 2012
Of Method Naming and more  29 Sep 2012
Someone needs an intervention  16 Dec 2011
CallerInfo in C# 5  08 Dec 2011
Regions in C#  16 May 2011
More csharp posts »
Related Pages
October 2008 archive