I have this code:
public IEnumerable<int> Iterator {
get { if (false) yield return -1; }
}
It is fairly ugly, but when you try to refactor it to:
public IEnumerable<int> Iterator {
get { return null; }
}
The following code breaks:
foreach (var item in obj.Iterator) {
}
How would you go about cleaning this up?