Constraints are not part of the signature

What happens here? class Animal { } class Mammal : Animal { } class Giraffe : Mammal { }class Reptile : Animal { } …static void Foo<T>(T t) where T : Reptile { }static void Foo(Animal animal) { }static void Main() {     Foo(new Giraffe()); } Most people assume that overload resolution will choose the…

122

The correct answer is "no"

No technology today. I have not done a post on relationship advice in ages! Compare and contrast these two conversations: ****** Version One: Alice: Thanks for having lunch with me. I suppose you know what I want to talk about. Eric: Yeah, I do. I think you shouldn’t jump to conclusions solely on the basis…

13

What I Did On My Summer Vacation

I’m back, and I’ve almost made it through the 525 not-automatically-sorted email messages, caught up on my blog reading, and so on.  There are a number of interesting technical questions in my backlog that I’ll start getting to later this week once I dig myself out of the pile of bug reports that accumulated during…

31

Riddle me this, Google

One of the reasons why I do all this technical stuff in a blog is to leverage the power of search engines like Google.  I wrote a program the other day to go through the referrer log and extract all the Google queries that sent people to my page, and I was quite pleased to…

36