Bug 4641 - Mono fails to correctly compile local variable uses in lambdas inside IEnumerator method definition
Summary: Mono fails to correctly compile local variable uses in lambdas inside IEnumer...
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2012-04-25 09:50 UTC by Nicolas Vidal
Modified: 2012-04-26 09:53 UTC (History)
2 users (show)

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


Attachments
Here the .NET compiler handles it just fine, but not the mono compiler (1.68 KB, text/plain)
2012-04-25 09:50 UTC, Nicolas Vidal
Details


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 GitHub or Developer Community 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:
Status:
RESOLVED FIXED

Description Nicolas Vidal 2012-04-25 09:50:56 UTC
Created attachment 1744 [details]
Here the .NET compiler handles it just fine, but not the mono compiler

Hi there, there seems to be a problem with coroutine compilation (yield return methods) when messing with local variables and lambdas. This is quite a problem when adding lambdas to a collection of events inside a coroutine ...
The .NET compiler handles it just fine.

The bugs seems to happen in 2.10.8 and 2.6.3 (discovered it while using Unity3D)...

A temporary workaround I found is to extract all the lambda stuff out of the coroutine inside a method and call it from the coroutine ... ugly, but works.

Thanks for your troubles fixing that :)

Cheers,

Nicolas.
Comment 1 Marek Safar 2012-04-26 08:50:43 UTC
Fixed in master
Comment 3 Marek Safar 2012-04-26 09:53:22 UTC
master is what is https://github.com/mono/mono

Mono 2.11.1 was cut on Apr 20