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.

Comments

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
Equality has Symmetry  17 Mar 2018
Type Miscellany  05 Mar 2017
Testing Immutable Types  25 Feb 2017
Factory Methods  18 Feb 2017
Queue Concatenation  11 Feb 2017
Complex Queues  04 Feb 2017
The Problem with the Simple Queue  28 Jan 2017
Enumeration of Queues  21 Jan 2017
Reversing Stacks  14 Jan 2017
Simple Queues  07 Jan 2017
More csharp posts »
Archives
October 2008
2008