Closed CreateAndInject closed 7 years ago
source code: static void Main(string[] args) { IEnumerable col = null; foreach (var ele in col) Console.WriteLine(ele); { string ele = "7"; Console.WriteLine(ele); } }
decompile code: private static void Main(string[] args) { IEnumerable enumerable = null; string value; using (IEnumerator enumerator = enumerable.GetEnumerator()) { while (enumerator.MoveNext()) { value = enumerator.Current; Console.WriteLine(value); } } value = "7"; Console.WriteLine(value); }
If I rename any "ele", ILSpy can work normally.
This was likely fixed in the new decompiler engine (which just landed on the master branch).
source code: static void Main(string[] args) { IEnumerable col = null;
foreach (var ele in col)
Console.WriteLine(ele);
{
string ele = "7";
Console.WriteLine(ele);
}
}
decompile code: private static void Main(string[] args) { IEnumerable enumerable = null;
string value;
using (IEnumerator enumerator = enumerable.GetEnumerator())
{
while (enumerator.MoveNext())
{
value = enumerator.Current;
Console.WriteLine(value);
}
}
value = "7";
Console.WriteLine(value);
}
If I rename any "ele", ILSpy can work normally.