Looks nice. A lot of people don’t realize how expensive Linq can be. That said, my preference for most (source) codegen is in the editor – this would be nice as an editor plugin.
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.BTW I cover this in my recent book: https://www.packtpub.com/mapt/book/Application%20Development...
You could try code samples and benchmarks: https://github.com/PacktPublishing/ASP.NET-Core-1.0-High-Per...