Tagged: Generics

Method invocation in C# is tricky

A few days ago, a friend o mine had a very interesting issue with C# code he had written. Let’s take a look:     There are two overloads of the generic method called Bar. The first one accepts a...

CodeTip #7 – Aliased generics in C#

It’s pretty funny to me when you think that you know some programming language quite well and suddenly you find out some feature, you’ve never heard before. I mean at all. That’s exactly what happened to me yesterday. Let’s see...

What are covariance and contravariance in C#?

Sometimes it happens that we use mechanisms/features of specific language without beeing aware of it. That’s fine, but if you’ll want to discuss your code in a future to the audience or coworkers, soon or later you’ll be forced to...