Skip to content

Instantly share code, notes, and snippets.

@mefcorvi
Created July 15, 2011 22:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mefcorvi/1085737 to your computer and use it in GitHub Desktop.
Save mefcorvi/1085737 to your computer and use it in GitHub Desktop.
C# Compiler Bug
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
new B().Test().Count();
}
}
class A<T>
{
public virtual IEnumerable<T> Test()
{
yield return default(T);
}
}
class B : A<int>
{
public IEnumerable<int> Test()
{
base.Test();
yield return 0;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment