Why is my X
method below not being called?!
static class Program
{
private static void Main()
{
X((IEnumerable<int>)null);
}
public static IEnumerable<T> X<T>(IEnumerable<T> e)
{
if (e == null)
throw new ArgumentNullException();
yield break;
}
}
I tried stepping into the debugger but it doesn't enter X
! Is the yield break
keyword causing some side effect I am not aware of?
If it's worth anything, I'm using Visual Studio 2008 Express with .NET 3.5 SP1.