Quantcast
Channel: YouTrackReSharper (RSRP) - Bug and Issue Tracker
Viewing all articles
Browse latest Browse all 106942

RSRP-239690: "Convert into LINQ-expression" bug (variable naming)

$
0
0
Reporter Anatoly Nikitin (Anatoly.Nikitin) Anatoly Nikitin (Anatoly.Nikitin)
Created Mar 29, 2011 8:32:09 PM
Updated Feb 2, 2012 9:15:07 PM
Resolved Feb 2, 2012 4:30:17 PM
Priority Critical
Type Bug
Fix versions 6.1
State Fixed
Assignee Valentin Kipiatkov (valentin)
Subsystem LINQ Tools
Affected versions No Affected versions
Fixed in build 6.5.1.3937
Consider the following method:

void Foo()
{
int[] array = new [] {3, 4};
List<int> list = new List<int>();
foreach(int a in array)
{
int group = a * a;
if(group > 10)
list.Add(group/2);
}
}

Resharper suggests to convert "foreach" loop into LINQ-expression. Here is what we get after conversion:

List<int> list = (from a in array select a * a into @group where group > 10 select group / 2).ToList();

Obviously, this causes compilation error, because "group" doesn't have "@" in the beginning.

Viewing all articles
Browse latest Browse all 106942

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>