I wanted to create an extension method on the class System.Type that would take another Type and return true if it is an interface implemented by the first Type. I thought this would be quick and easy. What I implemented did work most of the time. However I ran into a situation in which it returned an unexpected result, and it took me some time to figure out what was going on.
Type.IsAssignableFrom() and contravariance gotcha
Friday, February 24, 2012
at
9:18 PM
| Posted by
Spruce
Posted In
.Net,
contravariance,
gotcha,
types
|
1 comments
|
Subscribe to:
Posts (Atom)