Oh, and a question – is the generated code actually semantically identical? For most uses practical uses, it is, but I think under racy conditions it could give different results.
Effectively this transformation is the same as doing "Convert LINQ to code" and "Extract method" in R# (although those tend to sometimes be unable to codify even simple LINQ expressions).
It doesn't even look right for the example. This line:
num += num2 + 3;
Should be: num += _linqitems[i] + 3;The tool works fine, I've tried it out myself
int num2 = _linqitems[i];
from the decompiled output. I'm fairly certain that if the transformation wouldn't result in compiling code, the compiler would refuse to compile it, resulting in no assembly to decompile. They also noted somewhere to have run the System.Linq tests and only one edge case involving Min/Max and NaN failed. Tests likely wouldn't run either if the code didn't compile.