Bug 30617

Summary: Stepping over foreach exits method
Product: [Mono] Runtime Reporter: David Karlaš <david.karlas>
Component: DebuggerAssignee: Zoltan Varga <vargaz>
Status: RESOLVED FIXED    
Severity: normal CC: mono-bugs+mono, mono-bugs+runtime
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: screencast

Description David Karlaš 2015-05-30 15:56:41 UTC
Created attachment 11399 [details]
screencast

Sample code:
using System;
using System.Collections.Generic;

class Program
{
	public static void Main()
	{
		Lol();
	}// 2. You will end here

	static IEnumerable<object> NestedTypes = new List<object>();
	static void Lol()
	{
		foreach (var nestedType in NestedTypes)// 1. Place breakpoint on this line and do step over
		{
		}
		Console.WriteLine("Hi"); // 3. In worst case you should end here
	}
}

See attachement for sample GIF.
Comment 1 Zoltan Varga 2015-06-04 16:46:37 UTC
Fixed in master/4.2. We end up at the Console.WriteLine () line now.