diff --git a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
index 697ca18d97..f1b1e5777f 100644
--- a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
+++ b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
@@ -93,6 +93,7 @@
+
@@ -128,6 +129,7 @@
+
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/MonoFixed.cs b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/MonoFixed.cs
index f3ad7c3892..c420c9d418 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/MonoFixed.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/MonoFixed.cs
@@ -6,13 +6,13 @@ public unsafe void FixMultipleStrings(string text)
{
fixed (char* ptr = text)
{
- fixed (char* ptr2 = Environment.UserName)
+ fixed (char* userName = Environment.UserName)
{
- fixed (char* ptr3 = text)
+ fixed (char* ptr2 = text)
{
*ptr = 'c';
- *ptr2 = 'd';
- *ptr3 = 'e';
+ *userName = 'd';
+ *ptr2 = 'e';
}
}
}
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs
index 7e918263db..9ac730b3fe 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs
@@ -250,7 +250,7 @@ public async Task LoadsToCatch(int i)
{
throw null;
}
- catch (Exception ex2) when (i == 0)
+ catch (Exception ex) when (i == 0)
{
Console.WriteLine("First!");
if (i == 1)
@@ -258,9 +258,9 @@ public async Task LoadsToCatch(int i)
throw;
}
await Task.Yield();
- Console.WriteLine(ex2.StackTrace);
+ Console.WriteLine(ex.StackTrace);
}
- catch (Exception ex3) when (True())
+ catch (Exception ex2) when (True())
{
Console.WriteLine("Second!");
if (i == 1)
@@ -268,9 +268,9 @@ public async Task LoadsToCatch(int i)
throw;
}
await Task.Yield();
- Console.WriteLine(ex3.StackTrace);
+ Console.WriteLine(ex2.StackTrace);
}
- catch (Exception ex)
+ catch (Exception ex3)
{
Console.WriteLine("Third!");
if (i == 1)
@@ -278,7 +278,7 @@ public async Task LoadsToCatch(int i)
throw;
}
await Task.Yield();
- Console.WriteLine(ex.StackTrace);
+ Console.WriteLine(ex3.StackTrace);
}
catch when (i == 0)
{
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs
index 6fe5791806..c87ca9a7d0 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DelegateConstruction.cs
@@ -353,19 +353,19 @@ public static Action StaticAnonymousMethodNoClosure()
public static void NameConflict()
{
- // i is captured variable,
- // j is parameter in anonymous method
+ // i is local in main method,
+ // j is captured variable,
+ // k is parameter in anonymous method
// l is local in anonymous method,
- // k is local in main method
// Ensure that the decompiler doesn't introduce name conflicts
List> list = new List>();
- for (int k = 0; k < 10; k++)
+ for (int i = 0; i < 10; i++)
{
- int i;
- for (i = 0; i < 10; i++)
+ int j;
+ for (j = 0; j < 10; j++)
{
- list.Add(delegate (int j) {
- for (int l = 0; l < i; l += j)
+ list.Add(delegate (int k) {
+ for (int l = 0; l < j; l += k)
{
Console.WriteLine();
}
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/LocalFunctions.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/LocalFunctions.cs
index 677f6ebafe..ff29a4351c 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/LocalFunctions.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/LocalFunctions.cs
@@ -39,10 +39,10 @@ public int MixedLocalFunction() where T2 : ICloneable, IConvertible
#pragma warning disable CS0219
T2 t2 = default(T2);
object z = this;
- for (int j = 0; j < 10; j++)
+ for (int i = 0; i < 10; i++)
{
- int i = 0;
- i += NonStaticMethod6