Bug 11948 - Extract method incorrectly extracts code that contains yield return
Summary: Extract method incorrectly extracts code that contains yield return
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: 4.0.3
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2013-04-24 15:55 UTC by Chris Hamons
Modified: 2014-01-08 02:10 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Chris Hamons 2013-04-24 15:55:45 UTC
I had a chunk of code that looked like

MyModel model = (MyModel)PlacePaletteEntryTransacted(name, "thing", new UIPosition()).First();
yield return WaitForStuffDone();
// Assert that it was put in the correct model position
Assert.AreEqual(x, model.Top);
Assert.AreEqual(y, model.Top);

I selected it and extract method. It created a function that didn't compile
Comment 1 Marius Ungureanu 2013-05-30 15:05:19 UTC
As an update, the extracted method has a void return type instead of IEnumerable.
Comment 2 Mike Krüger 2014-01-08 02:10:12 UTC