Bug 16422 - Evaluator.Evaluate Issue using variables inside an Action or Func
Summary: Evaluator.Evaluate Issue using variables inside an Action or Func
Status: NEW
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 3.2.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2013-11-24 11:08 UTC by benb7760
Modified: 2013-12-11 14:08 UTC (History)
2 users (show)

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


Attachments
Visual studio project showing bug (3.15 MB, application/x-zip-compressed)
2013-11-24 11:08 UTC, benb7760
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 for Bug 16422 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description benb7760 2013-11-24 11:08:57 UTC
Created attachment 5521 [details]
Visual studio project showing bug

I am using Evaluator.Evaluate to return a Func. Inside that func i declare a variable, then another func which attempts to use this variable. Trying to use the variable inside a new Func causes an Internal Compiler Error
Comment 1 Marek Safar 2013-12-11 14:08:03 UTC
This is caused by not cloning LocalInfo's, it then points to wrong (not cloned) block. Changing this would require to make same extra cloning of TopLevelBlock names cache as we do for labels.

This can be workarounded by assigning the new to variable. E.g. changing the code to

"var temp = new Func<int>(()=>{"+......