Browse Source

Merge branch 'master' of https://github.com/icsharpcode/ILSpy into floating-point-literals-pretty-print

pull/1350/head
Siegfried Pammer 7 years ago
parent
commit
7f676ab2e9
  1. 2
      ICSharpCode.Decompiler.Console/ICSharpCode.Decompiler.Console.csproj
  2. 1
      ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
  3. 662
      ICSharpCode.Decompiler.Tests/TestCases/Correctness/InitializerTests.cs
  4. 62
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs
  5. 508
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.il
  6. 482
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.opt.il
  7. 922
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.opt.roslyn.il
  8. 1115
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.roslyn.il
  9. 22
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs
  10. 528
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.il
  11. 514
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.opt.il
  12. 1420
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.opt.roslyn.il
  13. 1431
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.roslyn.il
  14. 1297
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.cs
  15. 3504
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.il
  16. 3079
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.opt.il
  17. 3578
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.opt.roslyn.il
  18. 3281
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.roslyn.il
  19. 42
      ICSharpCode.Decompiler.Tests/TypeSystem/TypeSystemLoaderTests.cs
  20. 1
      ICSharpCode.Decompiler.Tests/TypeSystem/TypeSystemTestCase.cs
  21. 23
      ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs
  22. 2
      ICSharpCode.Decompiler/CSharp/CallBuilder.cs
  23. 2
      ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs
  24. 2
      ICSharpCode.Decompiler/CSharp/Resolver/CSharpInvocationResolveResult.cs
  25. 2
      ICSharpCode.Decompiler/CSharp/Resolver/MemberLookup.cs
  26. 13
      ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs
  27. 40
      ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs
  28. 2
      ICSharpCode.Decompiler/DecompilerSettings.cs
  29. 9
      ICSharpCode.Decompiler/Disassembler/MethodBodyDisassembler.cs
  30. 13
      ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs
  31. 12
      ICSharpCode.Decompiler/IL/ControlFlow/AsyncAwaitDecompiler.cs
  32. 23
      ICSharpCode.Decompiler/IL/ControlFlow/AwaitInCatchTransform.cs
  33. 4
      ICSharpCode.Decompiler/IL/ILReader.cs
  34. 8
      ICSharpCode.Decompiler/IL/Instructions.cs
  35. 3
      ICSharpCode.Decompiler/IL/Instructions.tt
  36. 8
      ICSharpCode.Decompiler/IL/Transforms/DynamicCallSiteTransform.cs
  37. 4
      ICSharpCode.Decompiler/IL/Transforms/ILInlining.cs
  38. 26
      ICSharpCode.Decompiler/IL/Transforms/NullCoalescingTransform.cs
  39. 158
      ICSharpCode.Decompiler/IL/Transforms/TransformArrayInitializers.cs
  40. 18
      ICSharpCode.Decompiler/IL/Transforms/TransformCollectionAndObjectInitializers.cs
  41. 41
      ICSharpCode.Decompiler/IL/Transforms/TransformExpressionTrees.cs
  42. 2
      ICSharpCode.Decompiler/IL/Transforms/UsingTransform.cs
  43. 6
      ICSharpCode.Decompiler/Metadata/MetadataExtensions.cs
  44. 52
      ICSharpCode.Decompiler/Metadata/UniversalAssemblyResolver.cs
  45. 2
      ICSharpCode.Decompiler/Semantics/LocalResolveResult.cs
  46. 4
      ICSharpCode.Decompiler/Semantics/MemberResolveResult.cs
  47. 2
      ICSharpCode.Decompiler/TypeSystem/IVariable.cs
  48. 10
      ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultParameter.cs
  49. 5
      ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultVariable.cs
  50. 2
      ICSharpCode.Decompiler/TypeSystem/Implementation/FakeMember.cs
  51. 11
      ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataField.cs
  52. 11
      ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataParameter.cs
  53. 4
      ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedField.cs
  54. 2
      ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedParameter.cs
  55. 13
      ICSharpCode.Decompiler/TypeSystem/MetadataModule.cs
  56. 3
      ILSpy/CommandLineArguments.cs
  57. 2
      ILSpy/Commands/DecompileAllCommand.cs
  58. 10
      ILSpy/DecompilationOptions.cs
  59. 42
      ILSpy/ExtensionMethods.cs
  60. 49
      ILSpy/FilterSettings.cs
  61. 1
      ILSpy/ILSpy.csproj
  62. 2
      ILSpy/ILSpySettings.cs
  63. BIN
      ILSpy/Images/ShowAll.png
  64. 44
      ILSpy/Languages/CSharpLanguage.cs
  65. 1
      ILSpy/Languages/ILLanguage.cs
  66. 8
      ILSpy/MainWindow.xaml
  67. 2
      ILSpy/Options/DecompilerSettingsPanel.xaml
  68. 28
      ILSpy/Options/DecompilerSettingsPanel.xaml.cs
  69. 42
      ILSpy/Options/DisplaySettings.cs
  70. 3
      ILSpy/Options/DisplaySettingsPanel.xaml
  71. 19
      ILSpy/Options/DisplaySettingsPanel.xaml.cs
  72. 2
      ILSpy/README.txt
  73. 4
      ILSpy/TreeNodes/DerivedTypesEntryNode.cs
  74. 4
      ILSpy/TreeNodes/EventTreeNode.cs
  75. 4
      ILSpy/TreeNodes/FieldTreeNode.cs
  76. 4
      ILSpy/TreeNodes/MethodTreeNode.cs
  77. 4
      ILSpy/TreeNodes/PropertyTreeNode.cs
  78. 2
      ILSpy/TreeNodes/ResourceNodes/ResourceTreeNode.cs
  79. 4
      ILSpy/TreeNodes/TypeTreeNode.cs
  80. 2
      doc/copyright.txt

2
ICSharpCode.Decompiler.Console/ICSharpCode.Decompiler.Console.csproj

@ -9,7 +9,7 @@ @@ -9,7 +9,7 @@
<ToolCommandName>ilspycmd</ToolCommandName>
<Version>3.5.0</Version>
<Description>Command-line decompiler using the ILSpy decompilation engine</Description>
<Copyright>Copyright 2011-2018 AlphaSierraPapa</Copyright>
<Copyright>Copyright 2011-2019 AlphaSierraPapa</Copyright>
<PackageProjectUrl>https://github.com/icsharpcode/ILSpy/</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageIconUrl>https://ilspy.net/images/icon32.png</PackageIconUrl>

1
ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj

@ -73,6 +73,7 @@ @@ -73,6 +73,7 @@
<Compile Include="TestCases\Correctness\RefLocalsAndReturns.cs" />
<Compile Include="TestCases\ILPretty\Issue1256.cs" />
<Compile Include="TestCases\ILPretty\Issue1323.cs" />
<None Include="TestCases\Pretty\AsyncMain.cs" />
<None Include="TestCases\ILPretty\Issue1325.cs" />
<Compile Include="TestCases\Pretty\ConstantsTests.cs" />
<Compile Include="TestCases\Pretty\CS73_StackAllocInitializers.cs" />

662
ICSharpCode.Decompiler.Tests/TestCases/Correctness/InitializerTests.cs

@ -129,335 +129,6 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness @@ -129,335 +129,6 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
return null;
}
#region Array Initializers
public static void Array1()
{
InitializerTests.X(InitializerTests.Y(), new int[]
{
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
});
}
public static void Array2(int a, int b, int c)
{
InitializerTests.X(InitializerTests.Y(), new int[]
{
a,
0,
b,
0,
c
});
}
public static void NestedArray(int a, int b, int c)
{
InitializerTests.X(InitializerTests.Y(), new int[][]
{
new int[]
{
1,
2,
3,
4,
5,
6,
7,
8,
9,
10
},
new int[]
{
a,
b,
c
},
new int[]
{
1,
2,
3,
4,
5,
6
}
});
}
public static void NestedNullableArray(int a, int b, int c)
{
InitializerTests.X(InitializerTests.Y(), new int?[][]
{
new int?[]
{
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
null
},
new int?[]
{
a,
b,
c,
null
},
new int?[]
{
1,
2,
3,
4,
5,
6,
null
}
});
}
public unsafe static void NestedPointerArray(int a, int b, int c)
{
InitializerTests.X(InitializerTests.Y(), new void*[][]
{
new void*[]
{
null
},
new void*[]
{
(void*)200,
null
},
new void*[]
{
(void*)100,
null
}
});
}
public static void ArrayBoolean()
{
InitializerTests.X(InitializerTests.Y(), new bool[]
{
true,
false,
true,
false,
false,
false,
true,
true
});
}
public static void ArrayByte()
{
InitializerTests.X(InitializerTests.Y(), new byte[]
{
1,
2,
3,
4,
5,
6,
7,
8,
254,
255
});
}
public static void ArraySByte()
{
InitializerTests.X(InitializerTests.Y(), new sbyte[]
{
-128,
-127,
0,
1,
2,
3,
4,
127
});
}
public static void ArrayShort()
{
InitializerTests.X(InitializerTests.Y(), new short[]
{
-32768,
-1,
0,
1,
32767
});
}
public static void ArrayUShort()
{
InitializerTests.X(InitializerTests.Y(), new ushort[]
{
0,
1,
32767,
32768,
65534,
65535
});
}
public static void ArrayInt()
{
InitializerTests.X(InitializerTests.Y(), new int[]
{
1,
-2,
2000000000,
4,
5,
-6,
7,
8,
9,
10
});
}
public static void ArrayUInt()
{
InitializerTests.X(InitializerTests.Y(), new uint[]
{
1u,
2000000000u,
3000000000u,
4u,
5u,
6u,
7u,
8u,
9u,
10u
});
}
public static void ArrayLong()
{
InitializerTests.X(InitializerTests.Y(), new long[]
{
-4999999999999999999L,
-1L,
0L,
1L,
4999999999999999999L
});
}
public static void ArrayULong()
{
InitializerTests.X(InitializerTests.Y(), new ulong[]
{
1uL,
2000000000uL,
3000000000uL,
4uL,
5uL,
6uL,
7uL,
8uL,
4999999999999999999uL,
9999999999999999999uL
});
}
public static void ArrayFloat()
{
InitializerTests.X(InitializerTests.Y(), new float[]
{
-1.5f,
0f,
1.5f,
float.NegativeInfinity,
float.PositiveInfinity,
float.NaN
});
}
public static void ArrayDouble()
{
InitializerTests.X(InitializerTests.Y(), new double[]
{
-1.5,
0.0,
1.5,
double.NegativeInfinity,
double.PositiveInfinity,
double.NaN
});
}
public static void ArrayDecimal()
{
InitializerTests.X(InitializerTests.Y(), new decimal[]
{
-100m,
0m,
100m,
-79228162514264337593543950335m,
79228162514264337593543950335m,
0.0000001m
});
}
public static void ArrayString()
{
InitializerTests.X(InitializerTests.Y(), new string[]
{
"",
null,
"Hello",
"World"
});
}
public static void ArrayEnum()
{
InitializerTests.X(InitializerTests.Y(), new InitializerTests.MyEnum[]
{
InitializerTests.MyEnum.a,
InitializerTests.MyEnum.b,
InitializerTests.MyEnum.a,
InitializerTests.MyEnum.b
});
}
public static void RecursiveArrayInitializer()
{
int[] array = new int[3];
array[0] = 1;
array[1] = 2;
array[2] = array[1] + 1;
array[0] = 0;
}
#endregion
public static void CollectionInitializerList()
{
InitializerTests.X(InitializerTests.Y(), new List<int>
@ -739,340 +410,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness @@ -739,340 +410,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
}
public int[,] MultidimensionalInit()
{
return new int[,]
{
{
0,
0,
0,
0
},
{
1,
1,
1,
1
},
{
0,
0,
0,
0
},
{
0,
0,
0,
0
},
{
0,
0,
1,
0
},
{
0,
0,
1,
0
},
{
0,
0,
1,
0
},
{
0,
0,
1,
0
},
{
0,
0,
0,
0
},
{
1,
1,
1,
1
},
{
0,
0,
0,
0
},
{
0,
0,
0,
0
},
{
0,
0,
1,
0
},
{
0,
0,
1,
0
},
{
0,
0,
1,
0
},
{
0,
0,
1,
0
}
};
}
public int[][,] MultidimensionalInit2()
{
return new int[][,]
{
new int[,]
{
{
0,
0,
0,
0
},
{
1,
1,
1,
1
},
{
0,
0,
0,
0
},
{
0,
0,
0,
0
}
},
new int[,]
{
{
0,
0,
1,
0
},
{
0,
0,
1,
0
},
{
0,
0,
1,
0
},
{
0,
0,
1,
0
}
},
new int[,]
{
{
0,
0,
0,
0
},
{
1,
1,
1,
1
},
{
0,
0,
0,
0
},
{
0,
0,
0,
0
}
},
new int[,]
{
{
0,
0,
1,
0
},
{
0,
0,
1,
0
},
{
0,
0,
1,
0
},
{
0,
0,
1,
0
}
}
};
}
public int[][,,] ArrayOfArrayOfArrayInit()
{
return new int[][,,]
{
new int[,,]
{
{
{
1,
2,
3
},
{
4,
5,
6
},
{
7,
8,
9
}
},
{
{
11,
12,
13
},
{
14,
15,
16
},
{
17,
18,
19
}
}
},
new int[,,]
{
{
{
21,
22,
23
},
{
24,
25,
26
},
{
27,
28,
29
}
},
{
{
31,
32,
33
},
{
34,
35,
36
},
{
37,
38,
39
}
}
}
};
}
class Issue855
{

62
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs

@ -51,6 +51,14 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -51,6 +51,14 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
await default(YieldAwaitable);
}
public async void AwaitDefaultHopToThreadPool()
{
// unlike YieldAwaitable which implements ICriticalNotifyCompletion,
// the HopToThreadPoolAwaitable struct only implements
// INotifyCompletion, so this results in different codegen
await default(HopToThreadPoolAwaitable);
}
public async Task SimpleVoidTaskMethod()
{
Console.WriteLine("Before");
@ -86,5 +94,59 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -86,5 +94,59 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
Console.WriteLine("Body");
}
}
#if CS60
public async Task AwaitInCatch(bool b, Task<int> task1, Task<int> task2)
{
try {
Console.WriteLine("Start try");
await task1;
Console.WriteLine("End try");
} catch (Exception) {
if (!b) {
await task2;
} else {
Console.WriteLine("No await");
}
}
}
public async Task AwaitInFinally(bool b, Task<int> task1, Task<int> task2)
{
try {
Console.WriteLine("Start try");
await task1;
Console.WriteLine("End try");
} finally {
if (!b) {
await task2;
} else {
Console.WriteLine("No await");
}
}
}
#endif
}
public struct HopToThreadPoolAwaitable : INotifyCompletion
{
public bool IsCompleted {
get;
set;
}
public HopToThreadPoolAwaitable GetAwaiter()
{
return this;
}
public void OnCompleted(Action continuation)
{
Task.Run(continuation);
}
public void GetResult()
{
}
}
}

508
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.il

@ -563,7 +563,135 @@ @@ -563,7 +563,135 @@
} // end of class '<AwaitDefaultYieldAwaitable>d__a'
.class auto ansi sealed nested private beforefieldinit '<SimpleVoidTaskMethod>d__d'
.class auto ansi sealed nested private beforefieldinit '<AwaitDefaultHopToThreadPool>d__d'
extends [mscorlib]System.ValueType
implements [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field public int32 '<>1__state'
.field public valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder '<>t__builder'
.field public class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async '<>4__this'
.field private valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable '<>u__$awaitere'
.field private object '<>t__stack'
.method private hidebysig newslot virtual final
instance void MoveNext() cil managed
{
.override [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine::MoveNext
// Code size 175 (0xaf)
.maxstack 3
.locals init (bool V_0,
class [mscorlib]System.Exception V_1,
int32 V_2,
valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable V_3,
valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable V_4)
.try
{
IL_0000: ldc.i4.1
IL_0001: stloc.0
IL_0002: ldarg.0
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>1__state'
IL_0008: stloc.2
IL_0009: ldloc.2
IL_000a: ldc.i4.0
IL_000b: beq.s IL_000f
IL_000d: br.s IL_0011
IL_000f: br.s IL_0050
IL_0011: br.s IL_0013
IL_0013: nop
IL_0014: ldloca.s V_3
IL_0016: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable
IL_001c: ldloc.3
IL_001d: stloc.3
IL_001e: ldloca.s V_3
IL_0020: call instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable::GetAwaiter()
IL_0025: stloc.3
IL_0026: ldloca.s V_3
IL_0028: call instance bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable::get_IsCompleted()
IL_002d: brtrue.s IL_006e
IL_002f: ldarg.0
IL_0030: ldc.i4.0
IL_0031: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>1__state'
IL_0036: ldarg.0
IL_0037: ldloc.3
IL_0038: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>u__$awaitere'
IL_003d: ldarg.0
IL_003e: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>t__builder'
IL_0043: ldloca.s V_3
IL_0045: ldarg.0
IL_0046: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitOnCompleted<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'>(!!0&,
!!1&)
IL_004b: nop
IL_004c: ldc.i4.0
IL_004d: stloc.0
IL_004e: leave.s IL_00ad
IL_0050: ldarg.0
IL_0051: ldfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>u__$awaitere'
IL_0056: stloc.3
IL_0057: ldarg.0
IL_0058: ldloca.s V_4
IL_005a: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable
IL_0060: ldloc.s V_4
IL_0062: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>u__$awaitere'
IL_0067: ldarg.0
IL_0068: ldc.i4.m1
IL_0069: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>1__state'
IL_006e: ldloca.s V_3
IL_0070: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable::GetResult()
IL_0075: nop
IL_0076: ldloca.s V_3
IL_0078: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable
IL_007e: leave.s IL_0098
} // end .try
catch [mscorlib]System.Exception
{
IL_0080: stloc.1
IL_0081: ldarg.0
IL_0082: ldc.i4.s -2
IL_0084: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>1__state'
IL_0089: ldarg.0
IL_008a: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>t__builder'
IL_008f: ldloc.1
IL_0090: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetException(class [mscorlib]System.Exception)
IL_0095: nop
IL_0096: leave.s IL_00ad
} // end handler
IL_0098: nop
IL_0099: ldarg.0
IL_009a: ldc.i4.s -2
IL_009c: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>1__state'
IL_00a1: ldarg.0
IL_00a2: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>t__builder'
IL_00a7: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetResult()
IL_00ac: nop
IL_00ad: nop
IL_00ae: ret
} // end of method '<AwaitDefaultHopToThreadPool>d__d'::MoveNext
.method private hidebysig newslot virtual final
instance void SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine param0) cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 )
.override [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine::SetStateMachine
// Code size 13 (0xd)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>t__builder'
IL_0006: ldarg.1
IL_0007: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine)
IL_000c: ret
} // end of method '<AwaitDefaultHopToThreadPool>d__d'::SetStateMachine
} // end of class '<AwaitDefaultHopToThreadPool>d__d'
.class auto ansi sealed nested private beforefieldinit '<SimpleVoidTaskMethod>d__10'
extends [mscorlib]System.ValueType
implements [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine
{
@ -571,7 +699,7 @@ @@ -571,7 +699,7 @@
.field public int32 '<>1__state'
.field public valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder '<>t__builder'
.field public class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async '<>4__this'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter '<>u__$awaitere'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter '<>u__$awaiter11'
.field private object '<>t__stack'
.method private hidebysig newslot virtual final
instance void MoveNext() cil managed
@ -589,7 +717,7 @@ @@ -589,7 +717,7 @@
IL_0000: ldc.i4.1
IL_0001: stloc.0
IL_0002: ldarg.0
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>1__state'
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>1__state'
IL_0008: stloc.2
IL_0009: ldloc.2
IL_000a: ldc.i4.0
@ -616,15 +744,15 @@ @@ -616,15 +744,15 @@
IL_0041: ldarg.0
IL_0042: ldc.i4.0
IL_0043: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>1__state'
IL_0043: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>1__state'
IL_0048: ldarg.0
IL_0049: ldloc.3
IL_004a: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>u__$awaitere'
IL_004a: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>u__$awaiter11'
IL_004f: ldarg.0
IL_0050: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>t__builder'
IL_0050: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>t__builder'
IL_0055: ldloca.s V_3
IL_0057: ldarg.0
IL_0058: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'>(!!0&,
IL_0058: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'>(!!0&,
!!1&)
IL_005d: nop
IL_005e: ldc.i4.0
@ -632,16 +760,16 @@ @@ -632,16 +760,16 @@
IL_0060: leave.s IL_00ca
IL_0062: ldarg.0
IL_0063: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>u__$awaitere'
IL_0063: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>u__$awaiter11'
IL_0068: stloc.3
IL_0069: ldarg.0
IL_006a: ldloca.s V_4
IL_006c: initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
IL_0072: ldloc.s V_4
IL_0074: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>u__$awaitere'
IL_0074: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>u__$awaiter11'
IL_0079: ldarg.0
IL_007a: ldc.i4.m1
IL_007b: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>1__state'
IL_007b: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>1__state'
IL_0080: ldloca.s V_3
IL_0082: call instance void [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::GetResult()
IL_0087: nop
@ -658,9 +786,9 @@ @@ -658,9 +786,9 @@
IL_009d: stloc.1
IL_009e: ldarg.0
IL_009f: ldc.i4.s -2
IL_00a1: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>1__state'
IL_00a1: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>1__state'
IL_00a6: ldarg.0
IL_00a7: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>t__builder'
IL_00a7: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>t__builder'
IL_00ac: ldloc.1
IL_00ad: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetException(class [mscorlib]System.Exception)
IL_00b2: nop
@ -670,14 +798,14 @@ @@ -670,14 +798,14 @@
IL_00b5: nop
IL_00b6: ldarg.0
IL_00b7: ldc.i4.s -2
IL_00b9: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>1__state'
IL_00b9: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>1__state'
IL_00be: ldarg.0
IL_00bf: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>t__builder'
IL_00bf: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>t__builder'
IL_00c4: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetResult()
IL_00c9: nop
IL_00ca: nop
IL_00cb: ret
} // end of method '<SimpleVoidTaskMethod>d__d'::MoveNext
} // end of method '<SimpleVoidTaskMethod>d__10'::MoveNext
.method private hidebysig newslot virtual final
instance void SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine param0) cil managed
@ -687,15 +815,15 @@ @@ -687,15 +815,15 @@
// Code size 13 (0xd)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>t__builder'
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>t__builder'
IL_0006: ldarg.1
IL_0007: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine)
IL_000c: ret
} // end of method '<SimpleVoidTaskMethod>d__d'::SetStateMachine
} // end of method '<SimpleVoidTaskMethod>d__10'::SetStateMachine
} // end of class '<SimpleVoidTaskMethod>d__d'
} // end of class '<SimpleVoidTaskMethod>d__10'
.class auto ansi sealed nested private beforefieldinit '<TaskMethodWithoutAwait>d__10'
.class auto ansi sealed nested private beforefieldinit '<TaskMethodWithoutAwait>d__13'
extends [mscorlib]System.ValueType
implements [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine
{
@ -731,9 +859,9 @@ @@ -731,9 +859,9 @@
IL_0014: stloc.1
IL_0015: ldarg.0
IL_0016: ldc.i4.s -2
IL_0018: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>1__state'
IL_0018: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>1__state'
IL_001d: ldarg.0
IL_001e: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>t__builder'
IL_001e: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>t__builder'
IL_0023: ldloc.1
IL_0024: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetException(class [mscorlib]System.Exception)
IL_0029: nop
@ -743,14 +871,14 @@ @@ -743,14 +871,14 @@
IL_002c: nop
IL_002d: ldarg.0
IL_002e: ldc.i4.s -2
IL_0030: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>1__state'
IL_0030: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>1__state'
IL_0035: ldarg.0
IL_0036: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>t__builder'
IL_0036: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>t__builder'
IL_003b: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetResult()
IL_0040: nop
IL_0041: nop
IL_0042: ret
} // end of method '<TaskMethodWithoutAwait>d__10'::MoveNext
} // end of method '<TaskMethodWithoutAwait>d__13'::MoveNext
.method private hidebysig newslot virtual final
instance void SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine param0) cil managed
@ -760,15 +888,15 @@ @@ -760,15 +888,15 @@
// Code size 13 (0xd)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>t__builder'
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>t__builder'
IL_0006: ldarg.1
IL_0007: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine)
IL_000c: ret
} // end of method '<TaskMethodWithoutAwait>d__10'::SetStateMachine
} // end of method '<TaskMethodWithoutAwait>d__13'::SetStateMachine
} // end of class '<TaskMethodWithoutAwait>d__10'
} // end of class '<TaskMethodWithoutAwait>d__13'
.class auto ansi sealed nested private beforefieldinit '<SimpleBoolTaskMethod>d__12'
.class auto ansi sealed nested private beforefieldinit '<SimpleBoolTaskMethod>d__15'
extends [mscorlib]System.ValueType
implements [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine
{
@ -776,7 +904,7 @@ @@ -776,7 +904,7 @@
.field public int32 '<>1__state'
.field public valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> '<>t__builder'
.field public class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async '<>4__this'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter '<>u__$awaiter13'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter '<>u__$awaiter16'
.field private object '<>t__stack'
.method private hidebysig newslot virtual final
instance void MoveNext() cil managed
@ -795,7 +923,7 @@ @@ -795,7 +923,7 @@
IL_0000: ldc.i4.1
IL_0001: stloc.0
IL_0002: ldarg.0
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>1__state'
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>1__state'
IL_0008: stloc.3
IL_0009: ldloc.3
IL_000a: ldc.i4.0
@ -822,15 +950,15 @@ @@ -822,15 +950,15 @@
IL_0042: ldarg.0
IL_0043: ldc.i4.0
IL_0044: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>1__state'
IL_0044: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>1__state'
IL_0049: ldarg.0
IL_004a: ldloc.s V_4
IL_004c: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>u__$awaiter13'
IL_004c: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>u__$awaiter16'
IL_0051: ldarg.0
IL_0052: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>t__builder'
IL_0052: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>t__builder'
IL_0057: ldloca.s V_4
IL_0059: ldarg.0
IL_005a: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'>(!!0&,
IL_005a: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'>(!!0&,
!!1&)
IL_005f: nop
IL_0060: ldc.i4.0
@ -838,16 +966,16 @@ @@ -838,16 +966,16 @@
IL_0062: leave.s IL_00d0
IL_0064: ldarg.0
IL_0065: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>u__$awaiter13'
IL_0065: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>u__$awaiter16'
IL_006a: stloc.s V_4
IL_006c: ldarg.0
IL_006d: ldloca.s V_5
IL_006f: initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
IL_0075: ldloc.s V_5
IL_0077: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>u__$awaiter13'
IL_0077: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>u__$awaiter16'
IL_007c: ldarg.0
IL_007d: ldc.i4.m1
IL_007e: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>1__state'
IL_007e: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>1__state'
IL_0083: ldloca.s V_4
IL_0085: call instance void [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::GetResult()
IL_008a: nop
@ -866,9 +994,9 @@ @@ -866,9 +994,9 @@
IL_00a2: stloc.2
IL_00a3: ldarg.0
IL_00a4: ldc.i4.s -2
IL_00a6: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>1__state'
IL_00a6: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>1__state'
IL_00ab: ldarg.0
IL_00ac: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>t__builder'
IL_00ac: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>t__builder'
IL_00b1: ldloc.2
IL_00b2: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::SetException(class [mscorlib]System.Exception)
IL_00b7: nop
@ -878,15 +1006,15 @@ @@ -878,15 +1006,15 @@
IL_00ba: nop
IL_00bb: ldarg.0
IL_00bc: ldc.i4.s -2
IL_00be: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>1__state'
IL_00be: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>1__state'
IL_00c3: ldarg.0
IL_00c4: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>t__builder'
IL_00c4: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>t__builder'
IL_00c9: ldloc.1
IL_00ca: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::SetResult(!0)
IL_00cf: nop
IL_00d0: nop
IL_00d1: ret
} // end of method '<SimpleBoolTaskMethod>d__12'::MoveNext
} // end of method '<SimpleBoolTaskMethod>d__15'::MoveNext
.method private hidebysig newslot virtual final
instance void SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine param0) cil managed
@ -896,15 +1024,15 @@ @@ -896,15 +1024,15 @@
// Code size 13 (0xd)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>t__builder'
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>t__builder'
IL_0006: ldarg.1
IL_0007: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine)
IL_000c: ret
} // end of method '<SimpleBoolTaskMethod>d__12'::SetStateMachine
} // end of method '<SimpleBoolTaskMethod>d__15'::SetStateMachine
} // end of class '<SimpleBoolTaskMethod>d__12'
} // end of class '<SimpleBoolTaskMethod>d__15'
.class auto ansi sealed nested private beforefieldinit '<TwoAwaitsWithDifferentAwaiterTypes>d__15'
.class auto ansi sealed nested private beforefieldinit '<TwoAwaitsWithDifferentAwaiterTypes>d__18'
extends [mscorlib]System.ValueType
implements [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine
{
@ -912,9 +1040,9 @@ @@ -912,9 +1040,9 @@
.field public int32 '<>1__state'
.field public valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder '<>t__builder'
.field public class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async '<>4__this'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> '<>u__$awaiter16'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> '<>u__$awaiter19'
.field private object '<>t__stack'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter '<>u__$awaiter17'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter '<>u__$awaiter1a'
.method private hidebysig newslot virtual final
instance void MoveNext() cil managed
{
@ -934,7 +1062,7 @@ @@ -934,7 +1062,7 @@
IL_0000: ldc.i4.1
IL_0001: stloc.0
IL_0002: ldarg.0
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_0008: stloc.2
IL_0009: ldloc.2
IL_000a: switch (
@ -953,7 +1081,7 @@ @@ -953,7 +1081,7 @@
IL_0028: call void [mscorlib]System.Console::WriteLine(string)
IL_002d: nop
IL_002e: ldarg.0
IL_002f: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>4__this'
IL_002f: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>4__this'
IL_0034: callvirt instance class [mscorlib]System.Threading.Tasks.Task`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async::SimpleBoolTaskMethod()
IL_0039: callvirt instance valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<!0> class [mscorlib]System.Threading.Tasks.Task`1<bool>::GetAwaiter()
IL_003e: stloc.3
@ -963,15 +1091,15 @@ @@ -963,15 +1091,15 @@
IL_0048: ldarg.0
IL_0049: ldc.i4.0
IL_004a: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_004a: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_004f: ldarg.0
IL_0050: ldloc.3
IL_0051: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>u__$awaiter16'
IL_0051: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>u__$awaiter19'
IL_0056: ldarg.0
IL_0057: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>t__builder'
IL_0057: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>t__builder'
IL_005c: ldloca.s V_3
IL_005e: ldarg.0
IL_005f: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'>(!!0&,
IL_005f: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'>(!!0&,
!!1&)
IL_0064: nop
IL_0065: ldc.i4.0
@ -979,16 +1107,16 @@ @@ -979,16 +1107,16 @@
IL_0067: leave IL_0152
IL_006c: ldarg.0
IL_006d: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>u__$awaiter16'
IL_006d: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>u__$awaiter19'
IL_0072: stloc.3
IL_0073: ldarg.0
IL_0074: ldloca.s V_4
IL_0076: initobj valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>
IL_007c: ldloc.s V_4
IL_007e: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>u__$awaiter16'
IL_007e: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>u__$awaiter19'
IL_0083: ldarg.0
IL_0084: ldc.i4.m1
IL_0085: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_0085: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_008a: ldloca.s V_3
IL_008c: call instance !0 valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>::GetResult()
IL_0091: ldloca.s V_3
@ -1011,15 +1139,15 @@ @@ -1011,15 +1139,15 @@
IL_00c6: ldarg.0
IL_00c7: ldc.i4.1
IL_00c8: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_00c8: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_00cd: ldarg.0
IL_00ce: ldloc.s V_6
IL_00d0: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>u__$awaiter17'
IL_00d0: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>u__$awaiter1a'
IL_00d5: ldarg.0
IL_00d6: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>t__builder'
IL_00d6: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>t__builder'
IL_00db: ldloca.s V_6
IL_00dd: ldarg.0
IL_00de: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'>(!!0&,
IL_00de: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'>(!!0&,
!!1&)
IL_00e3: nop
IL_00e4: ldc.i4.0
@ -1027,16 +1155,16 @@ @@ -1027,16 +1155,16 @@
IL_00e6: leave.s IL_0152
IL_00e8: ldarg.0
IL_00e9: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>u__$awaiter17'
IL_00e9: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>u__$awaiter1a'
IL_00ee: stloc.s V_6
IL_00f0: ldarg.0
IL_00f1: ldloca.s V_7
IL_00f3: initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
IL_00f9: ldloc.s V_7
IL_00fb: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>u__$awaiter17'
IL_00fb: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>u__$awaiter1a'
IL_0100: ldarg.0
IL_0101: ldc.i4.m1
IL_0102: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_0102: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_0107: ldloca.s V_6
IL_0109: call instance void [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::GetResult()
IL_010e: nop
@ -1054,9 +1182,9 @@ @@ -1054,9 +1182,9 @@
IL_0125: stloc.1
IL_0126: ldarg.0
IL_0127: ldc.i4.s -2
IL_0129: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_0129: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_012e: ldarg.0
IL_012f: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>t__builder'
IL_012f: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>t__builder'
IL_0134: ldloc.1
IL_0135: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetException(class [mscorlib]System.Exception)
IL_013a: nop
@ -1066,14 +1194,14 @@ @@ -1066,14 +1194,14 @@
IL_013d: nop
IL_013e: ldarg.0
IL_013f: ldc.i4.s -2
IL_0141: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_0141: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_0146: ldarg.0
IL_0147: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>t__builder'
IL_0147: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>t__builder'
IL_014c: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetResult()
IL_0151: nop
IL_0152: nop
IL_0153: ret
} // end of method '<TwoAwaitsWithDifferentAwaiterTypes>d__15'::MoveNext
} // end of method '<TwoAwaitsWithDifferentAwaiterTypes>d__18'::MoveNext
.method private hidebysig newslot virtual final
instance void SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine param0) cil managed
@ -1083,15 +1211,15 @@ @@ -1083,15 +1211,15 @@
// Code size 13 (0xd)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>t__builder'
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>t__builder'
IL_0006: ldarg.1
IL_0007: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine)
IL_000c: ret
} // end of method '<TwoAwaitsWithDifferentAwaiterTypes>d__15'::SetStateMachine
} // end of method '<TwoAwaitsWithDifferentAwaiterTypes>d__18'::SetStateMachine
} // end of class '<TwoAwaitsWithDifferentAwaiterTypes>d__15'
} // end of class '<TwoAwaitsWithDifferentAwaiterTypes>d__18'
.class auto ansi sealed nested private beforefieldinit '<AwaitInLoopCondition>d__19'
.class auto ansi sealed nested private beforefieldinit '<AwaitInLoopCondition>d__1c'
extends [mscorlib]System.ValueType
implements [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine
{
@ -1099,7 +1227,7 @@ @@ -1099,7 +1227,7 @@
.field public int32 '<>1__state'
.field public valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder '<>t__builder'
.field public class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async '<>4__this'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> '<>u__$awaiter1a'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> '<>u__$awaiter1d'
.field private object '<>t__stack'
.method private hidebysig newslot virtual final
instance void MoveNext() cil managed
@ -1118,7 +1246,7 @@ @@ -1118,7 +1246,7 @@
IL_0000: ldc.i4.1
IL_0001: stloc.0
IL_0002: ldarg.0
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>1__state'
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>1__state'
IL_0008: stloc.2
IL_0009: ldloc.2
IL_000a: ldc.i4.0
@ -1139,7 +1267,7 @@ @@ -1139,7 +1267,7 @@
IL_0021: nop
IL_0022: nop
IL_0023: ldarg.0
IL_0024: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>4__this'
IL_0024: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>4__this'
IL_0029: callvirt instance class [mscorlib]System.Threading.Tasks.Task`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async::SimpleBoolTaskMethod()
IL_002e: callvirt instance valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<!0> class [mscorlib]System.Threading.Tasks.Task`1<bool>::GetAwaiter()
IL_0033: stloc.3
@ -1149,15 +1277,15 @@ @@ -1149,15 +1277,15 @@
IL_003d: ldarg.0
IL_003e: ldc.i4.0
IL_003f: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>1__state'
IL_003f: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>1__state'
IL_0044: ldarg.0
IL_0045: ldloc.3
IL_0046: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>u__$awaiter1a'
IL_0046: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>u__$awaiter1d'
IL_004b: ldarg.0
IL_004c: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>t__builder'
IL_004c: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>t__builder'
IL_0051: ldloca.s V_3
IL_0053: ldarg.0
IL_0054: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'>(!!0&,
IL_0054: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'>(!!0&,
!!1&)
IL_0059: nop
IL_005a: ldc.i4.0
@ -1165,16 +1293,16 @@ @@ -1165,16 +1293,16 @@
IL_005c: leave.s IL_00c0
IL_005e: ldarg.0
IL_005f: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>u__$awaiter1a'
IL_005f: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>u__$awaiter1d'
IL_0064: stloc.3
IL_0065: ldarg.0
IL_0066: ldloca.s V_4
IL_0068: initobj valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>
IL_006e: ldloc.s V_4
IL_0070: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>u__$awaiter1a'
IL_0070: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>u__$awaiter1d'
IL_0075: ldarg.0
IL_0076: ldc.i4.m1
IL_0077: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>1__state'
IL_0077: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>1__state'
IL_007c: ldloca.s V_3
IL_007e: call instance !0 valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>::GetResult()
IL_0083: ldloca.s V_3
@ -1191,9 +1319,9 @@ @@ -1191,9 +1319,9 @@
IL_0093: stloc.1
IL_0094: ldarg.0
IL_0095: ldc.i4.s -2
IL_0097: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>1__state'
IL_0097: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>1__state'
IL_009c: ldarg.0
IL_009d: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>t__builder'
IL_009d: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>t__builder'
IL_00a2: ldloc.1
IL_00a3: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetException(class [mscorlib]System.Exception)
IL_00a8: nop
@ -1203,14 +1331,14 @@ @@ -1203,14 +1331,14 @@
IL_00ab: nop
IL_00ac: ldarg.0
IL_00ad: ldc.i4.s -2
IL_00af: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>1__state'
IL_00af: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>1__state'
IL_00b4: ldarg.0
IL_00b5: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>t__builder'
IL_00b5: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>t__builder'
IL_00ba: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetResult()
IL_00bf: nop
IL_00c0: nop
IL_00c1: ret
} // end of method '<AwaitInLoopCondition>d__19'::MoveNext
} // end of method '<AwaitInLoopCondition>d__1c'::MoveNext
.method private hidebysig newslot virtual final
instance void SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine param0) cil managed
@ -1220,13 +1348,13 @@ @@ -1220,13 +1348,13 @@
// Code size 13 (0xd)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>t__builder'
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>t__builder'
IL_0006: ldarg.1
IL_0007: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine)
IL_000c: ret
} // end of method '<AwaitInLoopCondition>d__19'::SetStateMachine
} // end of method '<AwaitInLoopCondition>d__1c'::SetStateMachine
} // end of class '<AwaitInLoopCondition>d__19'
} // end of class '<AwaitInLoopCondition>d__1c'
.method public hidebysig instance void
SimpleVoidMethod() cil managed
@ -1331,12 +1459,12 @@ @@ -1331,12 +1459,12 @@
.method public hidebysig instance void
AwaitYield() cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 44 49 43 53 68 61 72 70 43 6F 64 65 2E 44 // ..DICSharpCode.D
65 63 6F 6D 70 69 6C 65 72 2E 54 65 73 74 73 2E // ecompiler.Tests.
54 65 73 74 43 61 73 65 73 2E 50 72 65 74 74 79 // TestCases.Pretty
2E 41 73 79 6E 63 2B 3C 41 77 61 69 74 59 69 65 // .Async+<AwaitYie
6C 64 3E 64 5F 5F 37 00 00 ) // ld>d__7..
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
// Code size 48 (0x30)
.maxstack 2
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitYield>d__7' V_0,
@ -1395,38 +1523,72 @@ @@ -1395,38 +1523,72 @@
IL_002f: ret
} // end of method Async::AwaitDefaultYieldAwaitable
.method public hidebysig instance void
AwaitDefaultHopToThreadPool() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 55 49 43 53 68 61 72 70 43 6F 64 65 2E 44 // ..UICSharpCode.D
65 63 6F 6D 70 69 6C 65 72 2E 54 65 73 74 73 2E // ecompiler.Tests.
54 65 73 74 43 61 73 65 73 2E 50 72 65 74 74 79 // TestCases.Pretty
2E 41 73 79 6E 63 2B 3C 41 77 61 69 74 44 65 66 // .Async+<AwaitDef
61 75 6C 74 48 6F 70 54 6F 54 68 72 65 61 64 50 // aultHopToThreadP
6F 6F 6C 3E 64 5F 5F 64 00 00 ) // ool>d__d..
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
// Code size 48 (0x30)
.maxstack 2
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d' V_0,
valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder V_1)
IL_0000: ldloca.s V_0
IL_0002: ldarg.0
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>4__this'
IL_0008: ldloca.s V_0
IL_000a: call valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Create()
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>t__builder'
IL_0014: ldloca.s V_0
IL_0016: ldc.i4.m1
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>1__state'
IL_001c: ldloca.s V_0
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>t__builder'
IL_0023: stloc.1
IL_0024: ldloca.s V_1
IL_0026: ldloca.s V_0
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'>(!!0&)
IL_002d: br.s IL_002f
IL_002f: ret
} // end of method Async::AwaitDefaultHopToThreadPool
.method public hidebysig instance class [mscorlib]System.Threading.Tasks.Task
SimpleVoidTaskMethod() cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 4E 49 43 53 68 61 72 70 43 6F 64 65 2E 44 // ..NICSharpCode.D
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 4F 49 43 53 68 61 72 70 43 6F 64 65 2E 44 // ..OICSharpCode.D
65 63 6F 6D 70 69 6C 65 72 2E 54 65 73 74 73 2E // ecompiler.Tests.
54 65 73 74 43 61 73 65 73 2E 50 72 65 74 74 79 // TestCases.Pretty
2E 41 73 79 6E 63 2B 3C 53 69 6D 70 6C 65 56 6F // .Async+<SimpleVo
69 64 54 61 73 6B 4D 65 74 68 6F 64 3E 64 5F 5F // idTaskMethod>d__
64 00 00 ) // d..
31 30 00 00 ) // 10..
// Code size 62 (0x3e)
.maxstack 2
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d' V_0,
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10' V_0,
class [mscorlib]System.Threading.Tasks.Task V_1,
valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder V_2)
IL_0000: ldloca.s V_0
IL_0002: ldarg.0
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>4__this'
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>4__this'
IL_0008: ldloca.s V_0
IL_000a: call valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::Create()
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>t__builder'
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>t__builder'
IL_0014: ldloca.s V_0
IL_0016: ldc.i4.m1
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>1__state'
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>1__state'
IL_001c: ldloca.s V_0
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>t__builder'
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>t__builder'
IL_0023: stloc.2
IL_0024: ldloca.s V_2
IL_0026: ldloca.s V_0
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'>(!!0&)
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'>(!!0&)
IL_002d: ldloca.s V_0
IL_002f: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>t__builder'
IL_002f: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>t__builder'
IL_0034: call instance class [mscorlib]System.Threading.Tasks.Task [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::get_Task()
IL_0039: stloc.1
IL_003a: br.s IL_003c
@ -1438,35 +1600,35 @@ @@ -1438,35 +1600,35 @@
.method public hidebysig instance class [mscorlib]System.Threading.Tasks.Task
TaskMethodWithoutAwait() cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 51 49 43 53 68 61 72 70 43 6F 64 65 2E 44 // ..QICSharpCode.D
65 63 6F 6D 70 69 6C 65 72 2E 54 65 73 74 73 2E // ecompiler.Tests.
54 65 73 74 43 61 73 65 73 2E 50 72 65 74 74 79 // TestCases.Pretty
2E 41 73 79 6E 63 2B 3C 54 61 73 6B 4D 65 74 68 // .Async+<TaskMeth
6F 64 57 69 74 68 6F 75 74 41 77 61 69 74 3E 64 // odWithoutAwait>d
5F 5F 31 30 00 00 ) // __10..
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
5F 5F 31 33 00 00 ) // __13..
// Code size 62 (0x3e)
.maxstack 2
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10' V_0,
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13' V_0,
class [mscorlib]System.Threading.Tasks.Task V_1,
valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder V_2)
IL_0000: ldloca.s V_0
IL_0002: ldarg.0
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>4__this'
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>4__this'
IL_0008: ldloca.s V_0
IL_000a: call valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::Create()
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>t__builder'
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>t__builder'
IL_0014: ldloca.s V_0
IL_0016: ldc.i4.m1
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>1__state'
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>1__state'
IL_001c: ldloca.s V_0
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>t__builder'
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>t__builder'
IL_0023: stloc.2
IL_0024: ldloca.s V_2
IL_0026: ldloca.s V_0
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'>(!!0&)
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'>(!!0&)
IL_002d: ldloca.s V_0
IL_002f: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>t__builder'
IL_002f: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>t__builder'
IL_0034: call instance class [mscorlib]System.Threading.Tasks.Task [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::get_Task()
IL_0039: stloc.1
IL_003a: br.s IL_003c
@ -1484,29 +1646,29 @@ @@ -1484,29 +1646,29 @@
54 65 73 74 43 61 73 65 73 2E 50 72 65 74 74 79 // TestCases.Pretty
2E 41 73 79 6E 63 2B 3C 53 69 6D 70 6C 65 42 6F // .Async+<SimpleBo
6F 6C 54 61 73 6B 4D 65 74 68 6F 64 3E 64 5F 5F // olTaskMethod>d__
31 32 00 00 ) // 12..
31 35 00 00 ) // 15..
// Code size 62 (0x3e)
.maxstack 2
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12' V_0,
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15' V_0,
class [mscorlib]System.Threading.Tasks.Task`1<bool> V_1,
valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> V_2)
IL_0000: ldloca.s V_0
IL_0002: ldarg.0
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>4__this'
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>4__this'
IL_0008: ldloca.s V_0
IL_000a: call valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<!0> valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::Create()
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>t__builder'
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>t__builder'
IL_0014: ldloca.s V_0
IL_0016: ldc.i4.m1
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>1__state'
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>1__state'
IL_001c: ldloca.s V_0
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>t__builder'
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>t__builder'
IL_0023: stloc.2
IL_0024: ldloca.s V_2
IL_0026: ldloca.s V_0
IL_0028: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'>(!!0&)
IL_0028: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'>(!!0&)
IL_002d: ldloca.s V_0
IL_002f: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>t__builder'
IL_002f: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>t__builder'
IL_0034: call instance class [mscorlib]System.Threading.Tasks.Task`1<!0> valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::get_Task()
IL_0039: stloc.1
IL_003a: br.s IL_003c
@ -1518,33 +1680,33 @@ @@ -1518,33 +1680,33 @@
.method public hidebysig instance void
TwoAwaitsWithDifferentAwaiterTypes() cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 5D 49 43 53 68 61 72 70 43 6F 64 65 2E 44 // ..]ICSharpCode.D
65 63 6F 6D 70 69 6C 65 72 2E 54 65 73 74 73 2E // ecompiler.Tests.
54 65 73 74 43 61 73 65 73 2E 50 72 65 74 74 79 // TestCases.Pretty
2E 41 73 79 6E 63 2B 3C 54 77 6F 41 77 61 69 74 // .Async+<TwoAwait
73 57 69 74 68 44 69 66 66 65 72 65 6E 74 41 77 // sWithDifferentAw
61 69 74 65 72 54 79 70 65 73 3E 64 5F 5F 31 35 // aiterTypes>d__15
61 69 74 65 72 54 79 70 65 73 3E 64 5F 5F 31 38 // aiterTypes>d__18
00 00 )
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
// Code size 48 (0x30)
.maxstack 2
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15' V_0,
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18' V_0,
valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder V_1)
IL_0000: ldloca.s V_0
IL_0002: ldarg.0
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>4__this'
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>4__this'
IL_0008: ldloca.s V_0
IL_000a: call valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Create()
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>t__builder'
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>t__builder'
IL_0014: ldloca.s V_0
IL_0016: ldc.i4.m1
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_001c: ldloca.s V_0
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>t__builder'
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>t__builder'
IL_0023: stloc.1
IL_0024: ldloca.s V_1
IL_0026: ldloca.s V_0
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'>(!!0&)
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'>(!!0&)
IL_002d: br.s IL_002f
IL_002f: ret
@ -1553,32 +1715,32 @@ @@ -1553,32 +1715,32 @@
.method public hidebysig instance void
AwaitInLoopCondition() cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 4F 49 43 53 68 61 72 70 43 6F 64 65 2E 44 // ..OICSharpCode.D
65 63 6F 6D 70 69 6C 65 72 2E 54 65 73 74 73 2E // ecompiler.Tests.
54 65 73 74 43 61 73 65 73 2E 50 72 65 74 74 79 // TestCases.Pretty
2E 41 73 79 6E 63 2B 3C 41 77 61 69 74 49 6E 4C // .Async+<AwaitInL
6F 6F 70 43 6F 6E 64 69 74 69 6F 6E 3E 64 5F 5F // oopCondition>d__
31 39 00 00 ) // 19..
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
31 63 00 00 ) // 1c..
// Code size 48 (0x30)
.maxstack 2
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19' V_0,
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c' V_0,
valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder V_1)
IL_0000: ldloca.s V_0
IL_0002: ldarg.0
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>4__this'
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>4__this'
IL_0008: ldloca.s V_0
IL_000a: call valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Create()
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>t__builder'
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>t__builder'
IL_0014: ldloca.s V_0
IL_0016: ldc.i4.m1
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>1__state'
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>1__state'
IL_001c: ldloca.s V_0
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>t__builder'
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>t__builder'
IL_0023: stloc.1
IL_0024: ldloca.s V_1
IL_0026: ldloca.s V_0
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'>(!!0&)
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'>(!!0&)
IL_002d: br.s IL_002f
IL_002f: ret
@ -1596,6 +1758,84 @@ @@ -1596,6 +1758,84 @@
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async
.class public sequential ansi sealed beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable
extends [mscorlib]System.ValueType
implements [mscorlib]System.Runtime.CompilerServices.INotifyCompletion
{
.field private bool '<IsCompleted>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.method public hidebysig specialname instance bool
get_IsCompleted() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 11 (0xb)
.maxstack 1
.locals init (bool V_0)
IL_0000: ldarg.0
IL_0001: ldfld bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable::'<IsCompleted>k__BackingField'
IL_0006: stloc.0
IL_0007: br.s IL_0009
IL_0009: ldloc.0
IL_000a: ret
} // end of method HopToThreadPoolAwaitable::get_IsCompleted
.method public hidebysig specialname instance void
set_IsCompleted(bool 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable::'<IsCompleted>k__BackingField'
IL_0007: ret
} // end of method HopToThreadPoolAwaitable::set_IsCompleted
.method public hidebysig instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable
GetAwaiter() cil managed
{
// Code size 12 (0xc)
.maxstack 1
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable V_0)
IL_0000: nop
IL_0001: ldarg.0
IL_0002: ldobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable
IL_0007: stloc.0
IL_0008: br.s IL_000a
IL_000a: ldloc.0
IL_000b: ret
} // end of method HopToThreadPoolAwaitable::GetAwaiter
.method public hidebysig newslot virtual final
instance void OnCompleted(class [mscorlib]System.Action continuation) cil managed
{
// Code size 9 (0x9)
.maxstack 8
IL_0000: nop
IL_0001: ldarg.1
IL_0002: call class [mscorlib]System.Threading.Tasks.Task [mscorlib]System.Threading.Tasks.Task::Run(class [mscorlib]System.Action)
IL_0007: pop
IL_0008: ret
} // end of method HopToThreadPoolAwaitable::OnCompleted
.method public hidebysig instance void
GetResult() cil managed
{
// Code size 2 (0x2)
.maxstack 8
IL_0000: nop
IL_0001: ret
} // end of method HopToThreadPoolAwaitable::GetResult
.property instance bool IsCompleted()
{
.get instance bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable::get_IsCompleted()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable::set_IsCompleted(bool)
} // end of property HopToThreadPoolAwaitable::IsCompleted
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable
// =============================================================

482
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.opt.il

@ -504,7 +504,124 @@ @@ -504,7 +504,124 @@
} // end of class '<AwaitDefaultYieldAwaitable>d__a'
.class auto ansi sealed nested private beforefieldinit '<SimpleVoidTaskMethod>d__d'
.class auto ansi sealed nested private beforefieldinit '<AwaitDefaultHopToThreadPool>d__d'
extends [mscorlib]System.ValueType
implements [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field public int32 '<>1__state'
.field public valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder '<>t__builder'
.field public class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async '<>4__this'
.field private valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable '<>u__$awaitere'
.field private object '<>t__stack'
.method private hidebysig newslot virtual final
instance void MoveNext() cil managed
{
.override [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine::MoveNext
// Code size 166 (0xa6)
.maxstack 3
.locals init (bool V_0,
class [mscorlib]System.Exception V_1,
int32 V_2,
valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable V_3,
valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable V_4,
valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable V_5,
valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable V_6)
.try
{
IL_0000: ldc.i4.1
IL_0001: stloc.0
IL_0002: ldarg.0
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>1__state'
IL_0008: stloc.2
IL_0009: ldloc.2
IL_000a: ldc.i4.0
IL_000b: beq.s IL_004b
IL_000d: ldloca.s V_3
IL_000f: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable
IL_0015: ldloc.3
IL_0016: stloc.s V_4
IL_0018: ldloca.s V_4
IL_001a: call instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable::GetAwaiter()
IL_001f: stloc.s V_5
IL_0021: ldloca.s V_5
IL_0023: call instance bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable::get_IsCompleted()
IL_0028: brtrue.s IL_006a
IL_002a: ldarg.0
IL_002b: ldc.i4.0
IL_002c: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>1__state'
IL_0031: ldarg.0
IL_0032: ldloc.s V_5
IL_0034: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>u__$awaitere'
IL_0039: ldarg.0
IL_003a: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>t__builder'
IL_003f: ldloca.s V_5
IL_0041: ldarg.0
IL_0042: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitOnCompleted<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'>(!!0&,
!!1&)
IL_0047: ldc.i4.0
IL_0048: stloc.0
IL_0049: leave.s IL_00a5
IL_004b: ldarg.0
IL_004c: ldfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>u__$awaitere'
IL_0051: stloc.s V_5
IL_0053: ldarg.0
IL_0054: ldloca.s V_6
IL_0056: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable
IL_005c: ldloc.s V_6
IL_005e: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>u__$awaitere'
IL_0063: ldarg.0
IL_0064: ldc.i4.m1
IL_0065: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>1__state'
IL_006a: ldloca.s V_5
IL_006c: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable::GetResult()
IL_0071: ldloca.s V_5
IL_0073: initobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable
IL_0079: leave.s IL_0092
} // end .try
catch [mscorlib]System.Exception
{
IL_007b: stloc.1
IL_007c: ldarg.0
IL_007d: ldc.i4.s -2
IL_007f: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>1__state'
IL_0084: ldarg.0
IL_0085: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>t__builder'
IL_008a: ldloc.1
IL_008b: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetException(class [mscorlib]System.Exception)
IL_0090: leave.s IL_00a5
} // end handler
IL_0092: ldarg.0
IL_0093: ldc.i4.s -2
IL_0095: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>1__state'
IL_009a: ldarg.0
IL_009b: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>t__builder'
IL_00a0: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetResult()
IL_00a5: ret
} // end of method '<AwaitDefaultHopToThreadPool>d__d'::MoveNext
.method private hidebysig newslot virtual final
instance void SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine param0) cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 )
.override [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine::SetStateMachine
// Code size 13 (0xd)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>t__builder'
IL_0006: ldarg.1
IL_0007: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine)
IL_000c: ret
} // end of method '<AwaitDefaultHopToThreadPool>d__d'::SetStateMachine
} // end of class '<AwaitDefaultHopToThreadPool>d__d'
.class auto ansi sealed nested private beforefieldinit '<SimpleVoidTaskMethod>d__10'
extends [mscorlib]System.ValueType
implements [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine
{
@ -512,7 +629,7 @@ @@ -512,7 +629,7 @@
.field public int32 '<>1__state'
.field public valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder '<>t__builder'
.field public class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async '<>4__this'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter '<>u__$awaitere'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter '<>u__$awaiter11'
.field private object '<>t__stack'
.method private hidebysig newslot virtual final
instance void MoveNext() cil managed
@ -530,7 +647,7 @@ @@ -530,7 +647,7 @@
IL_0000: ldc.i4.1
IL_0001: stloc.0
IL_0002: ldarg.0
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>1__state'
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>1__state'
IL_0008: stloc.2
IL_0009: ldloc.2
IL_000a: ldc.i4.0
@ -549,31 +666,31 @@ @@ -549,31 +666,31 @@
IL_0039: ldarg.0
IL_003a: ldc.i4.0
IL_003b: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>1__state'
IL_003b: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>1__state'
IL_0040: ldarg.0
IL_0041: ldloc.3
IL_0042: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>u__$awaitere'
IL_0042: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>u__$awaiter11'
IL_0047: ldarg.0
IL_0048: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>t__builder'
IL_0048: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>t__builder'
IL_004d: ldloca.s V_3
IL_004f: ldarg.0
IL_0050: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'>(!!0&,
IL_0050: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'>(!!0&,
!!1&)
IL_0055: ldc.i4.0
IL_0056: stloc.0
IL_0057: leave.s IL_00bc
IL_0059: ldarg.0
IL_005a: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>u__$awaitere'
IL_005a: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>u__$awaiter11'
IL_005f: stloc.3
IL_0060: ldarg.0
IL_0061: ldloca.s V_4
IL_0063: initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
IL_0069: ldloc.s V_4
IL_006b: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>u__$awaitere'
IL_006b: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>u__$awaiter11'
IL_0070: ldarg.0
IL_0071: ldc.i4.m1
IL_0072: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>1__state'
IL_0072: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>1__state'
IL_0077: ldloca.s V_3
IL_0079: call instance void [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::GetResult()
IL_007e: ldloca.s V_3
@ -588,9 +705,9 @@ @@ -588,9 +705,9 @@
IL_0092: stloc.1
IL_0093: ldarg.0
IL_0094: ldc.i4.s -2
IL_0096: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>1__state'
IL_0096: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>1__state'
IL_009b: ldarg.0
IL_009c: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>t__builder'
IL_009c: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>t__builder'
IL_00a1: ldloc.1
IL_00a2: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetException(class [mscorlib]System.Exception)
IL_00a7: leave.s IL_00bc
@ -598,12 +715,12 @@ @@ -598,12 +715,12 @@
} // end handler
IL_00a9: ldarg.0
IL_00aa: ldc.i4.s -2
IL_00ac: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>1__state'
IL_00ac: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>1__state'
IL_00b1: ldarg.0
IL_00b2: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>t__builder'
IL_00b2: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>t__builder'
IL_00b7: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetResult()
IL_00bc: ret
} // end of method '<SimpleVoidTaskMethod>d__d'::MoveNext
} // end of method '<SimpleVoidTaskMethod>d__10'::MoveNext
.method private hidebysig newslot virtual final
instance void SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine param0) cil managed
@ -613,15 +730,15 @@ @@ -613,15 +730,15 @@
// Code size 13 (0xd)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>t__builder'
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>t__builder'
IL_0006: ldarg.1
IL_0007: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine)
IL_000c: ret
} // end of method '<SimpleVoidTaskMethod>d__d'::SetStateMachine
} // end of method '<SimpleVoidTaskMethod>d__10'::SetStateMachine
} // end of class '<SimpleVoidTaskMethod>d__d'
} // end of class '<SimpleVoidTaskMethod>d__10'
.class auto ansi sealed nested private beforefieldinit '<TaskMethodWithoutAwait>d__10'
.class auto ansi sealed nested private beforefieldinit '<TaskMethodWithoutAwait>d__13'
extends [mscorlib]System.ValueType
implements [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine
{
@ -651,9 +768,9 @@ @@ -651,9 +768,9 @@
IL_000e: stloc.1
IL_000f: ldarg.0
IL_0010: ldc.i4.s -2
IL_0012: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>1__state'
IL_0012: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>1__state'
IL_0017: ldarg.0
IL_0018: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>t__builder'
IL_0018: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>t__builder'
IL_001d: ldloc.1
IL_001e: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetException(class [mscorlib]System.Exception)
IL_0023: leave.s IL_0038
@ -661,12 +778,12 @@ @@ -661,12 +778,12 @@
} // end handler
IL_0025: ldarg.0
IL_0026: ldc.i4.s -2
IL_0028: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>1__state'
IL_0028: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>1__state'
IL_002d: ldarg.0
IL_002e: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>t__builder'
IL_002e: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>t__builder'
IL_0033: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetResult()
IL_0038: ret
} // end of method '<TaskMethodWithoutAwait>d__10'::MoveNext
} // end of method '<TaskMethodWithoutAwait>d__13'::MoveNext
.method private hidebysig newslot virtual final
instance void SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine param0) cil managed
@ -676,15 +793,15 @@ @@ -676,15 +793,15 @@
// Code size 13 (0xd)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>t__builder'
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>t__builder'
IL_0006: ldarg.1
IL_0007: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine)
IL_000c: ret
} // end of method '<TaskMethodWithoutAwait>d__10'::SetStateMachine
} // end of method '<TaskMethodWithoutAwait>d__13'::SetStateMachine
} // end of class '<TaskMethodWithoutAwait>d__10'
} // end of class '<TaskMethodWithoutAwait>d__13'
.class auto ansi sealed nested private beforefieldinit '<SimpleBoolTaskMethod>d__12'
.class auto ansi sealed nested private beforefieldinit '<SimpleBoolTaskMethod>d__15'
extends [mscorlib]System.ValueType
implements [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine
{
@ -692,7 +809,7 @@ @@ -692,7 +809,7 @@
.field public int32 '<>1__state'
.field public valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> '<>t__builder'
.field public class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async '<>4__this'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter '<>u__$awaiter13'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter '<>u__$awaiter16'
.field private object '<>t__stack'
.method private hidebysig newslot virtual final
instance void MoveNext() cil managed
@ -711,7 +828,7 @@ @@ -711,7 +828,7 @@
IL_0000: ldc.i4.1
IL_0001: stloc.0
IL_0002: ldarg.0
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>1__state'
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>1__state'
IL_0008: stloc.3
IL_0009: ldloc.3
IL_000a: ldc.i4.0
@ -730,31 +847,31 @@ @@ -730,31 +847,31 @@
IL_003a: ldarg.0
IL_003b: ldc.i4.0
IL_003c: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>1__state'
IL_003c: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>1__state'
IL_0041: ldarg.0
IL_0042: ldloc.s V_4
IL_0044: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>u__$awaiter13'
IL_0044: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>u__$awaiter16'
IL_0049: ldarg.0
IL_004a: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>t__builder'
IL_004a: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>t__builder'
IL_004f: ldloca.s V_4
IL_0051: ldarg.0
IL_0052: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'>(!!0&,
IL_0052: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'>(!!0&,
!!1&)
IL_0057: ldc.i4.0
IL_0058: stloc.0
IL_0059: leave.s IL_00c2
IL_005b: ldarg.0
IL_005c: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>u__$awaiter13'
IL_005c: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>u__$awaiter16'
IL_0061: stloc.s V_4
IL_0063: ldarg.0
IL_0064: ldloca.s V_5
IL_0066: initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
IL_006c: ldloc.s V_5
IL_006e: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>u__$awaiter13'
IL_006e: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>u__$awaiter16'
IL_0073: ldarg.0
IL_0074: ldc.i4.m1
IL_0075: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>1__state'
IL_0075: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>1__state'
IL_007a: ldloca.s V_4
IL_007c: call instance void [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::GetResult()
IL_0081: ldloca.s V_4
@ -771,9 +888,9 @@ @@ -771,9 +888,9 @@
IL_0097: stloc.2
IL_0098: ldarg.0
IL_0099: ldc.i4.s -2
IL_009b: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>1__state'
IL_009b: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>1__state'
IL_00a0: ldarg.0
IL_00a1: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>t__builder'
IL_00a1: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>t__builder'
IL_00a6: ldloc.2
IL_00a7: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::SetException(class [mscorlib]System.Exception)
IL_00ac: leave.s IL_00c2
@ -781,13 +898,13 @@ @@ -781,13 +898,13 @@
} // end handler
IL_00ae: ldarg.0
IL_00af: ldc.i4.s -2
IL_00b1: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>1__state'
IL_00b1: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>1__state'
IL_00b6: ldarg.0
IL_00b7: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>t__builder'
IL_00b7: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>t__builder'
IL_00bc: ldloc.1
IL_00bd: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::SetResult(!0)
IL_00c2: ret
} // end of method '<SimpleBoolTaskMethod>d__12'::MoveNext
} // end of method '<SimpleBoolTaskMethod>d__15'::MoveNext
.method private hidebysig newslot virtual final
instance void SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine param0) cil managed
@ -797,15 +914,15 @@ @@ -797,15 +914,15 @@
// Code size 13 (0xd)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>t__builder'
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>t__builder'
IL_0006: ldarg.1
IL_0007: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine)
IL_000c: ret
} // end of method '<SimpleBoolTaskMethod>d__12'::SetStateMachine
} // end of method '<SimpleBoolTaskMethod>d__15'::SetStateMachine
} // end of class '<SimpleBoolTaskMethod>d__12'
} // end of class '<SimpleBoolTaskMethod>d__15'
.class auto ansi sealed nested private beforefieldinit '<TwoAwaitsWithDifferentAwaiterTypes>d__15'
.class auto ansi sealed nested private beforefieldinit '<TwoAwaitsWithDifferentAwaiterTypes>d__18'
extends [mscorlib]System.ValueType
implements [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine
{
@ -813,9 +930,9 @@ @@ -813,9 +930,9 @@
.field public int32 '<>1__state'
.field public valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder '<>t__builder'
.field public class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async '<>4__this'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> '<>u__$awaiter16'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> '<>u__$awaiter19'
.field private object '<>t__stack'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter '<>u__$awaiter17'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter '<>u__$awaiter1a'
.method private hidebysig newslot virtual final
instance void MoveNext() cil managed
{
@ -834,7 +951,7 @@ @@ -834,7 +951,7 @@
IL_0000: ldc.i4.1
IL_0001: stloc.0
IL_0002: ldarg.0
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_0008: stloc.2
IL_0009: ldloc.2
IL_000a: switch (
@ -843,7 +960,7 @@ @@ -843,7 +960,7 @@
IL_0017: ldstr "Before"
IL_001c: call void [mscorlib]System.Console::WriteLine(string)
IL_0021: ldarg.0
IL_0022: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>4__this'
IL_0022: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>4__this'
IL_0027: callvirt instance class [mscorlib]System.Threading.Tasks.Task`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async::SimpleBoolTaskMethod()
IL_002c: callvirt instance valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<!0> class [mscorlib]System.Threading.Tasks.Task`1<bool>::GetAwaiter()
IL_0031: stloc.3
@ -853,31 +970,31 @@ @@ -853,31 +970,31 @@
IL_003b: ldarg.0
IL_003c: ldc.i4.0
IL_003d: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_003d: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_0042: ldarg.0
IL_0043: ldloc.3
IL_0044: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>u__$awaiter16'
IL_0044: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>u__$awaiter19'
IL_0049: ldarg.0
IL_004a: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>t__builder'
IL_004a: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>t__builder'
IL_004f: ldloca.s V_3
IL_0051: ldarg.0
IL_0052: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'>(!!0&,
IL_0052: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'>(!!0&,
!!1&)
IL_0057: ldc.i4.0
IL_0058: stloc.0
IL_0059: leave IL_0135
IL_005e: ldarg.0
IL_005f: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>u__$awaiter16'
IL_005f: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>u__$awaiter19'
IL_0064: stloc.3
IL_0065: ldarg.0
IL_0066: ldloca.s V_4
IL_0068: initobj valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>
IL_006e: ldloc.s V_4
IL_0070: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>u__$awaiter16'
IL_0070: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>u__$awaiter19'
IL_0075: ldarg.0
IL_0076: ldc.i4.m1
IL_0077: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_0077: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_007c: ldloca.s V_3
IL_007e: call instance !0 valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>::GetResult()
IL_0083: ldloca.s V_3
@ -895,31 +1012,31 @@ @@ -895,31 +1012,31 @@
IL_00b0: ldarg.0
IL_00b1: ldc.i4.1
IL_00b2: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_00b2: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_00b7: ldarg.0
IL_00b8: ldloc.s V_5
IL_00ba: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>u__$awaiter17'
IL_00ba: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>u__$awaiter1a'
IL_00bf: ldarg.0
IL_00c0: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>t__builder'
IL_00c0: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>t__builder'
IL_00c5: ldloca.s V_5
IL_00c7: ldarg.0
IL_00c8: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'>(!!0&,
IL_00c8: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'>(!!0&,
!!1&)
IL_00cd: ldc.i4.0
IL_00ce: stloc.0
IL_00cf: leave.s IL_0135
IL_00d1: ldarg.0
IL_00d2: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>u__$awaiter17'
IL_00d2: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>u__$awaiter1a'
IL_00d7: stloc.s V_5
IL_00d9: ldarg.0
IL_00da: ldloca.s V_6
IL_00dc: initobj [mscorlib]System.Runtime.CompilerServices.TaskAwaiter
IL_00e2: ldloc.s V_6
IL_00e4: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>u__$awaiter17'
IL_00e4: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>u__$awaiter1a'
IL_00e9: ldarg.0
IL_00ea: ldc.i4.m1
IL_00eb: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_00eb: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_00f0: ldloca.s V_5
IL_00f2: call instance void [mscorlib]System.Runtime.CompilerServices.TaskAwaiter::GetResult()
IL_00f7: ldloca.s V_5
@ -934,9 +1051,9 @@ @@ -934,9 +1051,9 @@
IL_010b: stloc.1
IL_010c: ldarg.0
IL_010d: ldc.i4.s -2
IL_010f: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_010f: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_0114: ldarg.0
IL_0115: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>t__builder'
IL_0115: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>t__builder'
IL_011a: ldloc.1
IL_011b: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetException(class [mscorlib]System.Exception)
IL_0120: leave.s IL_0135
@ -944,12 +1061,12 @@ @@ -944,12 +1061,12 @@
} // end handler
IL_0122: ldarg.0
IL_0123: ldc.i4.s -2
IL_0125: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_0125: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_012a: ldarg.0
IL_012b: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>t__builder'
IL_012b: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>t__builder'
IL_0130: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetResult()
IL_0135: ret
} // end of method '<TwoAwaitsWithDifferentAwaiterTypes>d__15'::MoveNext
} // end of method '<TwoAwaitsWithDifferentAwaiterTypes>d__18'::MoveNext
.method private hidebysig newslot virtual final
instance void SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine param0) cil managed
@ -959,15 +1076,15 @@ @@ -959,15 +1076,15 @@
// Code size 13 (0xd)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>t__builder'
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>t__builder'
IL_0006: ldarg.1
IL_0007: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine)
IL_000c: ret
} // end of method '<TwoAwaitsWithDifferentAwaiterTypes>d__15'::SetStateMachine
} // end of method '<TwoAwaitsWithDifferentAwaiterTypes>d__18'::SetStateMachine
} // end of class '<TwoAwaitsWithDifferentAwaiterTypes>d__15'
} // end of class '<TwoAwaitsWithDifferentAwaiterTypes>d__18'
.class auto ansi sealed nested private beforefieldinit '<AwaitInLoopCondition>d__19'
.class auto ansi sealed nested private beforefieldinit '<AwaitInLoopCondition>d__1c'
extends [mscorlib]System.ValueType
implements [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine
{
@ -975,7 +1092,7 @@ @@ -975,7 +1092,7 @@
.field public int32 '<>1__state'
.field public valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder '<>t__builder'
.field public class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async '<>4__this'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> '<>u__$awaiter1a'
.field private valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> '<>u__$awaiter1d'
.field private object '<>t__stack'
.method private hidebysig newslot virtual final
instance void MoveNext() cil managed
@ -993,7 +1110,7 @@ @@ -993,7 +1110,7 @@
IL_0000: ldc.i4.1
IL_0001: stloc.0
IL_0002: ldarg.0
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>1__state'
IL_0003: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>1__state'
IL_0008: stloc.2
IL_0009: ldloc.2
IL_000a: ldc.i4.0
@ -1004,7 +1121,7 @@ @@ -1004,7 +1121,7 @@
IL_000f: ldstr "Body"
IL_0014: call void [mscorlib]System.Console::WriteLine(string)
IL_0019: ldarg.0
IL_001a: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>4__this'
IL_001a: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>4__this'
IL_001f: callvirt instance class [mscorlib]System.Threading.Tasks.Task`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async::SimpleBoolTaskMethod()
IL_0024: callvirt instance valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<!0> class [mscorlib]System.Threading.Tasks.Task`1<bool>::GetAwaiter()
IL_0029: stloc.3
@ -1014,31 +1131,31 @@ @@ -1014,31 +1131,31 @@
IL_0033: ldarg.0
IL_0034: ldc.i4.0
IL_0035: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>1__state'
IL_0035: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>1__state'
IL_003a: ldarg.0
IL_003b: ldloc.3
IL_003c: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>u__$awaiter1a'
IL_003c: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>u__$awaiter1d'
IL_0041: ldarg.0
IL_0042: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>t__builder'
IL_0042: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>t__builder'
IL_0047: ldloca.s V_3
IL_0049: ldarg.0
IL_004a: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'>(!!0&,
IL_004a: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::AwaitUnsafeOnCompleted<valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>,valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'>(!!0&,
!!1&)
IL_004f: ldc.i4.0
IL_0050: stloc.0
IL_0051: leave.s IL_00ae
IL_0053: ldarg.0
IL_0054: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>u__$awaiter1a'
IL_0054: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>u__$awaiter1d'
IL_0059: stloc.3
IL_005a: ldarg.0
IL_005b: ldloca.s V_4
IL_005d: initobj valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>
IL_0063: ldloc.s V_4
IL_0065: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>u__$awaiter1a'
IL_0065: stfld valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>u__$awaiter1d'
IL_006a: ldarg.0
IL_006b: ldc.i4.m1
IL_006c: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>1__state'
IL_006c: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>1__state'
IL_0071: ldloca.s V_3
IL_0073: call instance !0 valuetype [mscorlib]System.Runtime.CompilerServices.TaskAwaiter`1<bool>::GetResult()
IL_0078: ldloca.s V_3
@ -1053,9 +1170,9 @@ @@ -1053,9 +1170,9 @@
IL_0084: stloc.1
IL_0085: ldarg.0
IL_0086: ldc.i4.s -2
IL_0088: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>1__state'
IL_0088: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>1__state'
IL_008d: ldarg.0
IL_008e: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>t__builder'
IL_008e: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>t__builder'
IL_0093: ldloc.1
IL_0094: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetException(class [mscorlib]System.Exception)
IL_0099: leave.s IL_00ae
@ -1063,12 +1180,12 @@ @@ -1063,12 +1180,12 @@
} // end handler
IL_009b: ldarg.0
IL_009c: ldc.i4.s -2
IL_009e: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>1__state'
IL_009e: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>1__state'
IL_00a3: ldarg.0
IL_00a4: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>t__builder'
IL_00a4: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>t__builder'
IL_00a9: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetResult()
IL_00ae: ret
} // end of method '<AwaitInLoopCondition>d__19'::MoveNext
} // end of method '<AwaitInLoopCondition>d__1c'::MoveNext
.method private hidebysig newslot virtual final
instance void SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine param0) cil managed
@ -1078,13 +1195,13 @@ @@ -1078,13 +1195,13 @@
// Code size 13 (0xd)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>t__builder'
IL_0001: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>t__builder'
IL_0006: ldarg.1
IL_0007: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::SetStateMachine(class [mscorlib]System.Runtime.CompilerServices.IAsyncStateMachine)
IL_000c: ret
} // end of method '<AwaitInLoopCondition>d__19'::SetStateMachine
} // end of method '<AwaitInLoopCondition>d__1c'::SetStateMachine
} // end of class '<AwaitInLoopCondition>d__19'
} // end of class '<AwaitInLoopCondition>d__1c'
.method public hidebysig instance void
SimpleVoidMethod() cil managed
@ -1183,12 +1300,12 @@ @@ -1183,12 +1300,12 @@
.method public hidebysig instance void
AwaitYield() cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 44 49 43 53 68 61 72 70 43 6F 64 65 2E 44 // ..DICSharpCode.D
65 63 6F 6D 70 69 6C 65 72 2E 54 65 73 74 73 2E // ecompiler.Tests.
54 65 73 74 43 61 73 65 73 2E 50 72 65 74 74 79 // TestCases.Pretty
2E 41 73 79 6E 63 2B 3C 41 77 61 69 74 59 69 65 // .Async+<AwaitYie
6C 64 3E 64 5F 5F 37 00 00 ) // ld>d__7..
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
// Code size 46 (0x2e)
.maxstack 2
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitYield>d__7' V_0,
@ -1243,37 +1360,69 @@ @@ -1243,37 +1360,69 @@
IL_002d: ret
} // end of method Async::AwaitDefaultYieldAwaitable
.method public hidebysig instance void
AwaitDefaultHopToThreadPool() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 55 49 43 53 68 61 72 70 43 6F 64 65 2E 44 // ..UICSharpCode.D
65 63 6F 6D 70 69 6C 65 72 2E 54 65 73 74 73 2E // ecompiler.Tests.
54 65 73 74 43 61 73 65 73 2E 50 72 65 74 74 79 // TestCases.Pretty
2E 41 73 79 6E 63 2B 3C 41 77 61 69 74 44 65 66 // .Async+<AwaitDef
61 75 6C 74 48 6F 70 54 6F 54 68 72 65 61 64 50 // aultHopToThreadP
6F 6F 6C 3E 64 5F 5F 64 00 00 ) // ool>d__d..
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
// Code size 46 (0x2e)
.maxstack 2
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d' V_0,
valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder V_1)
IL_0000: ldloca.s V_0
IL_0002: ldarg.0
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>4__this'
IL_0008: ldloca.s V_0
IL_000a: call valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Create()
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>t__builder'
IL_0014: ldloca.s V_0
IL_0016: ldc.i4.m1
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>1__state'
IL_001c: ldloca.s V_0
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'::'<>t__builder'
IL_0023: stloc.1
IL_0024: ldloca.s V_1
IL_0026: ldloca.s V_0
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitDefaultHopToThreadPool>d__d'>(!!0&)
IL_002d: ret
} // end of method Async::AwaitDefaultHopToThreadPool
.method public hidebysig instance class [mscorlib]System.Threading.Tasks.Task
SimpleVoidTaskMethod() cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 4E 49 43 53 68 61 72 70 43 6F 64 65 2E 44 // ..NICSharpCode.D
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 4F 49 43 53 68 61 72 70 43 6F 64 65 2E 44 // ..OICSharpCode.D
65 63 6F 6D 70 69 6C 65 72 2E 54 65 73 74 73 2E // ecompiler.Tests.
54 65 73 74 43 61 73 65 73 2E 50 72 65 74 74 79 // TestCases.Pretty
2E 41 73 79 6E 63 2B 3C 53 69 6D 70 6C 65 56 6F // .Async+<SimpleVo
69 64 54 61 73 6B 4D 65 74 68 6F 64 3E 64 5F 5F // idTaskMethod>d__
64 00 00 ) // d..
31 30 00 00 ) // 10..
// Code size 58 (0x3a)
.maxstack 2
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d' V_0,
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10' V_0,
valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder V_1)
IL_0000: ldloca.s V_0
IL_0002: ldarg.0
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>4__this'
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>4__this'
IL_0008: ldloca.s V_0
IL_000a: call valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::Create()
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>t__builder'
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>t__builder'
IL_0014: ldloca.s V_0
IL_0016: ldc.i4.m1
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>1__state'
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>1__state'
IL_001c: ldloca.s V_0
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>t__builder'
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>t__builder'
IL_0023: stloc.1
IL_0024: ldloca.s V_1
IL_0026: ldloca.s V_0
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'>(!!0&)
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'>(!!0&)
IL_002d: ldloca.s V_0
IL_002f: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__d'::'<>t__builder'
IL_002f: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleVoidTaskMethod>d__10'::'<>t__builder'
IL_0034: call instance class [mscorlib]System.Threading.Tasks.Task [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::get_Task()
IL_0039: ret
} // end of method Async::SimpleVoidTaskMethod
@ -1281,34 +1430,34 @@ @@ -1281,34 +1430,34 @@
.method public hidebysig instance class [mscorlib]System.Threading.Tasks.Task
TaskMethodWithoutAwait() cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 51 49 43 53 68 61 72 70 43 6F 64 65 2E 44 // ..QICSharpCode.D
65 63 6F 6D 70 69 6C 65 72 2E 54 65 73 74 73 2E // ecompiler.Tests.
54 65 73 74 43 61 73 65 73 2E 50 72 65 74 74 79 // TestCases.Pretty
2E 41 73 79 6E 63 2B 3C 54 61 73 6B 4D 65 74 68 // .Async+<TaskMeth
6F 64 57 69 74 68 6F 75 74 41 77 61 69 74 3E 64 // odWithoutAwait>d
5F 5F 31 30 00 00 ) // __10..
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
5F 5F 31 33 00 00 ) // __13..
// Code size 58 (0x3a)
.maxstack 2
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10' V_0,
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13' V_0,
valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder V_1)
IL_0000: ldloca.s V_0
IL_0002: ldarg.0
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>4__this'
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>4__this'
IL_0008: ldloca.s V_0
IL_000a: call valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::Create()
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>t__builder'
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>t__builder'
IL_0014: ldloca.s V_0
IL_0016: ldc.i4.m1
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>1__state'
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>1__state'
IL_001c: ldloca.s V_0
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>t__builder'
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>t__builder'
IL_0023: stloc.1
IL_0024: ldloca.s V_1
IL_0026: ldloca.s V_0
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'>(!!0&)
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'>(!!0&)
IL_002d: ldloca.s V_0
IL_002f: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__10'::'<>t__builder'
IL_002f: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TaskMethodWithoutAwait>d__13'::'<>t__builder'
IL_0034: call instance class [mscorlib]System.Threading.Tasks.Task [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder::get_Task()
IL_0039: ret
} // end of method Async::TaskMethodWithoutAwait
@ -1322,28 +1471,28 @@ @@ -1322,28 +1471,28 @@
54 65 73 74 43 61 73 65 73 2E 50 72 65 74 74 79 // TestCases.Pretty
2E 41 73 79 6E 63 2B 3C 53 69 6D 70 6C 65 42 6F // .Async+<SimpleBo
6F 6C 54 61 73 6B 4D 65 74 68 6F 64 3E 64 5F 5F // olTaskMethod>d__
31 32 00 00 ) // 12..
31 35 00 00 ) // 15..
// Code size 58 (0x3a)
.maxstack 2
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12' V_0,
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15' V_0,
valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> V_1)
IL_0000: ldloca.s V_0
IL_0002: ldarg.0
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>4__this'
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>4__this'
IL_0008: ldloca.s V_0
IL_000a: call valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<!0> valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::Create()
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>t__builder'
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>t__builder'
IL_0014: ldloca.s V_0
IL_0016: ldc.i4.m1
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>1__state'
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>1__state'
IL_001c: ldloca.s V_0
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>t__builder'
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>t__builder'
IL_0023: stloc.1
IL_0024: ldloca.s V_1
IL_0026: ldloca.s V_0
IL_0028: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'>(!!0&)
IL_0028: call instance void valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'>(!!0&)
IL_002d: ldloca.s V_0
IL_002f: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__12'::'<>t__builder'
IL_002f: ldflda valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<SimpleBoolTaskMethod>d__15'::'<>t__builder'
IL_0034: call instance class [mscorlib]System.Threading.Tasks.Task`1<!0> valuetype [mscorlib]System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1<bool>::get_Task()
IL_0039: ret
} // end of method Async::SimpleBoolTaskMethod
@ -1351,65 +1500,65 @@ @@ -1351,65 +1500,65 @@
.method public hidebysig instance void
TwoAwaitsWithDifferentAwaiterTypes() cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 5D 49 43 53 68 61 72 70 43 6F 64 65 2E 44 // ..]ICSharpCode.D
65 63 6F 6D 70 69 6C 65 72 2E 54 65 73 74 73 2E // ecompiler.Tests.
54 65 73 74 43 61 73 65 73 2E 50 72 65 74 74 79 // TestCases.Pretty
2E 41 73 79 6E 63 2B 3C 54 77 6F 41 77 61 69 74 // .Async+<TwoAwait
73 57 69 74 68 44 69 66 66 65 72 65 6E 74 41 77 // sWithDifferentAw
61 69 74 65 72 54 79 70 65 73 3E 64 5F 5F 31 35 // aiterTypes>d__15
61 69 74 65 72 54 79 70 65 73 3E 64 5F 5F 31 38 // aiterTypes>d__18
00 00 )
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
// Code size 46 (0x2e)
.maxstack 2
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15' V_0,
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18' V_0,
valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder V_1)
IL_0000: ldloca.s V_0
IL_0002: ldarg.0
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>4__this'
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>4__this'
IL_0008: ldloca.s V_0
IL_000a: call valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Create()
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>t__builder'
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>t__builder'
IL_0014: ldloca.s V_0
IL_0016: ldc.i4.m1
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>1__state'
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>1__state'
IL_001c: ldloca.s V_0
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'::'<>t__builder'
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'::'<>t__builder'
IL_0023: stloc.1
IL_0024: ldloca.s V_1
IL_0026: ldloca.s V_0
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__15'>(!!0&)
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<TwoAwaitsWithDifferentAwaiterTypes>d__18'>(!!0&)
IL_002d: ret
} // end of method Async::TwoAwaitsWithDifferentAwaiterTypes
.method public hidebysig instance void
AwaitInLoopCondition() cil managed
{
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.AsyncStateMachineAttribute::.ctor(class [mscorlib]System.Type) = ( 01 00 4F 49 43 53 68 61 72 70 43 6F 64 65 2E 44 // ..OICSharpCode.D
65 63 6F 6D 70 69 6C 65 72 2E 54 65 73 74 73 2E // ecompiler.Tests.
54 65 73 74 43 61 73 65 73 2E 50 72 65 74 74 79 // TestCases.Pretty
2E 41 73 79 6E 63 2B 3C 41 77 61 69 74 49 6E 4C // .Async+<AwaitInL
6F 6F 70 43 6F 6E 64 69 74 69 6F 6E 3E 64 5F 5F // oopCondition>d__
31 39 00 00 ) // 19..
.custom instance void [mscorlib]System.Diagnostics.DebuggerStepThroughAttribute::.ctor() = ( 01 00 00 00 )
31 63 00 00 ) // 1c..
// Code size 46 (0x2e)
.maxstack 2
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19' V_0,
.locals init (valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c' V_0,
valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder V_1)
IL_0000: ldloca.s V_0
IL_0002: ldarg.0
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>4__this'
IL_0003: stfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>4__this'
IL_0008: ldloca.s V_0
IL_000a: call valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Create()
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>t__builder'
IL_000f: stfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>t__builder'
IL_0014: ldloca.s V_0
IL_0016: ldc.i4.m1
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>1__state'
IL_0017: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>1__state'
IL_001c: ldloca.s V_0
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'::'<>t__builder'
IL_001e: ldfld valuetype [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'::'<>t__builder'
IL_0023: stloc.1
IL_0024: ldloca.s V_1
IL_0026: ldloca.s V_0
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__19'>(!!0&)
IL_0028: call instance void [mscorlib]System.Runtime.CompilerServices.AsyncVoidMethodBuilder::Start<valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async/'<AwaitInLoopCondition>d__1c'>(!!0&)
IL_002d: ret
} // end of method Async::AwaitInLoopCondition
@ -1425,6 +1574,71 @@ @@ -1425,6 +1574,71 @@
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Async
.class public sequential ansi sealed beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable
extends [mscorlib]System.ValueType
implements [mscorlib]System.Runtime.CompilerServices.INotifyCompletion
{
.field private bool '<IsCompleted>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.method public hidebysig specialname instance bool
get_IsCompleted() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldfld bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable::'<IsCompleted>k__BackingField'
IL_0006: ret
} // end of method HopToThreadPoolAwaitable::get_IsCompleted
.method public hidebysig specialname instance void
set_IsCompleted(bool 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable::'<IsCompleted>k__BackingField'
IL_0007: ret
} // end of method HopToThreadPoolAwaitable::set_IsCompleted
.method public hidebysig instance valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable
GetAwaiter() cil managed
{
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldobj ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable
IL_0006: ret
} // end of method HopToThreadPoolAwaitable::GetAwaiter
.method public hidebysig newslot virtual final
instance void OnCompleted(class [mscorlib]System.Action continuation) cil managed
{
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.1
IL_0001: call class [mscorlib]System.Threading.Tasks.Task [mscorlib]System.Threading.Tasks.Task::Run(class [mscorlib]System.Action)
IL_0006: pop
IL_0007: ret
} // end of method HopToThreadPoolAwaitable::OnCompleted
.method public hidebysig instance void
GetResult() cil managed
{
// Code size 1 (0x1)
.maxstack 8
IL_0000: ret
} // end of method HopToThreadPoolAwaitable::GetResult
.property instance bool IsCompleted()
{
.get instance bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable::get_IsCompleted()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable::set_IsCompleted(bool)
} // end of property HopToThreadPoolAwaitable::IsCompleted
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.HopToThreadPoolAwaitable
// =============================================================

922
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.opt.roslyn.il

File diff suppressed because it is too large Load Diff

1115
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.roslyn.il

File diff suppressed because it is too large Load Diff

22
ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs

@ -21,6 +21,7 @@ using System.Collections.Generic; @@ -21,6 +21,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading;
using System.Xml;
namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
@ -318,6 +319,16 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -318,6 +319,16 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
ToCode(null, () => ((IEnumerable<object>)null).Aggregate((object)null, (Func<object, object, object>)((object o1, object o2) => null), (Func<object, object>)((object o) => null)))
};
public static void TestCall(object a)
{
}
public static void TestCall(ref object a)
{
}
private void Issue1249(int ID)
{
if (ID == 0) {
@ -948,6 +959,17 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -948,6 +959,17 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
Test<Func<int, string>>((int a) => a.ToString(), (int a) => a.ToString());
Test<Func<string, char[]>>((string a) => a.ToArray(), (string a) => a.ToArray());
Test<Func<bool>>(() => 'a'.CompareTo('b') < 0, () => 'a'.CompareTo('b') < 0);
Test<Action<object, bool>>(delegate(object lockObj, bool lockTaken) {
Monitor.Enter(lockObj, ref lockTaken);
}, (object lockObj, bool lockTaken) => Monitor.Enter(lockObj, ref lockTaken));
Test<Func<string, int, bool>>((string str, int num) => int.TryParse(str, out num), (string str, int num) => int.TryParse(str, out num));
Test<Func<string, SimpleType, bool>>((string str, SimpleType t) => int.TryParse(str, out t.Field), (string str, SimpleType t) => int.TryParse(str, out t.Field));
Test<Action<object>>(delegate(object o) {
TestCall(o);
}, (object o) => TestCall(o));
Test<Action<object>>(delegate(object o) {
TestCall(ref o);
}, (object o) => TestCall(ref o));
}
public static void Quote()

528
ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.il

@ -1841,28 +1841,54 @@ @@ -1841,28 +1841,54 @@
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`2<int32,int32> 'CS$<>9__CachedAnonymousMethodDelegate87'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`2<string,string> 'CS$<>9__CachedAnonymousMethodDelegate8f'
.field private static class [mscorlib]System.Func`2<string,string> 'CS$<>9__CachedAnonymousMethodDelegate94'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`2<int32,string> 'CS$<>9__CachedAnonymousMethodDelegate90'
.field private static class [mscorlib]System.Func`2<int32,string> 'CS$<>9__CachedAnonymousMethodDelegate95'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`2<string,char[]> 'CS$<>9__CachedAnonymousMethodDelegate91'
.field private static class [mscorlib]System.Func`2<string,char[]> 'CS$<>9__CachedAnonymousMethodDelegate96'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<bool> 'CS$<>9__CachedAnonymousMethodDelegate92'
.field private static class [mscorlib]System.Func`1<bool> 'CS$<>9__CachedAnonymousMethodDelegate97'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<bool> 'CS$<>9__CachedAnonymousMethodDelegate94'
.field private static class [mscorlib]System.Action`2<object,bool> 'CS$<>9__CachedAnonymousMethodDelegate98'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[]> 'CS$<>9__CachedAnonymousMethodDelegate9a'
.field private static class [mscorlib]System.Func`3<string,int32,bool> 'CS$<>9__CachedAnonymousMethodDelegate99'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[]> 'CS$<>9__CachedAnonymousMethodDelegate9b'
.field private static class [mscorlib]System.Func`3<string,class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType,bool> 'CS$<>9__CachedAnonymousMethodDelegate9a'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[0...,0...]> 'CS$<>9__CachedAnonymousMethodDelegate9c'
.field private static class [mscorlib]System.Action`1<object> 'CS$<>9__CachedAnonymousMethodDelegate9b'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[][]> 'CS$<>9__CachedAnonymousMethodDelegate9d'
.field private static class [mscorlib]System.Action`1<object> 'CS$<>9__CachedAnonymousMethodDelegate9c'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[][]> 'CS$<>9__CachedAnonymousMethodDelegate9e'
.field private static class [mscorlib]System.Func`1<bool> 'CS$<>9__CachedAnonymousMethodDelegate9e'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<object> 'CS$<>9__CachedAnonymousMethodDelegatea0'
.field private static class [mscorlib]System.Func`1<int32[]> 'CS$<>9__CachedAnonymousMethodDelegatea4'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[]> 'CS$<>9__CachedAnonymousMethodDelegatea5'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[0...,0...]> 'CS$<>9__CachedAnonymousMethodDelegatea6'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[][]> 'CS$<>9__CachedAnonymousMethodDelegatea7'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[][]> 'CS$<>9__CachedAnonymousMethodDelegatea8'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<object> 'CS$<>9__CachedAnonymousMethodDelegateaa'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.method public hidebysig static void TestCall(object a) cil managed
{
// Code size 2 (0x2)
.maxstack 8
IL_0000: nop
IL_0001: ret
} // end of method ExpressionTrees::TestCall
.method public hidebysig static void TestCall(object& a) cil managed
{
// Code size 2 (0x2)
.maxstack 8
IL_0000: nop
IL_0001: ret
} // end of method ExpressionTrees::TestCall
.method private hidebysig instance void
Issue1249(int32 ID) cil managed
{
@ -11172,11 +11198,12 @@ @@ -11172,11 +11198,12 @@
.method public hidebysig static void Call() cil managed
{
// Code size 541 (0x21d)
// Code size 1183 (0x49f)
.maxstack 7
.locals init (class [System.Core]System.Linq.Expressions.ParameterExpression V_0,
class [System.Core]System.Linq.Expressions.Expression[] V_1,
class [System.Core]System.Linq.Expressions.ParameterExpression[] V_2)
class [System.Core]System.Linq.Expressions.ParameterExpression[] V_2,
class [System.Core]System.Linq.Expressions.ParameterExpression V_3)
IL_0000: nop
IL_0001: ldnull
IL_0002: ldtoken [mscorlib]System.String
@ -11213,17 +11240,17 @@ @@ -11213,17 +11240,17 @@
IL_0049: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::ToCode<string>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Action`1<!!0>>)
IL_004e: pop
IL_004f: ldsfld class [mscorlib]System.Func`2<string,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate8f'
IL_004f: ldsfld class [mscorlib]System.Func`2<string,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate94'
IL_0054: brtrue.s IL_0069
IL_0056: ldnull
IL_0057: ldftn string ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__8b'(string)
IL_005d: newobj instance void class [mscorlib]System.Func`2<string,string>::.ctor(object,
native int)
IL_0062: stsfld class [mscorlib]System.Func`2<string,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate8f'
IL_0062: stsfld class [mscorlib]System.Func`2<string,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate94'
IL_0067: br.s IL_0069
IL_0069: ldsfld class [mscorlib]System.Func`2<string,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate8f'
IL_0069: ldsfld class [mscorlib]System.Func`2<string,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate94'
IL_006e: ldtoken [mscorlib]System.String
IL_0073: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0078: ldstr "a"
@ -11252,17 +11279,17 @@ @@ -11252,17 +11279,17 @@
IL_00af: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`2<string,string>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_00b4: nop
IL_00b5: ldsfld class [mscorlib]System.Func`2<int32,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate90'
IL_00b5: ldsfld class [mscorlib]System.Func`2<int32,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate95'
IL_00ba: brtrue.s IL_00cf
IL_00bc: ldnull
IL_00bd: ldftn string ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__8c'(int32)
IL_00c3: newobj instance void class [mscorlib]System.Func`2<int32,string>::.ctor(object,
native int)
IL_00c8: stsfld class [mscorlib]System.Func`2<int32,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate90'
IL_00c8: stsfld class [mscorlib]System.Func`2<int32,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate95'
IL_00cd: br.s IL_00cf
IL_00cf: ldsfld class [mscorlib]System.Func`2<int32,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate90'
IL_00cf: ldsfld class [mscorlib]System.Func`2<int32,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate95'
IL_00d4: ldtoken [mscorlib]System.Int32
IL_00d9: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00de: ldstr "a"
@ -11291,17 +11318,17 @@ @@ -11291,17 +11318,17 @@
IL_0115: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`2<int32,string>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_011a: nop
IL_011b: ldsfld class [mscorlib]System.Func`2<string,char[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate91'
IL_011b: ldsfld class [mscorlib]System.Func`2<string,char[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate96'
IL_0120: brtrue.s IL_0135
IL_0122: ldnull
IL_0123: ldftn char[] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__8d'(string)
IL_0129: newobj instance void class [mscorlib]System.Func`2<string,char[]>::.ctor(object,
native int)
IL_012e: stsfld class [mscorlib]System.Func`2<string,char[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate91'
IL_012e: stsfld class [mscorlib]System.Func`2<string,char[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate96'
IL_0133: br.s IL_0135
IL_0135: ldsfld class [mscorlib]System.Func`2<string,char[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate91'
IL_0135: ldsfld class [mscorlib]System.Func`2<string,char[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate96'
IL_013a: ldtoken [mscorlib]System.String
IL_013f: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0144: ldstr "a"
@ -11336,17 +11363,17 @@ @@ -11336,17 +11363,17 @@
IL_0181: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`2<string,char[]>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_0186: nop
IL_0187: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate92'
IL_0187: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate97'
IL_018c: brtrue.s IL_01a1
IL_018e: ldnull
IL_018f: ldftn bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__8e'()
IL_0195: newobj instance void class [mscorlib]System.Func`1<bool>::.ctor(object,
native int)
IL_019a: stsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate92'
IL_019a: stsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate97'
IL_019f: br.s IL_01a1
IL_01a1: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate92'
IL_01a1: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate97'
IL_01a6: ldc.i4.s 97
IL_01a8: box [mscorlib]System.Char
IL_01ad: ldtoken [mscorlib]System.Char
@ -11387,7 +11414,284 @@ @@ -11387,7 +11414,284 @@
IL_0216: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`1<bool>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_021b: nop
IL_021c: ret
IL_021c: ldsfld class [mscorlib]System.Action`2<object,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate98'
IL_0221: brtrue.s IL_0236
IL_0223: ldnull
IL_0224: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__8f'(object,
bool)
IL_022a: newobj instance void class [mscorlib]System.Action`2<object,bool>::.ctor(object,
native int)
IL_022f: stsfld class [mscorlib]System.Action`2<object,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate98'
IL_0234: br.s IL_0236
IL_0236: ldsfld class [mscorlib]System.Action`2<object,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate98'
IL_023b: ldtoken [mscorlib]System.Object
IL_0240: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0245: ldstr "lockObj"
IL_024a: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_024f: stloc.0
IL_0250: ldtoken [mscorlib]System.Boolean
IL_0255: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_025a: ldstr "lockTaken"
IL_025f: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_0264: stloc.3
IL_0265: ldnull
IL_0266: ldtoken method void [mscorlib]System.Threading.Monitor::Enter(object,
bool&)
IL_026b: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0270: castclass [mscorlib]System.Reflection.MethodInfo
IL_0275: ldc.i4.2
IL_0276: newarr [System.Core]System.Linq.Expressions.Expression
IL_027b: stloc.1
IL_027c: ldloc.1
IL_027d: ldc.i4.0
IL_027e: ldloc.0
IL_027f: stelem.ref
IL_0280: ldloc.1
IL_0281: ldc.i4.1
IL_0282: ldloc.3
IL_0283: stelem.ref
IL_0284: ldloc.1
IL_0285: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_028a: ldc.i4.2
IL_028b: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0290: stloc.2
IL_0291: ldloc.2
IL_0292: ldc.i4.0
IL_0293: ldloc.0
IL_0294: stelem.ref
IL_0295: ldloc.2
IL_0296: ldc.i4.1
IL_0297: ldloc.3
IL_0298: stelem.ref
IL_0299: ldloc.2
IL_029a: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Action`2<object,bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_029f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Action`2<object,bool>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_02a4: nop
IL_02a5: ldsfld class [mscorlib]System.Func`3<string,int32,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate99'
IL_02aa: brtrue.s IL_02bf
IL_02ac: ldnull
IL_02ad: ldftn bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__90'(string,
int32)
IL_02b3: newobj instance void class [mscorlib]System.Func`3<string,int32,bool>::.ctor(object,
native int)
IL_02b8: stsfld class [mscorlib]System.Func`3<string,int32,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate99'
IL_02bd: br.s IL_02bf
IL_02bf: ldsfld class [mscorlib]System.Func`3<string,int32,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate99'
IL_02c4: ldtoken [mscorlib]System.String
IL_02c9: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_02ce: ldstr "str"
IL_02d3: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_02d8: stloc.0
IL_02d9: ldtoken [mscorlib]System.Int32
IL_02de: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_02e3: ldstr "num"
IL_02e8: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_02ed: stloc.3
IL_02ee: ldnull
IL_02ef: ldtoken method bool [mscorlib]System.Int32::TryParse(string,
int32&)
IL_02f4: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_02f9: castclass [mscorlib]System.Reflection.MethodInfo
IL_02fe: ldc.i4.2
IL_02ff: newarr [System.Core]System.Linq.Expressions.Expression
IL_0304: stloc.1
IL_0305: ldloc.1
IL_0306: ldc.i4.0
IL_0307: ldloc.0
IL_0308: stelem.ref
IL_0309: ldloc.1
IL_030a: ldc.i4.1
IL_030b: ldloc.3
IL_030c: stelem.ref
IL_030d: ldloc.1
IL_030e: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_0313: ldc.i4.2
IL_0314: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0319: stloc.2
IL_031a: ldloc.2
IL_031b: ldc.i4.0
IL_031c: ldloc.0
IL_031d: stelem.ref
IL_031e: ldloc.2
IL_031f: ldc.i4.1
IL_0320: ldloc.3
IL_0321: stelem.ref
IL_0322: ldloc.2
IL_0323: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`3<string,int32,bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0328: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`3<string,int32,bool>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_032d: nop
IL_032e: ldsfld class [mscorlib]System.Func`3<string,class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9a'
IL_0333: brtrue.s IL_0348
IL_0335: ldnull
IL_0336: ldftn bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__91'(string,
class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType)
IL_033c: newobj instance void class [mscorlib]System.Func`3<string,class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType,bool>::.ctor(object,
native int)
IL_0341: stsfld class [mscorlib]System.Func`3<string,class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9a'
IL_0346: br.s IL_0348
IL_0348: ldsfld class [mscorlib]System.Func`3<string,class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9a'
IL_034d: ldtoken [mscorlib]System.String
IL_0352: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0357: ldstr "str"
IL_035c: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_0361: stloc.0
IL_0362: ldtoken ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType
IL_0367: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_036c: ldstr "t"
IL_0371: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_0376: stloc.3
IL_0377: ldnull
IL_0378: ldtoken method bool [mscorlib]System.Int32::TryParse(string,
int32&)
IL_037d: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0382: castclass [mscorlib]System.Reflection.MethodInfo
IL_0387: ldc.i4.2
IL_0388: newarr [System.Core]System.Linq.Expressions.Expression
IL_038d: stloc.1
IL_038e: ldloc.1
IL_038f: ldc.i4.0
IL_0390: ldloc.0
IL_0391: stelem.ref
IL_0392: ldloc.1
IL_0393: ldc.i4.1
IL_0394: ldloc.3
IL_0395: ldtoken field int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType::Field
IL_039a: call class [mscorlib]System.Reflection.FieldInfo [mscorlib]System.Reflection.FieldInfo::GetFieldFromHandle(valuetype [mscorlib]System.RuntimeFieldHandle)
IL_039f: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Field(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.FieldInfo)
IL_03a4: stelem.ref
IL_03a5: ldloc.1
IL_03a6: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_03ab: ldc.i4.2
IL_03ac: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_03b1: stloc.2
IL_03b2: ldloc.2
IL_03b3: ldc.i4.0
IL_03b4: ldloc.0
IL_03b5: stelem.ref
IL_03b6: ldloc.2
IL_03b7: ldc.i4.1
IL_03b8: ldloc.3
IL_03b9: stelem.ref
IL_03ba: ldloc.2
IL_03bb: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`3<string,class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType,bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_03c0: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`3<string,class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType,bool>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_03c5: nop
IL_03c6: ldsfld class [mscorlib]System.Action`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9b'
IL_03cb: brtrue.s IL_03e0
IL_03cd: ldnull
IL_03ce: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__92'(object)
IL_03d4: newobj instance void class [mscorlib]System.Action`1<object>::.ctor(object,
native int)
IL_03d9: stsfld class [mscorlib]System.Action`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9b'
IL_03de: br.s IL_03e0
IL_03e0: ldsfld class [mscorlib]System.Action`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9b'
IL_03e5: ldtoken [mscorlib]System.Object
IL_03ea: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_03ef: ldstr "o"
IL_03f4: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_03f9: stloc.0
IL_03fa: ldnull
IL_03fb: ldtoken method void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::TestCall(object)
IL_0400: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0405: castclass [mscorlib]System.Reflection.MethodInfo
IL_040a: ldc.i4.1
IL_040b: newarr [System.Core]System.Linq.Expressions.Expression
IL_0410: stloc.1
IL_0411: ldloc.1
IL_0412: ldc.i4.0
IL_0413: ldloc.0
IL_0414: stelem.ref
IL_0415: ldloc.1
IL_0416: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_041b: ldc.i4.1
IL_041c: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0421: stloc.2
IL_0422: ldloc.2
IL_0423: ldc.i4.0
IL_0424: ldloc.0
IL_0425: stelem.ref
IL_0426: ldloc.2
IL_0427: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Action`1<object>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_042c: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Action`1<object>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_0431: nop
IL_0432: ldsfld class [mscorlib]System.Action`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9c'
IL_0437: brtrue.s IL_044c
IL_0439: ldnull
IL_043a: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__93'(object)
IL_0440: newobj instance void class [mscorlib]System.Action`1<object>::.ctor(object,
native int)
IL_0445: stsfld class [mscorlib]System.Action`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9c'
IL_044a: br.s IL_044c
IL_044c: ldsfld class [mscorlib]System.Action`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9c'
IL_0451: ldtoken [mscorlib]System.Object
IL_0456: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_045b: ldstr "o"
IL_0460: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_0465: stloc.0
IL_0466: ldnull
IL_0467: ldtoken method void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::TestCall(object&)
IL_046c: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0471: castclass [mscorlib]System.Reflection.MethodInfo
IL_0476: ldc.i4.1
IL_0477: newarr [System.Core]System.Linq.Expressions.Expression
IL_047c: stloc.1
IL_047d: ldloc.1
IL_047e: ldc.i4.0
IL_047f: ldloc.0
IL_0480: stelem.ref
IL_0481: ldloc.1
IL_0482: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_0487: ldc.i4.1
IL_0488: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_048d: stloc.2
IL_048e: ldloc.2
IL_048f: ldc.i4.0
IL_0490: ldloc.0
IL_0491: stelem.ref
IL_0492: ldloc.2
IL_0493: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Action`1<object>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0498: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Action`1<object>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_049d: nop
IL_049e: ret
} // end of method ExpressionTrees::Call
.method public hidebysig static void Quote() cil managed
@ -11398,17 +11702,17 @@ @@ -11398,17 +11702,17 @@
class [System.Core]System.Linq.Expressions.ParameterExpression V_1,
class [System.Core]System.Linq.Expressions.ParameterExpression[] V_2)
IL_0000: nop
IL_0001: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate94'
IL_0001: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9e'
IL_0006: brtrue.s IL_001b
IL_0008: ldnull
IL_0009: ldftn bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Quote>b__93'()
IL_0009: ldftn bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Quote>b__9d'()
IL_000f: newobj instance void class [mscorlib]System.Func`1<bool>::.ctor(object,
native int)
IL_0014: stsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate94'
IL_0014: stsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9e'
IL_0019: br.s IL_001b
IL_001b: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate94'
IL_001b: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9e'
IL_0020: ldtoken [mscorlib]System.Int32
IL_0025: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_002a: ldstr "n"
@ -11482,17 +11786,17 @@ @@ -11482,17 +11786,17 @@
.locals init (class [System.Core]System.Linq.Expressions.Expression[] V_0,
class [System.Core]System.Linq.Expressions.Expression[] V_1)
IL_0000: nop
IL_0001: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9a'
IL_0001: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea4'
IL_0006: brtrue.s IL_001b
IL_0008: ldnull
IL_0009: ldftn int32[] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__95'()
IL_0009: ldftn int32[] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__9f'()
IL_000f: newobj instance void class [mscorlib]System.Func`1<int32[]>::.ctor(object,
native int)
IL_0014: stsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9a'
IL_0014: stsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea4'
IL_0019: br.s IL_001b
IL_001b: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9a'
IL_001b: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea4'
IL_0020: ldtoken [mscorlib]System.Int32
IL_0025: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_002a: ldc.i4.3
@ -11535,17 +11839,17 @@ @@ -11535,17 +11839,17 @@
IL_008a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`1<int32[]>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_008f: nop
IL_0090: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9b'
IL_0090: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea5'
IL_0095: brtrue.s IL_00aa
IL_0097: ldnull
IL_0098: ldftn int32[] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__96'()
IL_0098: ldftn int32[] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__a0'()
IL_009e: newobj instance void class [mscorlib]System.Func`1<int32[]>::.ctor(object,
native int)
IL_00a3: stsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9b'
IL_00a3: stsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea5'
IL_00a8: br.s IL_00aa
IL_00aa: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9b'
IL_00aa: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea5'
IL_00af: ldtoken [mscorlib]System.Int32
IL_00b4: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00b9: ldc.i4.1
@ -11570,17 +11874,17 @@ @@ -11570,17 +11874,17 @@
IL_00e9: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`1<int32[]>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_00ee: nop
IL_00ef: ldsfld class [mscorlib]System.Func`1<int32[0...,0...]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9c'
IL_00ef: ldsfld class [mscorlib]System.Func`1<int32[0...,0...]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea6'
IL_00f4: brtrue.s IL_0109
IL_00f6: ldnull
IL_00f7: ldftn int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__97'()
IL_00f7: ldftn int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__a1'()
IL_00fd: newobj instance void class [mscorlib]System.Func`1<int32[0...,0...]>::.ctor(object,
native int)
IL_0102: stsfld class [mscorlib]System.Func`1<int32[0...,0...]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9c'
IL_0102: stsfld class [mscorlib]System.Func`1<int32[0...,0...]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea6'
IL_0107: br.s IL_0109
IL_0109: ldsfld class [mscorlib]System.Func`1<int32[0...,0...]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9c'
IL_0109: ldsfld class [mscorlib]System.Func`1<int32[0...,0...]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea6'
IL_010e: ldtoken [mscorlib]System.Int32
IL_0113: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0118: ldc.i4.2
@ -11614,17 +11918,17 @@ @@ -11614,17 +11918,17 @@
IL_0160: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`1<int32[0...,0...]>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_0165: nop
IL_0166: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9d'
IL_0166: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea7'
IL_016b: brtrue.s IL_0180
IL_016d: ldnull
IL_016e: ldftn int32[][] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__98'()
IL_016e: ldftn int32[][] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__a2'()
IL_0174: newobj instance void class [mscorlib]System.Func`1<int32[][]>::.ctor(object,
native int)
IL_0179: stsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9d'
IL_0179: stsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea7'
IL_017e: br.s IL_0180
IL_0180: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9d'
IL_0180: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea7'
IL_0185: ldtoken int32[]
IL_018a: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_018f: ldc.i4.1
@ -11649,17 +11953,17 @@ @@ -11649,17 +11953,17 @@
IL_01bf: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`1<int32[][]>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_01c4: nop
IL_01c5: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9e'
IL_01c5: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea8'
IL_01ca: brtrue.s IL_01df
IL_01cc: ldnull
IL_01cd: ldftn int32[][] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__99'()
IL_01cd: ldftn int32[][] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__a3'()
IL_01d3: newobj instance void class [mscorlib]System.Func`1<int32[][]>::.ctor(object,
native int)
IL_01d8: stsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9e'
IL_01d8: stsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea8'
IL_01dd: br.s IL_01df
IL_01df: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9e'
IL_01df: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea8'
IL_01e4: ldtoken int32[]
IL_01e9: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01ee: ldc.i4.1
@ -11723,17 +12027,17 @@ @@ -11723,17 +12027,17 @@
.locals init (class [System.Core]System.Linq.Expressions.Expression[] V_0,
class [mscorlib]System.Reflection.MethodInfo[] V_1)
IL_0000: nop
IL_0001: ldsfld class [mscorlib]System.Func`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea0'
IL_0001: ldsfld class [mscorlib]System.Func`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegateaa'
IL_0006: brtrue.s IL_001b
IL_0008: ldnull
IL_0009: ldftn object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<AnonymousTypes>b__9f'()
IL_0009: ldftn object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<AnonymousTypes>b__a9'()
IL_000f: newobj instance void class [mscorlib]System.Func`1<object>::.ctor(object,
native int)
IL_0014: stsfld class [mscorlib]System.Func`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea0'
IL_0014: stsfld class [mscorlib]System.Func`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegateaa'
IL_0019: br.s IL_001b
IL_001b: ldsfld class [mscorlib]System.Func`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea0'
IL_001b: ldsfld class [mscorlib]System.Func`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegateaa'
IL_0020: ldtoken method instance void class '<>f__AnonymousType3`2'<int32,string>::.ctor(!0,
!1)
IL_0025: ldtoken class '<>f__AnonymousType3`2'<int32,string>
@ -12834,7 +13138,81 @@ @@ -12834,7 +13138,81 @@
IL_0013: ret
} // end of method ExpressionTrees::'<Call>b__8e'
.method private hidebysig static bool '<Quote>b__93'() cil managed
.method private hidebysig static void '<Call>b__8f'(object lockObj,
bool lockTaken) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 11 (0xb)
.maxstack 8
IL_0000: nop
IL_0001: ldarg.0
IL_0002: ldarga.s lockTaken
IL_0004: call void [mscorlib]System.Threading.Monitor::Enter(object,
bool&)
IL_0009: nop
IL_000a: ret
} // end of method ExpressionTrees::'<Call>b__8f'
.method private hidebysig static bool '<Call>b__90'(string str,
int32 num) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 13 (0xd)
.maxstack 2
.locals init (bool V_0)
IL_0000: ldarg.0
IL_0001: ldarga.s num
IL_0003: call bool [mscorlib]System.Int32::TryParse(string,
int32&)
IL_0008: stloc.0
IL_0009: br.s IL_000b
IL_000b: ldloc.0
IL_000c: ret
} // end of method ExpressionTrees::'<Call>b__90'
.method private hidebysig static bool '<Call>b__91'(string str,
class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType t) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 17 (0x11)
.maxstack 2
.locals init (bool V_0)
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: ldflda int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType::Field
IL_0007: call bool [mscorlib]System.Int32::TryParse(string,
int32&)
IL_000c: stloc.0
IL_000d: br.s IL_000f
IL_000f: ldloc.0
IL_0010: ret
} // end of method ExpressionTrees::'<Call>b__91'
.method private hidebysig static void '<Call>b__92'(object o) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::TestCall(object)
IL_0006: nop
IL_0007: ret
} // end of method ExpressionTrees::'<Call>b__92'
.method private hidebysig static void '<Call>b__93'(object o) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 9 (0x9)
.maxstack 8
IL_0000: ldarga.s o
IL_0002: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::TestCall(object&)
IL_0007: nop
IL_0008: ret
} // end of method ExpressionTrees::'<Call>b__93'
.method private hidebysig static bool '<Quote>b__9d'() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 122 (0x7a)
@ -12895,10 +13273,10 @@ @@ -12895,10 +13273,10 @@
IL_0078: ldloc.0
IL_0079: ret
} // end of method ExpressionTrees::'<Quote>b__93'
} // end of method ExpressionTrees::'<Quote>b__9d'
.method private hidebysig static int32[]
'<ArrayInitializer>b__95'() cil managed
'<ArrayInitializer>b__9f'() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 22 (0x16)
@ -12907,7 +13285,7 @@ @@ -12907,7 +13285,7 @@
IL_0000: ldc.i4.3
IL_0001: newarr [mscorlib]System.Int32
IL_0006: dup
IL_0007: ldtoken field valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '<PrivateImplementationDetails>'::'$$method0x600010d-1'
IL_0007: ldtoken field valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '<PrivateImplementationDetails>'::'$$method0x6000114-1'
IL_000c: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array,
valuetype [mscorlib]System.RuntimeFieldHandle)
IL_0011: stloc.0
@ -12915,10 +13293,10 @@ @@ -12915,10 +13293,10 @@
IL_0014: ldloc.0
IL_0015: ret
} // end of method ExpressionTrees::'<ArrayInitializer>b__95'
} // end of method ExpressionTrees::'<ArrayInitializer>b__9f'
.method private hidebysig static int32[]
'<ArrayInitializer>b__96'() cil managed
'<ArrayInitializer>b__a0'() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 11 (0xb)
@ -12931,10 +13309,10 @@ @@ -12931,10 +13309,10 @@
IL_0009: ldloc.0
IL_000a: ret
} // end of method ExpressionTrees::'<ArrayInitializer>b__96'
} // end of method ExpressionTrees::'<ArrayInitializer>b__a0'
.method private hidebysig static int32[0...,0...]
'<ArrayInitializer>b__97'() cil managed
'<ArrayInitializer>b__a1'() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 12 (0xc)
@ -12949,10 +13327,10 @@ @@ -12949,10 +13327,10 @@
IL_000a: ldloc.0
IL_000b: ret
} // end of method ExpressionTrees::'<ArrayInitializer>b__97'
} // end of method ExpressionTrees::'<ArrayInitializer>b__a1'
.method private hidebysig static int32[][]
'<ArrayInitializer>b__98'() cil managed
'<ArrayInitializer>b__a2'() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 11 (0xb)
@ -12965,10 +13343,10 @@ @@ -12965,10 +13343,10 @@
IL_0009: ldloc.0
IL_000a: ret
} // end of method ExpressionTrees::'<ArrayInitializer>b__98'
} // end of method ExpressionTrees::'<ArrayInitializer>b__a2'
.method private hidebysig static int32[][]
'<ArrayInitializer>b__99'() cil managed
'<ArrayInitializer>b__a3'() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 33 (0x21)
@ -12983,7 +13361,7 @@ @@ -12983,7 +13361,7 @@
IL_0009: ldc.i4.3
IL_000a: newarr [mscorlib]System.Int32
IL_000f: dup
IL_0010: ldtoken field valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '<PrivateImplementationDetails>'::'$$method0x6000111-1'
IL_0010: ldtoken field valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '<PrivateImplementationDetails>'::'$$method0x6000118-1'
IL_0015: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array,
valuetype [mscorlib]System.RuntimeFieldHandle)
IL_001a: stelem.ref
@ -12993,10 +13371,10 @@ @@ -12993,10 +13371,10 @@
IL_001f: ldloc.0
IL_0020: ret
} // end of method ExpressionTrees::'<ArrayInitializer>b__99'
} // end of method ExpressionTrees::'<ArrayInitializer>b__a3'
.method private hidebysig static object
'<AnonymousTypes>b__9f'() cil managed
'<AnonymousTypes>b__a9'() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 16 (0x10)
@ -13011,7 +13389,7 @@ @@ -13011,7 +13389,7 @@
IL_000e: ldloc.0
IL_000f: ret
} // end of method ExpressionTrees::'<AnonymousTypes>b__9f'
} // end of method ExpressionTrees::'<AnonymousTypes>b__a9'
.method private hidebysig specialname rtspecialname static
void .cctor() cil managed
@ -14806,8 +15184,8 @@ @@ -14806,8 +15184,8 @@
.size 12
} // end of class '__StaticArrayInitTypeSize=12'
.field static assembly valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '$$method0x600010d-1' at I_000091E0
.field static assembly valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '$$method0x6000111-1' at I_00009258
.field static assembly valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '$$method0x6000114-1' at I_000094C0
.field static assembly valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '$$method0x6000118-1' at I_00009538
} // end of class '<PrivateImplementationDetails>'
.class private auto ansi sealed beforefieldinit '<>f__AnonymousType3`2'<'<A>j__TPar','<B>j__TPar'>
@ -14999,9 +15377,9 @@ @@ -14999,9 +15377,9 @@
// =============================================================
.data cil I_000091E0 = bytearray (
.data cil I_000094C0 = bytearray (
01 00 00 00 02 00 00 00 03 00 00 00)
.data cil I_000091EC = int8[4]
.data cil I_00009258 = bytearray (
.data cil I_000094CC = int8[4]
.data cil I_00009538 = bytearray (
01 00 00 00 02 00 00 00 03 00 00 00)
// *********** DISASSEMBLY COMPLETE ***********************

514
ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.opt.il

@ -1644,28 +1644,52 @@ @@ -1644,28 +1644,52 @@
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`2<int32,int32> 'CS$<>9__CachedAnonymousMethodDelegate87'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`2<string,string> 'CS$<>9__CachedAnonymousMethodDelegate8f'
.field private static class [mscorlib]System.Func`2<string,string> 'CS$<>9__CachedAnonymousMethodDelegate94'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`2<int32,string> 'CS$<>9__CachedAnonymousMethodDelegate90'
.field private static class [mscorlib]System.Func`2<int32,string> 'CS$<>9__CachedAnonymousMethodDelegate95'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`2<string,char[]> 'CS$<>9__CachedAnonymousMethodDelegate91'
.field private static class [mscorlib]System.Func`2<string,char[]> 'CS$<>9__CachedAnonymousMethodDelegate96'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<bool> 'CS$<>9__CachedAnonymousMethodDelegate92'
.field private static class [mscorlib]System.Func`1<bool> 'CS$<>9__CachedAnonymousMethodDelegate97'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<bool> 'CS$<>9__CachedAnonymousMethodDelegate94'
.field private static class [mscorlib]System.Action`2<object,bool> 'CS$<>9__CachedAnonymousMethodDelegate98'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[]> 'CS$<>9__CachedAnonymousMethodDelegate9a'
.field private static class [mscorlib]System.Func`3<string,int32,bool> 'CS$<>9__CachedAnonymousMethodDelegate99'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[]> 'CS$<>9__CachedAnonymousMethodDelegate9b'
.field private static class [mscorlib]System.Func`3<string,class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType,bool> 'CS$<>9__CachedAnonymousMethodDelegate9a'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[0...,0...]> 'CS$<>9__CachedAnonymousMethodDelegate9c'
.field private static class [mscorlib]System.Action`1<object> 'CS$<>9__CachedAnonymousMethodDelegate9b'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[][]> 'CS$<>9__CachedAnonymousMethodDelegate9d'
.field private static class [mscorlib]System.Action`1<object> 'CS$<>9__CachedAnonymousMethodDelegate9c'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[][]> 'CS$<>9__CachedAnonymousMethodDelegate9e'
.field private static class [mscorlib]System.Func`1<bool> 'CS$<>9__CachedAnonymousMethodDelegate9e'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<object> 'CS$<>9__CachedAnonymousMethodDelegatea0'
.field private static class [mscorlib]System.Func`1<int32[]> 'CS$<>9__CachedAnonymousMethodDelegatea4'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[]> 'CS$<>9__CachedAnonymousMethodDelegatea5'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[0...,0...]> 'CS$<>9__CachedAnonymousMethodDelegatea6'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[][]> 'CS$<>9__CachedAnonymousMethodDelegatea7'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<int32[][]> 'CS$<>9__CachedAnonymousMethodDelegatea8'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.Func`1<object> 'CS$<>9__CachedAnonymousMethodDelegateaa'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.method public hidebysig static void TestCall(object a) cil managed
{
// Code size 1 (0x1)
.maxstack 8
IL_0000: ret
} // end of method ExpressionTrees::TestCall
.method public hidebysig static void TestCall(object& a) cil managed
{
// Code size 1 (0x1)
.maxstack 8
IL_0000: ret
} // end of method ExpressionTrees::TestCall
.method private hidebysig instance void
Issue1249(int32 ID) cil managed
{
@ -10900,7 +10924,7 @@ @@ -10900,7 +10924,7 @@
.method public hidebysig static void Call() cil managed
{
// Code size 549 (0x225)
// Code size 1236 (0x4d4)
.maxstack 7
.locals init (class [System.Core]System.Linq.Expressions.ParameterExpression V_0,
class [System.Core]System.Linq.Expressions.Expression[] V_1,
@ -10912,7 +10936,25 @@ @@ -10912,7 +10936,25 @@
class [System.Core]System.Linq.Expressions.ParameterExpression V_7,
class [System.Core]System.Linq.Expressions.Expression[] V_8,
class [System.Core]System.Linq.Expressions.ParameterExpression[] V_9,
class [System.Core]System.Linq.Expressions.Expression[] V_10)
class [System.Core]System.Linq.Expressions.Expression[] V_10,
class [System.Core]System.Linq.Expressions.ParameterExpression V_11,
class [System.Core]System.Linq.Expressions.ParameterExpression V_12,
class [System.Core]System.Linq.Expressions.Expression[] V_13,
class [System.Core]System.Linq.Expressions.ParameterExpression[] V_14,
class [System.Core]System.Linq.Expressions.ParameterExpression V_15,
class [System.Core]System.Linq.Expressions.ParameterExpression V_16,
class [System.Core]System.Linq.Expressions.Expression[] V_17,
class [System.Core]System.Linq.Expressions.ParameterExpression[] V_18,
class [System.Core]System.Linq.Expressions.ParameterExpression V_19,
class [System.Core]System.Linq.Expressions.ParameterExpression V_20,
class [System.Core]System.Linq.Expressions.Expression[] V_21,
class [System.Core]System.Linq.Expressions.ParameterExpression[] V_22,
class [System.Core]System.Linq.Expressions.ParameterExpression V_23,
class [System.Core]System.Linq.Expressions.Expression[] V_24,
class [System.Core]System.Linq.Expressions.ParameterExpression[] V_25,
class [System.Core]System.Linq.Expressions.ParameterExpression V_26,
class [System.Core]System.Linq.Expressions.Expression[] V_27,
class [System.Core]System.Linq.Expressions.ParameterExpression[] V_28)
IL_0000: ldnull
IL_0001: ldtoken [mscorlib]System.String
IL_0006: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
@ -10948,15 +10990,15 @@ @@ -10948,15 +10990,15 @@
IL_0048: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::ToCode<string>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Action`1<!!0>>)
IL_004d: pop
IL_004e: ldsfld class [mscorlib]System.Func`2<string,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate8f'
IL_004e: ldsfld class [mscorlib]System.Func`2<string,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate94'
IL_0053: brtrue.s IL_0066
IL_0055: ldnull
IL_0056: ldftn string ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__8b'(string)
IL_005c: newobj instance void class [mscorlib]System.Func`2<string,string>::.ctor(object,
native int)
IL_0061: stsfld class [mscorlib]System.Func`2<string,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate8f'
IL_0066: ldsfld class [mscorlib]System.Func`2<string,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate8f'
IL_0061: stsfld class [mscorlib]System.Func`2<string,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate94'
IL_0066: ldsfld class [mscorlib]System.Func`2<string,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate94'
IL_006b: ldtoken [mscorlib]System.String
IL_0070: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0075: ldstr "a"
@ -10984,15 +11026,15 @@ @@ -10984,15 +11026,15 @@
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_00af: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`2<string,string>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_00b4: ldsfld class [mscorlib]System.Func`2<int32,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate90'
IL_00b4: ldsfld class [mscorlib]System.Func`2<int32,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate95'
IL_00b9: brtrue.s IL_00cc
IL_00bb: ldnull
IL_00bc: ldftn string ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__8c'(int32)
IL_00c2: newobj instance void class [mscorlib]System.Func`2<int32,string>::.ctor(object,
native int)
IL_00c7: stsfld class [mscorlib]System.Func`2<int32,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate90'
IL_00cc: ldsfld class [mscorlib]System.Func`2<int32,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate90'
IL_00c7: stsfld class [mscorlib]System.Func`2<int32,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate95'
IL_00cc: ldsfld class [mscorlib]System.Func`2<int32,string> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate95'
IL_00d1: ldtoken [mscorlib]System.Int32
IL_00d6: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00db: ldstr "a"
@ -11020,15 +11062,15 @@ @@ -11020,15 +11062,15 @@
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0118: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`2<int32,string>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_011d: ldsfld class [mscorlib]System.Func`2<string,char[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate91'
IL_011d: ldsfld class [mscorlib]System.Func`2<string,char[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate96'
IL_0122: brtrue.s IL_0135
IL_0124: ldnull
IL_0125: ldftn char[] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__8d'(string)
IL_012b: newobj instance void class [mscorlib]System.Func`2<string,char[]>::.ctor(object,
native int)
IL_0130: stsfld class [mscorlib]System.Func`2<string,char[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate91'
IL_0135: ldsfld class [mscorlib]System.Func`2<string,char[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate91'
IL_0130: stsfld class [mscorlib]System.Func`2<string,char[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate96'
IL_0135: ldsfld class [mscorlib]System.Func`2<string,char[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate96'
IL_013a: ldtoken [mscorlib]System.String
IL_013f: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0144: ldstr "a"
@ -11062,15 +11104,15 @@ @@ -11062,15 +11104,15 @@
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_018a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`2<string,char[]>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_018f: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate92'
IL_018f: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate97'
IL_0194: brtrue.s IL_01a7
IL_0196: ldnull
IL_0197: ldftn bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__8e'()
IL_019d: newobj instance void class [mscorlib]System.Func`1<bool>::.ctor(object,
native int)
IL_01a2: stsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate92'
IL_01a7: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate92'
IL_01a2: stsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate97'
IL_01a7: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate97'
IL_01ac: ldc.i4.s 97
IL_01ae: box [mscorlib]System.Char
IL_01b3: ldtoken [mscorlib]System.Char
@ -11110,7 +11152,269 @@ @@ -11110,7 +11152,269 @@
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_021f: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`1<bool>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_0224: ret
IL_0224: ldsfld class [mscorlib]System.Action`2<object,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate98'
IL_0229: brtrue.s IL_023c
IL_022b: ldnull
IL_022c: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__8f'(object,
bool)
IL_0232: newobj instance void class [mscorlib]System.Action`2<object,bool>::.ctor(object,
native int)
IL_0237: stsfld class [mscorlib]System.Action`2<object,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate98'
IL_023c: ldsfld class [mscorlib]System.Action`2<object,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate98'
IL_0241: ldtoken [mscorlib]System.Object
IL_0246: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_024b: ldstr "lockObj"
IL_0250: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_0255: stloc.s V_11
IL_0257: ldtoken [mscorlib]System.Boolean
IL_025c: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0261: ldstr "lockTaken"
IL_0266: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_026b: stloc.s V_12
IL_026d: ldnull
IL_026e: ldtoken method void [mscorlib]System.Threading.Monitor::Enter(object,
bool&)
IL_0273: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0278: castclass [mscorlib]System.Reflection.MethodInfo
IL_027d: ldc.i4.2
IL_027e: newarr [System.Core]System.Linq.Expressions.Expression
IL_0283: stloc.s V_13
IL_0285: ldloc.s V_13
IL_0287: ldc.i4.0
IL_0288: ldloc.s V_11
IL_028a: stelem.ref
IL_028b: ldloc.s V_13
IL_028d: ldc.i4.1
IL_028e: ldloc.s V_12
IL_0290: stelem.ref
IL_0291: ldloc.s V_13
IL_0293: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_0298: ldc.i4.2
IL_0299: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_029e: stloc.s V_14
IL_02a0: ldloc.s V_14
IL_02a2: ldc.i4.0
IL_02a3: ldloc.s V_11
IL_02a5: stelem.ref
IL_02a6: ldloc.s V_14
IL_02a8: ldc.i4.1
IL_02a9: ldloc.s V_12
IL_02ab: stelem.ref
IL_02ac: ldloc.s V_14
IL_02ae: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Action`2<object,bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_02b3: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Action`2<object,bool>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_02b8: ldsfld class [mscorlib]System.Func`3<string,int32,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate99'
IL_02bd: brtrue.s IL_02d0
IL_02bf: ldnull
IL_02c0: ldftn bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__90'(string,
int32)
IL_02c6: newobj instance void class [mscorlib]System.Func`3<string,int32,bool>::.ctor(object,
native int)
IL_02cb: stsfld class [mscorlib]System.Func`3<string,int32,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate99'
IL_02d0: ldsfld class [mscorlib]System.Func`3<string,int32,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate99'
IL_02d5: ldtoken [mscorlib]System.String
IL_02da: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_02df: ldstr "str"
IL_02e4: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_02e9: stloc.s V_15
IL_02eb: ldtoken [mscorlib]System.Int32
IL_02f0: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_02f5: ldstr "num"
IL_02fa: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_02ff: stloc.s V_16
IL_0301: ldnull
IL_0302: ldtoken method bool [mscorlib]System.Int32::TryParse(string,
int32&)
IL_0307: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_030c: castclass [mscorlib]System.Reflection.MethodInfo
IL_0311: ldc.i4.2
IL_0312: newarr [System.Core]System.Linq.Expressions.Expression
IL_0317: stloc.s V_17
IL_0319: ldloc.s V_17
IL_031b: ldc.i4.0
IL_031c: ldloc.s V_15
IL_031e: stelem.ref
IL_031f: ldloc.s V_17
IL_0321: ldc.i4.1
IL_0322: ldloc.s V_16
IL_0324: stelem.ref
IL_0325: ldloc.s V_17
IL_0327: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_032c: ldc.i4.2
IL_032d: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0332: stloc.s V_18
IL_0334: ldloc.s V_18
IL_0336: ldc.i4.0
IL_0337: ldloc.s V_15
IL_0339: stelem.ref
IL_033a: ldloc.s V_18
IL_033c: ldc.i4.1
IL_033d: ldloc.s V_16
IL_033f: stelem.ref
IL_0340: ldloc.s V_18
IL_0342: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`3<string,int32,bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0347: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`3<string,int32,bool>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_034c: ldsfld class [mscorlib]System.Func`3<string,class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9a'
IL_0351: brtrue.s IL_0364
IL_0353: ldnull
IL_0354: ldftn bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__91'(string,
class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType)
IL_035a: newobj instance void class [mscorlib]System.Func`3<string,class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType,bool>::.ctor(object,
native int)
IL_035f: stsfld class [mscorlib]System.Func`3<string,class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9a'
IL_0364: ldsfld class [mscorlib]System.Func`3<string,class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType,bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9a'
IL_0369: ldtoken [mscorlib]System.String
IL_036e: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0373: ldstr "str"
IL_0378: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_037d: stloc.s V_19
IL_037f: ldtoken ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType
IL_0384: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0389: ldstr "t"
IL_038e: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_0393: stloc.s V_20
IL_0395: ldnull
IL_0396: ldtoken method bool [mscorlib]System.Int32::TryParse(string,
int32&)
IL_039b: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_03a0: castclass [mscorlib]System.Reflection.MethodInfo
IL_03a5: ldc.i4.2
IL_03a6: newarr [System.Core]System.Linq.Expressions.Expression
IL_03ab: stloc.s V_21
IL_03ad: ldloc.s V_21
IL_03af: ldc.i4.0
IL_03b0: ldloc.s V_19
IL_03b2: stelem.ref
IL_03b3: ldloc.s V_21
IL_03b5: ldc.i4.1
IL_03b6: ldloc.s V_20
IL_03b8: ldtoken field int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType::Field
IL_03bd: call class [mscorlib]System.Reflection.FieldInfo [mscorlib]System.Reflection.FieldInfo::GetFieldFromHandle(valuetype [mscorlib]System.RuntimeFieldHandle)
IL_03c2: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Field(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.FieldInfo)
IL_03c7: stelem.ref
IL_03c8: ldloc.s V_21
IL_03ca: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_03cf: ldc.i4.2
IL_03d0: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_03d5: stloc.s V_22
IL_03d7: ldloc.s V_22
IL_03d9: ldc.i4.0
IL_03da: ldloc.s V_19
IL_03dc: stelem.ref
IL_03dd: ldloc.s V_22
IL_03df: ldc.i4.1
IL_03e0: ldloc.s V_20
IL_03e2: stelem.ref
IL_03e3: ldloc.s V_22
IL_03e5: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`3<string,class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType,bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_03ea: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`3<string,class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType,bool>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_03ef: ldsfld class [mscorlib]System.Action`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9b'
IL_03f4: brtrue.s IL_0407
IL_03f6: ldnull
IL_03f7: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__92'(object)
IL_03fd: newobj instance void class [mscorlib]System.Action`1<object>::.ctor(object,
native int)
IL_0402: stsfld class [mscorlib]System.Action`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9b'
IL_0407: ldsfld class [mscorlib]System.Action`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9b'
IL_040c: ldtoken [mscorlib]System.Object
IL_0411: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0416: ldstr "o"
IL_041b: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_0420: stloc.s V_23
IL_0422: ldnull
IL_0423: ldtoken method void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::TestCall(object)
IL_0428: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_042d: castclass [mscorlib]System.Reflection.MethodInfo
IL_0432: ldc.i4.1
IL_0433: newarr [System.Core]System.Linq.Expressions.Expression
IL_0438: stloc.s V_24
IL_043a: ldloc.s V_24
IL_043c: ldc.i4.0
IL_043d: ldloc.s V_23
IL_043f: stelem.ref
IL_0440: ldloc.s V_24
IL_0442: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_0447: ldc.i4.1
IL_0448: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_044d: stloc.s V_25
IL_044f: ldloc.s V_25
IL_0451: ldc.i4.0
IL_0452: ldloc.s V_23
IL_0454: stelem.ref
IL_0455: ldloc.s V_25
IL_0457: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Action`1<object>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_045c: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Action`1<object>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_0461: ldsfld class [mscorlib]System.Action`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9c'
IL_0466: brtrue.s IL_0479
IL_0468: ldnull
IL_0469: ldftn void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Call>b__93'(object)
IL_046f: newobj instance void class [mscorlib]System.Action`1<object>::.ctor(object,
native int)
IL_0474: stsfld class [mscorlib]System.Action`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9c'
IL_0479: ldsfld class [mscorlib]System.Action`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9c'
IL_047e: ldtoken [mscorlib]System.Object
IL_0483: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0488: ldstr "o"
IL_048d: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
string)
IL_0492: stloc.s V_26
IL_0494: ldnull
IL_0495: ldtoken method void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::TestCall(object&)
IL_049a: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_049f: castclass [mscorlib]System.Reflection.MethodInfo
IL_04a4: ldc.i4.1
IL_04a5: newarr [System.Core]System.Linq.Expressions.Expression
IL_04aa: stloc.s V_27
IL_04ac: ldloc.s V_27
IL_04ae: ldc.i4.0
IL_04af: ldloc.s V_26
IL_04b1: stelem.ref
IL_04b2: ldloc.s V_27
IL_04b4: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_04b9: ldc.i4.1
IL_04ba: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_04bf: stloc.s V_28
IL_04c1: ldloc.s V_28
IL_04c3: ldc.i4.0
IL_04c4: ldloc.s V_26
IL_04c6: stelem.ref
IL_04c7: ldloc.s V_28
IL_04c9: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Action`1<object>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_04ce: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Action`1<object>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_04d3: ret
} // end of method ExpressionTrees::Call
.method public hidebysig static void Quote() cil managed
@ -11120,15 +11424,15 @@ @@ -11120,15 +11424,15 @@
.locals init (class [System.Core]System.Linq.Expressions.ParameterExpression V_0,
class [System.Core]System.Linq.Expressions.ParameterExpression V_1,
class [System.Core]System.Linq.Expressions.ParameterExpression[] V_2)
IL_0000: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate94'
IL_0000: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9e'
IL_0005: brtrue.s IL_0018
IL_0007: ldnull
IL_0008: ldftn bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Quote>b__93'()
IL_0008: ldftn bool ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<Quote>b__9d'()
IL_000e: newobj instance void class [mscorlib]System.Func`1<bool>::.ctor(object,
native int)
IL_0013: stsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate94'
IL_0018: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate94'
IL_0013: stsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9e'
IL_0018: ldsfld class [mscorlib]System.Func`1<bool> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9e'
IL_001d: ldtoken [mscorlib]System.Int32
IL_0022: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0027: ldstr "n"
@ -11204,15 +11508,15 @@ @@ -11204,15 +11508,15 @@
class [System.Core]System.Linq.Expressions.Expression[] V_3,
class [System.Core]System.Linq.Expressions.Expression[] V_4,
class [System.Core]System.Linq.Expressions.Expression[] V_5)
IL_0000: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9a'
IL_0000: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea4'
IL_0005: brtrue.s IL_0018
IL_0007: ldnull
IL_0008: ldftn int32[] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__95'()
IL_0008: ldftn int32[] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__9f'()
IL_000e: newobj instance void class [mscorlib]System.Func`1<int32[]>::.ctor(object,
native int)
IL_0013: stsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9a'
IL_0018: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9a'
IL_0013: stsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea4'
IL_0018: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea4'
IL_001d: ldtoken [mscorlib]System.Int32
IL_0022: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0027: ldc.i4.3
@ -11254,15 +11558,15 @@ @@ -11254,15 +11558,15 @@
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0087: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`1<int32[]>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_008c: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9b'
IL_008c: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea5'
IL_0091: brtrue.s IL_00a4
IL_0093: ldnull
IL_0094: ldftn int32[] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__96'()
IL_0094: ldftn int32[] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__a0'()
IL_009a: newobj instance void class [mscorlib]System.Func`1<int32[]>::.ctor(object,
native int)
IL_009f: stsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9b'
IL_00a4: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9b'
IL_009f: stsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea5'
IL_00a4: ldsfld class [mscorlib]System.Func`1<int32[]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea5'
IL_00a9: ldtoken [mscorlib]System.Int32
IL_00ae: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00b3: ldc.i4.1
@ -11286,15 +11590,15 @@ @@ -11286,15 +11590,15 @@
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_00e3: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`1<int32[]>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_00e8: ldsfld class [mscorlib]System.Func`1<int32[0...,0...]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9c'
IL_00e8: ldsfld class [mscorlib]System.Func`1<int32[0...,0...]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea6'
IL_00ed: brtrue.s IL_0100
IL_00ef: ldnull
IL_00f0: ldftn int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__97'()
IL_00f0: ldftn int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__a1'()
IL_00f6: newobj instance void class [mscorlib]System.Func`1<int32[0...,0...]>::.ctor(object,
native int)
IL_00fb: stsfld class [mscorlib]System.Func`1<int32[0...,0...]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9c'
IL_0100: ldsfld class [mscorlib]System.Func`1<int32[0...,0...]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9c'
IL_00fb: stsfld class [mscorlib]System.Func`1<int32[0...,0...]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea6'
IL_0100: ldsfld class [mscorlib]System.Func`1<int32[0...,0...]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea6'
IL_0105: ldtoken [mscorlib]System.Int32
IL_010a: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_010f: ldc.i4.2
@ -11327,15 +11631,15 @@ @@ -11327,15 +11631,15 @@
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0157: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`1<int32[0...,0...]>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_015c: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9d'
IL_015c: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea7'
IL_0161: brtrue.s IL_0174
IL_0163: ldnull
IL_0164: ldftn int32[][] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__98'()
IL_0164: ldftn int32[][] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__a2'()
IL_016a: newobj instance void class [mscorlib]System.Func`1<int32[][]>::.ctor(object,
native int)
IL_016f: stsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9d'
IL_0174: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9d'
IL_016f: stsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea7'
IL_0174: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea7'
IL_0179: ldtoken int32[]
IL_017e: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0183: ldc.i4.1
@ -11359,15 +11663,15 @@ @@ -11359,15 +11663,15 @@
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_01b3: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::Test<class [mscorlib]System.Func`1<int32[][]>>(!!0,
class [System.Core]System.Linq.Expressions.Expression`1<!!0>)
IL_01b8: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9e'
IL_01b8: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea8'
IL_01bd: brtrue.s IL_01d0
IL_01bf: ldnull
IL_01c0: ldftn int32[][] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__99'()
IL_01c0: ldftn int32[][] ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<ArrayInitializer>b__a3'()
IL_01c6: newobj instance void class [mscorlib]System.Func`1<int32[][]>::.ctor(object,
native int)
IL_01cb: stsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9e'
IL_01d0: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegate9e'
IL_01cb: stsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea8'
IL_01d0: ldsfld class [mscorlib]System.Func`1<int32[][]> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea8'
IL_01d5: ldtoken int32[]
IL_01da: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01df: ldc.i4.1
@ -11429,15 +11733,15 @@ @@ -11429,15 +11733,15 @@
.maxstack 7
.locals init (class [System.Core]System.Linq.Expressions.Expression[] V_0,
class [mscorlib]System.Reflection.MethodInfo[] V_1)
IL_0000: ldsfld class [mscorlib]System.Func`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea0'
IL_0000: ldsfld class [mscorlib]System.Func`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegateaa'
IL_0005: brtrue.s IL_0018
IL_0007: ldnull
IL_0008: ldftn object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<AnonymousTypes>b__9f'()
IL_0008: ldftn object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'<AnonymousTypes>b__a9'()
IL_000e: newobj instance void class [mscorlib]System.Func`1<object>::.ctor(object,
native int)
IL_0013: stsfld class [mscorlib]System.Func`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea0'
IL_0018: ldsfld class [mscorlib]System.Func`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegatea0'
IL_0013: stsfld class [mscorlib]System.Func`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegateaa'
IL_0018: ldsfld class [mscorlib]System.Func`1<object> ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::'CS$<>9__CachedAnonymousMethodDelegateaa'
IL_001d: ldtoken method instance void class '<>f__AnonymousType3`2'<int32,string>::.ctor(!0,
!1)
IL_0022: ldtoken class '<>f__AnonymousType3`2'<int32,string>
@ -12251,7 +12555,67 @@ @@ -12251,7 +12555,67 @@
IL_000f: ret
} // end of method ExpressionTrees::'<Call>b__8e'
.method private hidebysig static bool '<Quote>b__93'() cil managed
.method private hidebysig static void '<Call>b__8f'(object lockObj,
bool lockTaken) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 9 (0x9)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarga.s lockTaken
IL_0003: call void [mscorlib]System.Threading.Monitor::Enter(object,
bool&)
IL_0008: ret
} // end of method ExpressionTrees::'<Call>b__8f'
.method private hidebysig static bool '<Call>b__90'(string str,
int32 num) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 9 (0x9)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarga.s num
IL_0003: call bool [mscorlib]System.Int32::TryParse(string,
int32&)
IL_0008: ret
} // end of method ExpressionTrees::'<Call>b__90'
.method private hidebysig static bool '<Call>b__91'(string str,
class ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType t) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 13 (0xd)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: ldflda int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees/SimpleType::Field
IL_0007: call bool [mscorlib]System.Int32::TryParse(string,
int32&)
IL_000c: ret
} // end of method ExpressionTrees::'<Call>b__91'
.method private hidebysig static void '<Call>b__92'(object o) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::TestCall(object)
IL_0006: ret
} // end of method ExpressionTrees::'<Call>b__92'
.method private hidebysig static void '<Call>b__93'(object o) cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarga.s o
IL_0002: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::TestCall(object&)
IL_0007: ret
} // end of method ExpressionTrees::'<Call>b__93'
.method private hidebysig static bool '<Quote>b__9d'() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 118 (0x76)
@ -12307,10 +12671,10 @@ @@ -12307,10 +12671,10 @@
IL_0072: ldc.i4.0
IL_0073: ceq
IL_0075: ret
} // end of method ExpressionTrees::'<Quote>b__93'
} // end of method ExpressionTrees::'<Quote>b__9d'
.method private hidebysig static int32[]
'<ArrayInitializer>b__95'() cil managed
'<ArrayInitializer>b__9f'() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 18 (0x12)
@ -12318,14 +12682,14 @@ @@ -12318,14 +12682,14 @@
IL_0000: ldc.i4.3
IL_0001: newarr [mscorlib]System.Int32
IL_0006: dup
IL_0007: ldtoken field valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '<PrivateImplementationDetails>'::'$$method0x600010d-1'
IL_0007: ldtoken field valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '<PrivateImplementationDetails>'::'$$method0x6000114-1'
IL_000c: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array,
valuetype [mscorlib]System.RuntimeFieldHandle)
IL_0011: ret
} // end of method ExpressionTrees::'<ArrayInitializer>b__95'
} // end of method ExpressionTrees::'<ArrayInitializer>b__9f'
.method private hidebysig static int32[]
'<ArrayInitializer>b__96'() cil managed
'<ArrayInitializer>b__a0'() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
@ -12333,10 +12697,10 @@ @@ -12333,10 +12697,10 @@
IL_0000: ldc.i4.3
IL_0001: newarr [mscorlib]System.Int32
IL_0006: ret
} // end of method ExpressionTrees::'<ArrayInitializer>b__96'
} // end of method ExpressionTrees::'<ArrayInitializer>b__a0'
.method private hidebysig static int32[0...,0...]
'<ArrayInitializer>b__97'() cil managed
'<ArrayInitializer>b__a1'() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
@ -12346,10 +12710,10 @@ @@ -12346,10 +12710,10 @@
IL_0002: newobj instance void int32[0...,0...]::.ctor(int32,
int32)
IL_0007: ret
} // end of method ExpressionTrees::'<ArrayInitializer>b__97'
} // end of method ExpressionTrees::'<ArrayInitializer>b__a1'
.method private hidebysig static int32[][]
'<ArrayInitializer>b__98'() cil managed
'<ArrayInitializer>b__a2'() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
@ -12357,10 +12721,10 @@ @@ -12357,10 +12721,10 @@
IL_0000: ldc.i4.3
IL_0001: newarr int32[]
IL_0006: ret
} // end of method ExpressionTrees::'<ArrayInitializer>b__98'
} // end of method ExpressionTrees::'<ArrayInitializer>b__a2'
.method private hidebysig static int32[][]
'<ArrayInitializer>b__99'() cil managed
'<ArrayInitializer>b__a3'() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 29 (0x1d)
@ -12374,16 +12738,16 @@ @@ -12374,16 +12738,16 @@
IL_0009: ldc.i4.3
IL_000a: newarr [mscorlib]System.Int32
IL_000f: dup
IL_0010: ldtoken field valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '<PrivateImplementationDetails>'::'$$method0x6000111-1'
IL_0010: ldtoken field valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '<PrivateImplementationDetails>'::'$$method0x6000118-1'
IL_0015: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array,
valuetype [mscorlib]System.RuntimeFieldHandle)
IL_001a: stelem.ref
IL_001b: ldloc.0
IL_001c: ret
} // end of method ExpressionTrees::'<ArrayInitializer>b__99'
} // end of method ExpressionTrees::'<ArrayInitializer>b__a3'
.method private hidebysig static object
'<AnonymousTypes>b__9f'() cil managed
'<AnonymousTypes>b__a9'() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 12 (0xc)
@ -12393,7 +12757,7 @@ @@ -12393,7 +12757,7 @@
IL_0006: newobj instance void class '<>f__AnonymousType3`2'<int32,string>::.ctor(!0,
!1)
IL_000b: ret
} // end of method ExpressionTrees::'<AnonymousTypes>b__9f'
} // end of method ExpressionTrees::'<AnonymousTypes>b__a9'
.method private hidebysig specialname rtspecialname static
void .cctor() cil managed
@ -14063,8 +14427,8 @@ @@ -14063,8 +14427,8 @@
.size 12
} // end of class '__StaticArrayInitTypeSize=12'
.field static assembly valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '$$method0x600010d-1' at I_00008D40
.field static assembly valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '$$method0x6000111-1' at I_00008D78
.field static assembly valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '$$method0x6000114-1' at I_00009020
.field static assembly valuetype '<PrivateImplementationDetails>'/'__StaticArrayInitTypeSize=12' '$$method0x6000118-1' at I_00009058
} // end of class '<PrivateImplementationDetails>'
.class private auto ansi sealed beforefieldinit '<>f__AnonymousType3`2'<'<A>j__TPar','<B>j__TPar'>
@ -14230,9 +14594,9 @@ @@ -14230,9 +14594,9 @@
// =============================================================
.data cil I_00008D40 = bytearray (
.data cil I_00009020 = bytearray (
01 00 00 00 02 00 00 00 03 00 00 00)
.data cil I_00008D4C = int8[4]
.data cil I_00008D78 = bytearray (
.data cil I_0000902C = int8[4]
.data cil I_00009058 = bytearray (
01 00 00 00 02 00 00 00 03 00 00 00)
// *********** DISASSEMBLY COMPLETE ***********************

1420
ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.opt.roslyn.il

File diff suppressed because it is too large Load Diff

1431
ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.roslyn.il

File diff suppressed because it is too large Load Diff

1297
ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.cs

File diff suppressed because it is too large Load Diff

3504
ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.il

File diff suppressed because it is too large Load Diff

3079
ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.opt.il

File diff suppressed because it is too large Load Diff

3578
ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.opt.roslyn.il

File diff suppressed because it is too large Load Diff

3281
ICSharpCode.Decompiler.Tests/TestCases/Pretty/InitializerTests.roslyn.il

File diff suppressed because it is too large Load Diff

42
ICSharpCode.Decompiler.Tests/TypeSystem/TypeSystemLoaderTests.cs

@ -140,7 +140,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -140,7 +140,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
Assert.IsFalse(method.IsVirtual);
Assert.IsFalse(method.IsStatic);
Assert.AreEqual(0, method.Parameters.Count);
Assert.AreEqual(0, method.GetAttributes().Count());
Assert.AreEqual(1, method.GetAttributes().Count());
Assert.IsTrue(method.HasBody);
Assert.IsNull(method.AccessorOwner);
}
@ -496,24 +496,24 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -496,24 +496,24 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
Assert.IsTrue(f.IsConst);
Assert.AreEqual(Accessibility.Public, f.Accessibility);
Assert.AreSame(e, f.Type);
Assert.AreEqual(typeof(short), f.ConstantValue.GetType());
Assert.AreEqual(typeof(short), f.GetConstantValue().GetType());
}
Assert.AreEqual("First", fields[0].Name);
Assert.AreEqual(0, fields[0].ConstantValue);
Assert.AreEqual(0, fields[0].GetConstantValue());
Assert.AreEqual("Second", fields[1].Name);
Assert.AreSame(e, fields[1].Type);
Assert.AreEqual(1, fields[1].ConstantValue);
Assert.AreEqual(1, fields[1].GetConstantValue());
Assert.AreEqual("Flag1", fields[2].Name);
Assert.AreEqual(0x10, fields[2].ConstantValue);
Assert.AreEqual(0x10, fields[2].GetConstantValue());
Assert.AreEqual("Flag2", fields[3].Name);
Assert.AreEqual(0x20, fields[3].ConstantValue);
Assert.AreEqual(0x20, fields[3].GetConstantValue());
Assert.AreEqual("CombinedFlags", fields[4].Name);
Assert.AreEqual(0x30, fields[4].ConstantValue);
Assert.AreEqual(0x30, fields[4].GetConstantValue());
}
[Test]
@ -773,7 +773,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -773,7 +773,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
Assert.IsFalse(p.IsParams);
Assert.IsTrue(p.HasConstantValueInSignature);
Assert.AreEqual(0, p.GetAttributes().Count());
Assert.AreEqual(4, p.ConstantValue);
Assert.AreEqual(4, p.GetConstantValue());
}
[Test]
@ -799,7 +799,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -799,7 +799,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
Assert.IsFalse(p.IsParams);
Assert.IsTrue(p.HasConstantValueInSignature);
Assert.AreEqual(0, p.GetAttributes().Count());
Assert.AreEqual((int)StringComparison.OrdinalIgnoreCase, p.ConstantValue);
Assert.AreEqual((int)StringComparison.OrdinalIgnoreCase, p.GetConstantValue());
}
[Test]
@ -812,7 +812,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -812,7 +812,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
Assert.IsFalse(p.IsParams);
Assert.IsTrue(p.HasConstantValueInSignature);
Assert.AreEqual(0, p.GetAttributes().Count());
Assert.IsNull(p.ConstantValue);
Assert.IsNull(p.GetConstantValue());
}
[Test]
@ -824,8 +824,8 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -824,8 +824,8 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
Assert.IsFalse(p.IsOut);
Assert.IsFalse(p.IsParams);
Assert.IsTrue(p.HasConstantValueInSignature);
Assert.AreEqual(1L, p.ConstantValue);
Assert.AreEqual(typeof(long), p.ConstantValue.GetType());
Assert.AreEqual(1L, p.GetConstantValue());
Assert.AreEqual(typeof(long), p.GetConstantValue().GetType());
}
[Test]
@ -837,8 +837,8 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -837,8 +837,8 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
Assert.IsFalse(p.IsOut);
Assert.IsFalse(p.IsParams);
Assert.IsTrue(p.HasConstantValueInSignature);
Assert.AreEqual(1L, p.ConstantValue);
Assert.AreEqual(typeof(long), p.ConstantValue.GetType());
Assert.AreEqual(1L, p.GetConstantValue());
Assert.AreEqual(typeof(long), p.GetConstantValue().GetType());
}
[Test]
@ -850,8 +850,8 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -850,8 +850,8 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
Assert.IsFalse(p.IsOut);
Assert.IsFalse(p.IsParams);
Assert.IsTrue(p.HasConstantValueInSignature);
Assert.AreEqual(1M, p.ConstantValue);
Assert.AreEqual(typeof(decimal), p.ConstantValue.GetType());
Assert.AreEqual(1M, p.GetConstantValue());
Assert.AreEqual(typeof(decimal), p.GetConstantValue().GetType());
}
[Test]
@ -1509,7 +1509,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -1509,7 +1509,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
{
ITypeDefinition type = GetTypeDefinition(typeof(ClassWithMethodThatHasNullableDefaultParameter));
var method = type.GetMethods().Single(m => m.Name == "Foo");
Assert.AreEqual(42, method.Parameters.Single().ConstantValue);
Assert.AreEqual(42, method.Parameters.Single().GetConstantValue());
}
[Test]
@ -1529,7 +1529,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -1529,7 +1529,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
{
var f = type.GetFields().Single(x => x.Name == name);
Assert.IsTrue(f.IsConst);
Assert.AreEqual(expected, f.ConstantValue);
Assert.AreEqual(expected, f.GetConstantValue());
Assert.AreEqual(0, f.GetAttributes().Count());
}
@ -1577,7 +1577,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -1577,7 +1577,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
ITypeDefinition type = GetTypeDefinition(typeof(ConstantFieldTest));
IField field = type.Fields.Single(f => f.Name == "EnumFromThisAssembly");
Assert.IsTrue(field.IsConst);
Assert.AreEqual((short)MyEnum.Second, field.ConstantValue);
Assert.AreEqual((short)MyEnum.Second, field.GetConstantValue());
}
[Test]
@ -1586,7 +1586,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -1586,7 +1586,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
ITypeDefinition type = GetTypeDefinition(typeof(ConstantFieldTest));
IField field = type.Fields.Single(f => f.Name == "EnumFromAnotherAssembly");
Assert.IsTrue(field.IsConst);
Assert.AreEqual((int)StringComparison.OrdinalIgnoreCase, field.ConstantValue);
Assert.AreEqual((int)StringComparison.OrdinalIgnoreCase, field.GetConstantValue());
}
[Test]
@ -1595,7 +1595,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -1595,7 +1595,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
ITypeDefinition type = GetTypeDefinition(typeof(ConstantFieldTest));
IField field = type.Fields.Single(f => f.Name == "DefaultOfEnum");
Assert.IsTrue(field.IsConst);
Assert.AreEqual((short)default(MyEnum), field.ConstantValue);
Assert.AreEqual((short)default(MyEnum), field.GetConstantValue());
}
[Test]

1
ICSharpCode.Decompiler.Tests/TypeSystem/TypeSystemTestCase.cs

@ -35,6 +35,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem @@ -35,6 +35,7 @@ namespace ICSharpCode.Decompiler.Tests.TypeSystem
public void Method() { }
public SimplePublicClass() { }
[Double(1)]
~SimplePublicClass() { }
}

23
ICSharpCode.Decompiler/CSharp/CSharpDecompiler.cs

@ -526,7 +526,7 @@ namespace ICSharpCode.Decompiler.CSharp @@ -526,7 +526,7 @@ namespace ICSharpCode.Decompiler.CSharp
if (!processedMethods.Add(part))
continue;
try {
ReadCodeMappingInfo(module, declaringType, info, parent, part, connectedMethods, processedNestedTypes);
ReadCodeMappingInfo(module, info, parent, part, connectedMethods, processedNestedTypes);
} catch (BadImageFormatException) {
// ignore invalid IL
}
@ -536,7 +536,7 @@ namespace ICSharpCode.Decompiler.CSharp @@ -536,7 +536,7 @@ namespace ICSharpCode.Decompiler.CSharp
return info;
}
private static void ReadCodeMappingInfo(PEFile module, TypeDefinitionHandle declaringType, CodeMappingInfo info, MethodDefinitionHandle parent, MethodDefinitionHandle part, Queue<MethodDefinitionHandle> connectedMethods, HashSet<TypeDefinitionHandle> processedNestedTypes)
private static void ReadCodeMappingInfo(PEFile module, CodeMappingInfo info, MethodDefinitionHandle parent, MethodDefinitionHandle part, Queue<MethodDefinitionHandle> connectedMethods, HashSet<TypeDefinitionHandle> processedNestedTypes)
{
var md = module.Metadata.GetMethodDefinition(part);
@ -545,6 +545,8 @@ namespace ICSharpCode.Decompiler.CSharp @@ -545,6 +545,8 @@ namespace ICSharpCode.Decompiler.CSharp
return;
}
var declaringType = md.GetDeclaringType();
var blob = module.Reader.GetMethodBody(md.RelativeVirtualAddress).GetILReader();
while (blob.RemainingBytes > 0) {
var code = blob.DecodeOpCode();
@ -996,7 +998,7 @@ namespace ICSharpCode.Decompiler.CSharp @@ -996,7 +998,7 @@ namespace ICSharpCode.Decompiler.CSharp
case EnumValueDisplayMode.None:
foreach (var enumMember in typeDecl.Members.OfType<EnumMemberDeclaration>()) {
enumMember.Initializer = null;
if (enumMember.GetSymbol() is IField f && f.ConstantValue == null) {
if (enumMember.GetSymbol() is IField f && f.GetConstantValue() == null) {
typeDecl.InsertChildBefore(enumMember, new Comment(" error: enumerator has no value"), Roles.Comment);
}
}
@ -1028,8 +1030,12 @@ namespace ICSharpCode.Decompiler.CSharp @@ -1028,8 +1030,12 @@ namespace ICSharpCode.Decompiler.CSharp
bool first = true;
long firstValue = 0, previousValue = 0;
foreach (var field in typeDef.Fields) {
if (MemberIsHidden(module, field.MetadataToken, settings) || field.ConstantValue == null) continue;
long currentValue = (long)CSharpPrimitiveCast.Cast(TypeCode.Int64, field.ConstantValue, false);
if (MemberIsHidden(module, field.MetadataToken, settings))
continue;
object constantValue = field.GetConstantValue();
if (constantValue == null)
continue;
long currentValue = (long)CSharpPrimitiveCast.Cast(TypeCode.Int64, constantValue, false);
if (first) {
firstValue = currentValue;
first = false;
@ -1258,9 +1264,10 @@ namespace ICSharpCode.Decompiler.CSharp @@ -1258,9 +1264,10 @@ namespace ICSharpCode.Decompiler.CSharp
var typeSystemAstBuilder = CreateAstBuilder(decompilationContext);
if (decompilationContext.CurrentTypeDefinition.Kind == TypeKind.Enum) {
var enumDec = new EnumMemberDeclaration { Name = field.Name };
if (field.ConstantValue != null) {
long initValue = (long)CSharpPrimitiveCast.Cast(TypeCode.Int64, field.ConstantValue, false);
enumDec.Initializer = typeSystemAstBuilder.ConvertConstantValue(decompilationContext.CurrentTypeDefinition.EnumUnderlyingType, field.ConstantValue);
object constantValue = field.GetConstantValue();
if (constantValue != null) {
long initValue = (long)CSharpPrimitiveCast.Cast(TypeCode.Int64, constantValue, false);
enumDec.Initializer = typeSystemAstBuilder.ConvertConstantValue(decompilationContext.CurrentTypeDefinition.EnumUnderlyingType, constantValue);
if (enumDec.Initializer is PrimitiveExpression primitive
&& initValue >= 0 && (decompilationContext.CurrentTypeDefinition.HasAttribute(KnownAttribute.Flags)
|| (initValue > 9 && (unchecked(initValue & (initValue - 1)) == 0 || unchecked(initValue & (initValue + 1)) == 0)))) {

2
ICSharpCode.Decompiler/CSharp/CallBuilder.cs

@ -714,7 +714,7 @@ namespace ICSharpCode.Decompiler.CSharp @@ -714,7 +714,7 @@ namespace ICSharpCode.Decompiler.CSharp
|| a.AttributeType.IsKnownType(KnownAttribute.CallerFilePath)
|| a.AttributeType.IsKnownType(KnownAttribute.CallerLineNumber)))
return false;
return object.Equals(parameter.ConstantValue, arg.ResolveResult.ConstantValue);
return object.Equals(parameter.GetConstantValue(), arg.ResolveResult.ConstantValue);
}
[Flags]

2
ICSharpCode.Decompiler/CSharp/ExpressionBuilder.cs

@ -2230,7 +2230,7 @@ namespace ICSharpCode.Decompiler.CSharp @@ -2230,7 +2230,7 @@ namespace ICSharpCode.Decompiler.CSharp
.WithoutILInstruction();
} else {
return new NamedExpression(valuePath.Member.Name, value)
.WithRR(new MemberResolveResult(rr, memberPath.Member))
.WithRR(new MemberResolveResult(rr, valuePath.Member))
.WithoutILInstruction();
}
}

2
ICSharpCode.Decompiler/CSharp/Resolver/CSharpInvocationResolveResult.cs

@ -132,7 +132,7 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver @@ -132,7 +132,7 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver
for (int i = 0; i < results.Length; i++) {
if (results[i] == null) {
if (Member.Parameters[i].IsOptional) {
results[i] = new ConstantResolveResult(Member.Parameters[i].Type, Member.Parameters[i].ConstantValue);
results[i] = new ConstantResolveResult(Member.Parameters[i].Type, Member.Parameters[i].GetConstantValue());
} else {
results[i] = ErrorResolveResult.UnknownError;
}

2
ICSharpCode.Decompiler/CSharp/Resolver/MemberLookup.cs

@ -684,7 +684,7 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver @@ -684,7 +684,7 @@ namespace ICSharpCode.Decompiler.CSharp.Resolver
return new MemberResolveResult(
targetResolveResult, field,
field.DeclaringTypeDefinition.EnumUnderlyingType,
field.IsConst, field.ConstantValue);
field.IsConst, field.GetConstantValue());
}
}
return new MemberResolveResult(targetResolveResult, resultGroup.NonMethod);

13
ICSharpCode.Decompiler/CSharp/Syntax/Expressions/ErrorExpression.cs

@ -52,20 +52,9 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -52,20 +52,9 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
{
}
public ErrorExpression (TextLocation location)
{
this.Location = location;
}
public ErrorExpression (string error)
{
this.Error = error;
}
public ErrorExpression (string error, TextLocation location)
{
this.Location = location;
this.Error = error;
AddChild(new Comment(error, CommentType.MultiLine), Roles.Comment);
}
public override void AcceptVisitor (IAstVisitor visitor)

40
ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs

@ -854,8 +854,11 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -854,8 +854,11 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
{
ITypeDefinition enumDefinition = type.GetDefinition();
TypeCode enumBaseTypeCode = ReflectionHelper.GetTypeCode(enumDefinition.EnumUnderlyingType);
foreach (IField field in enumDefinition.Fields) {
if (field.IsConst && object.Equals(CSharpPrimitiveCast.Cast(TypeCode.Int64, field.ConstantValue, false), val)) {
foreach (IField field in enumDefinition.Fields.Where(fld => fld.IsConst)) {
object constantValue = field.GetConstantValue();
if (constantValue == null)
continue;
if (object.Equals(CSharpPrimitiveCast.Cast(TypeCode.Int64, constantValue, false), val)) {
MemberReferenceExpression mre = new MemberReferenceExpression(new TypeReferenceExpression(ConvertType(type)), field.Name);
if (AddResolveResultAnnotations)
mre.AddAnnotation(new MemberResolveResult(mre.Target.GetResolveResult(), field));
@ -883,7 +886,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -883,7 +886,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
}
Expression negatedExpr = null;
foreach (IField field in enumDefinition.Fields.Where(fld => fld.IsConst)) {
long fieldValue = (long)CSharpPrimitiveCast.Cast(TypeCode.Int64, field.ConstantValue, false);
object constantValue = field.GetConstantValue();
long fieldValue = (long)CSharpPrimitiveCast.Cast(TypeCode.Int64, constantValue, false);
if (fieldValue == 0)
continue; // skip None enum value
@ -1166,7 +1170,11 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -1166,7 +1170,11 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
decl.Name = parameter.Name;
}
if (parameter.IsOptional && parameter.HasConstantValueInSignature && this.ShowConstantValues) {
decl.DefaultExpression = ConvertConstantValue(parameter.Type, parameter.ConstantValue);
try {
decl.DefaultExpression = ConvertConstantValue(parameter.Type, parameter.GetConstantValue(throwOnInvalidMetadata: true));
} catch (BadImageFormatException ex) {
decl.DefaultExpression = new ErrorExpression(ex.Message);
}
}
return decl;
}
@ -1378,8 +1386,13 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -1378,8 +1386,13 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
}
decl.ReturnType = ConvertType(field.ReturnType);
Expression initializer = null;
if (field.IsConst && this.ShowConstantValues)
initializer = ConvertConstantValue(field.Type, field.ConstantValue);
if (field.IsConst && this.ShowConstantValues) {
try {
initializer = ConvertConstantValue(field.Type, field.GetConstantValue(throwOnInvalidMetadata: true));
} catch (BadImageFormatException ex) {
initializer = new ErrorExpression(ex.Message);
}
}
decl.Variables.Add(new VariableInitializer(field.Name, initializer));
return decl;
}
@ -1537,6 +1550,10 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -1537,6 +1550,10 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
foreach (IParameter p in op.Parameters) {
decl.Parameters.Add(ConvertParameter(p));
}
if (ShowAttributes) {
decl.Attributes.AddRange(ConvertAttributes(op.GetAttributes()));
decl.Attributes.AddRange(ConvertAttributes(op.GetReturnTypeAttributes(), "return"));
}
if (AddResolveResultAnnotations) {
decl.AddAnnotation(new MemberResolveResult(null, op));
}
@ -1565,6 +1582,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -1565,6 +1582,8 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
DestructorDeclaration ConvertDestructor(IMethod dtor)
{
DestructorDeclaration decl = new DestructorDeclaration();
if (ShowAttributes)
decl.Attributes.AddRange(ConvertAttributes(dtor.GetAttributes()));
if (dtor.DeclaringTypeDefinition != null)
decl.Name = dtor.DeclaringTypeDefinition.Name;
if (AddResolveResultAnnotations) {
@ -1683,8 +1702,13 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -1683,8 +1702,13 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
decl.Modifiers = v.IsConst ? Modifiers.Const : Modifiers.None;
decl.Type = ConvertType(v.Type);
Expression initializer = null;
if (v.IsConst)
initializer = ConvertConstantValue(v.Type, v.ConstantValue);
if (v.IsConst) {
try {
initializer = ConvertConstantValue(v.Type, v.GetConstantValue(throwOnInvalidMetadata: true));
} catch (BadImageFormatException ex) {
initializer = new ErrorExpression(ex.Message);
}
}
decl.Variables.Add(new VariableInitializer(v.Name, initializer));
return decl;
}

2
ICSharpCode.Decompiler/DecompilerSettings.cs

@ -795,7 +795,7 @@ namespace ICSharpCode.Decompiler @@ -795,7 +795,7 @@ namespace ICSharpCode.Decompiler
/// <summary>
/// Gets/Sets whether C# 7.0 local functions should be used.
/// Note: this language feature is currenly not implemented and this setting is always false.
/// Note: this language feature is currently not implemented and this setting is always false.
/// </summary>
public bool LocalFunctions {
get { return localFunctions; }

9
ICSharpCode.Decompiler/Disassembler/MethodBodyDisassembler.cs

@ -52,6 +52,11 @@ namespace ICSharpCode.Decompiler.Disassembler @@ -52,6 +52,11 @@ namespace ICSharpCode.Decompiler.Disassembler
/// </summary>
public bool ShowMetadataTokens { get; set; }
/// <summary>
/// Show metadata tokens for instructions with token operands in base 10.
/// </summary>
public bool ShowMetadataTokensInBase10 { get; set; }
/// <summary>
/// Optional provider for sequence points.
/// </summary>
@ -453,8 +458,12 @@ namespace ICSharpCode.Decompiler.Disassembler @@ -453,8 +458,12 @@ namespace ICSharpCode.Decompiler.Disassembler
if (spaceBefore) {
output.Write(' ');
}
if (ShowMetadataTokensInBase10) {
output.Write("/* {0} */", metadataToken);
} else {
output.Write("/* {0:X8} */", metadataToken);
}
}
}
}
}

13
ICSharpCode.Decompiler/Disassembler/ReflectionDisassembler.cs

@ -56,6 +56,11 @@ namespace ICSharpCode.Decompiler.Disassembler @@ -56,6 +56,11 @@ namespace ICSharpCode.Decompiler.Disassembler
set => methodBodyDisassembler.ShowMetadataTokens = value;
}
public bool ShowMetadataTokensInBase10 {
get => methodBodyDisassembler.ShowMetadataTokensInBase10;
set => methodBodyDisassembler.ShowMetadataTokensInBase10 = value;
}
public IDebugInfoProvider DebugInfo {
get => methodBodyDisassembler.DebugInfo;
set => methodBodyDisassembler.DebugInfo = value;
@ -1025,7 +1030,13 @@ namespace ICSharpCode.Decompiler.Disassembler @@ -1025,7 +1030,13 @@ namespace ICSharpCode.Decompiler.Disassembler
break;
default:
var blob = metadata.GetBlobReader(constant.Value);
var value = blob.ReadConstant(constant.TypeCode);
object value;
try {
value = blob.ReadConstant(constant.TypeCode);
} catch (ArgumentOutOfRangeException) {
output.Write($"/* Constant with invalid typecode: {constant.TypeCode} */");
return;
}
if (value is string) {
DisassemblerHelpers.WriteOperand(output, value);
} else {

12
ICSharpCode.Decompiler/IL/ControlFlow/AsyncAwaitDecompiler.cs

@ -36,7 +36,9 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -36,7 +36,9 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
public static bool IsCompilerGeneratedStateMachine(TypeDefinitionHandle type, MetadataReader metadata)
{
TypeDefinition td;
if (type.IsNil || !type.IsCompilerGenerated(metadata) || (td = metadata.GetTypeDefinition(type)).GetDeclaringType().IsNil)
if (type.IsNil || (td = metadata.GetTypeDefinition(type)).GetDeclaringType().IsNil)
return false;
if (!(type.IsCompilerGenerated(metadata) || td.GetDeclaringType().IsCompilerGenerated(metadata)))
return false;
foreach (var i in td.GetInterfaceImplementations()) {
var tr = metadata.GetInterfaceImplementation(i).Interface.GetFullTypeName(metadata);
@ -598,9 +600,15 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -598,9 +600,15 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
pos--;
}
if (MatchCall(block.Instructions[pos], "AwaitUnsafeOnCompleted", out var callArgs)) {
// call AwaitUnsafeOnCompleted(ldflda <>t__builder(ldloc this), ldloca awaiter, ldloc this)
if (!MatchCall(block.Instructions[pos], "AwaitUnsafeOnCompleted", out var callArgs))
} else if (MatchCall(block.Instructions[pos], "AwaitOnCompleted", out callArgs)) {
// call AwaitOnCompleted(ldflda <>t__builder(ldloc this), ldloca awaiter, ldloc this)
// The C# compiler emits the non-unsafe call when the awaiter does not implement
// ICriticalNotifyCompletion.
} else {
return false;
}
if (callArgs.Count != 3)
return false;
if (!IsBuilderFieldOnThis(callArgs[0]))

23
ICSharpCode.Decompiler/IL/ControlFlow/AwaitInCatchTransform.cs

@ -53,10 +53,13 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -53,10 +53,13 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
var jumpTableBlock = (Block)result.JumpTableEntry.Parent;
jumpTableBlock.Instructions.RemoveAt(result.JumpTableEntry.ChildIndex);
if (result.NextBlock != null) {
foreach (var branch in tryCatch.Descendants.OfType<Branch>()) {
if (branch.TargetBlock == jumpTableBlock)
branch.ReplaceWith(new Branch(result.NextBlock));
if (branch.TargetBlock == jumpTableBlock) {
if (result.NextBlockOrExitContainer is BlockContainer exitContainer) {
branch.ReplaceWith(new Leave(exitContainer));
} else {
branch.ReplaceWith(new Branch((Block)result.NextBlockOrExitContainer));
}
}
}
@ -104,17 +107,17 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -104,17 +107,17 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
/// <summary>
/// Analyzes all catch handlers and returns every handler that follows the await catch handler pattern.
/// </summary>
static bool AnalyzeHandlers(InstructionCollection<TryCatchHandler> handlers, out ILVariable catchHandlerIdentifier, out List<(int Id, TryCatchHandler Handler, Block RealCatchBlockEntryPoint, Block NextBlock, IfInstruction JumpTableEntry, StLoc ObjectVariableStore)> transformableCatchBlocks)
static bool AnalyzeHandlers(InstructionCollection<TryCatchHandler> handlers, out ILVariable catchHandlerIdentifier, out List<(int Id, TryCatchHandler Handler, Block RealCatchBlockEntryPoint, ILInstruction NextBlockOrExitContainer, IfInstruction JumpTableEntry, StLoc ObjectVariableStore)> transformableCatchBlocks)
{
transformableCatchBlocks = new List<(int Id, TryCatchHandler Handler, Block RealCatchBlockEntryPoint, Block NextBlock, IfInstruction JumpTableEntry, StLoc ObjectVariableStore)>();
transformableCatchBlocks = new List<(int Id, TryCatchHandler Handler, Block RealCatchBlockEntryPoint, ILInstruction NextBlockOrExitContainer, IfInstruction JumpTableEntry, StLoc ObjectVariableStore)>();
catchHandlerIdentifier = null;
foreach (var handler in handlers) {
if (!MatchAwaitCatchHandler((BlockContainer)handler.Body, out int id, out var identifierVariable, out var realEntryPoint, out var nextBlock, out var jumpTableEntry, out var objectVariableStore))
if (!MatchAwaitCatchHandler((BlockContainer)handler.Body, out int id, out var identifierVariable, out var realEntryPoint, out var nextBlockOrExitContainer, out var jumpTableEntry, out var objectVariableStore))
continue;
if (id < 1 || (catchHandlerIdentifier != null && identifierVariable != catchHandlerIdentifier))
continue;
catchHandlerIdentifier = identifierVariable;
transformableCatchBlocks.Add((id, handler, realEntryPoint, nextBlock, jumpTableEntry, objectVariableStore));
transformableCatchBlocks.Add((id, handler, realEntryPoint, nextBlockOrExitContainer, jumpTableEntry, objectVariableStore));
}
return transformableCatchBlocks.Count > 0;
}
@ -126,14 +129,14 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -126,14 +129,14 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
/// stloc V_5(ldc.i4 2) - store id of catch block in 'identifierVariable'
/// br IL_0075 - jump out of catch block to the head of the catch-handler jump table
/// </summary>
static bool MatchAwaitCatchHandler(BlockContainer container, out int id, out ILVariable identifierVariable, out Block realEntryPoint, out Block nextBlock, out IfInstruction jumpTableEntry, out StLoc objectVariableStore)
static bool MatchAwaitCatchHandler(BlockContainer container, out int id, out ILVariable identifierVariable, out Block realEntryPoint, out ILInstruction nextBlockOrExitContainer, out IfInstruction jumpTableEntry, out StLoc objectVariableStore)
{
id = default(int);
identifierVariable = null;
realEntryPoint = null;
jumpTableEntry = null;
objectVariableStore = null;
nextBlock = null;
nextBlockOrExitContainer = null;
var catchBlock = container.EntryPoint;
if (catchBlock.Instructions.Count < 2 || catchBlock.Instructions.Count > 4)
return false;
@ -181,7 +184,7 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow @@ -181,7 +184,7 @@ namespace ICSharpCode.Decompiler.IL.ControlFlow
if (!left.MatchLdLoc(identifierVariableCopy))
return false;
if (right.MatchLdcI4(id)) {
nextBlock = jumpTableEntryBlock;
nextBlockOrExitContainer = jumpTableEntryBlock ?? lastInst.Parent.Parent;
jumpTableEntry = ifInst;
return true;
}

4
ICSharpCode.Decompiler/IL/ILReader.cs

@ -1377,12 +1377,12 @@ namespace ICSharpCode.Decompiler.IL @@ -1377,12 +1377,12 @@ namespace ICSharpCode.Decompiler.IL
var target = arguments[0];
var value = arguments.Last();
var indices = arguments.Skip(1).Take(arguments.Length - 2).ToArray();
return new StObj(new LdElema(elementType, target, indices), value, elementType);
return new StObj(new LdElema(elementType, target, indices) { DelayExceptions = true }, value, elementType);
}
if (method.Name == "Get") {
var target = arguments[0];
var indices = arguments.Skip(1).ToArray();
return Push(new LdObj(new LdElema(elementType, target, indices), elementType));
return Push(new LdObj(new LdElema(elementType, target, indices) { DelayExceptions = true }, elementType));
}
if (method.Name == "Address") {
var target = arguments[0];

8
ICSharpCode.Decompiler/IL/Instructions.cs

@ -3617,6 +3617,8 @@ namespace ICSharpCode.Decompiler.IL @@ -3617,6 +3617,8 @@ namespace ICSharpCode.Decompiler.IL
public override void WriteTo(ITextOutput output, ILAstWritingOptions options)
{
ILRange.WriteTo(output, options);
if (DelayExceptions)
output.Write("delayex.");
output.Write(OpCode);
output.Write(' ');
field.WriteTo(output);
@ -3639,7 +3641,7 @@ namespace ICSharpCode.Decompiler.IL @@ -3639,7 +3641,7 @@ namespace ICSharpCode.Decompiler.IL
protected internal override bool PerformMatch(ILInstruction other, ref Patterns.Match match)
{
var o = other as LdFlda;
return o != null && this.target.PerformMatch(o.target, ref match) && field.Equals(o.field);
return o != null && this.target.PerformMatch(o.target, ref match) && DelayExceptions == o.DelayExceptions && field.Equals(o.field);
}
}
}
@ -4642,6 +4644,8 @@ namespace ICSharpCode.Decompiler.IL @@ -4642,6 +4644,8 @@ namespace ICSharpCode.Decompiler.IL
public override void WriteTo(ITextOutput output, ILAstWritingOptions options)
{
ILRange.WriteTo(output, options);
if (DelayExceptions)
output.Write("delayex.");
if (IsReadOnly)
output.Write("readonly.");
output.Write(OpCode);
@ -4670,7 +4674,7 @@ namespace ICSharpCode.Decompiler.IL @@ -4670,7 +4674,7 @@ namespace ICSharpCode.Decompiler.IL
protected internal override bool PerformMatch(ILInstruction other, ref Patterns.Match match)
{
var o = other as LdElema;
return o != null && type.Equals(o.type) && this.array.PerformMatch(o.array, ref match) && Patterns.ListMatch.DoMatch(this.Indices, o.Indices, ref match) && IsReadOnly == o.IsReadOnly;
return o != null && type.Equals(o.type) && this.array.PerformMatch(o.array, ref match) && Patterns.ListMatch.DoMatch(this.Indices, o.Indices, ref match) && DelayExceptions == o.DelayExceptions && IsReadOnly == o.IsReadOnly;
}
}
}

3
ICSharpCode.Decompiler/IL/Instructions.tt

@ -708,6 +708,9 @@ namespace ICSharpCode.Decompiler.IL @@ -708,6 +708,9 @@ namespace ICSharpCode.Decompiler.IL
static Action<OpCode> MayThrowIfNotDelayed = HasFlag("(DelayExceptions ? InstructionFlags.None : InstructionFlags.MayThrow)") + (opCode => {
opCode.Members.Add("public bool DelayExceptions; // NullReferenceException/IndexOutOfBoundsException only occurs when the reference is dereferenced");
opCode.GenerateWriteTo = true;
opCode.WriteOpCodePrefix.Add("if (DelayExceptions)" + Environment.NewLine + "\toutput.Write(\"delayex.\");");
opCode.PerformMatchConditions.Add("DelayExceptions == o.DelayExceptions");
});
static Action<OpCode> BaseClass(string name)

8
ICSharpCode.Decompiler/IL/Transforms/DynamicCallSiteTransform.cs

@ -322,11 +322,11 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -322,11 +322,11 @@ namespace ICSharpCode.Decompiler.IL.Transforms
int numberOfTypeArguments = 0;
if (!value.MatchLdNull()) {
if (value is NewArr typeArgsNewArr && typeArgsNewArr.Type.IsKnownType(KnownTypeCode.Type) && typeArgsNewArr.Indices.Count == 1 && typeArgsNewArr.Indices[0].MatchLdcI4(out numberOfTypeArguments)) {
if (!TransformArrayInitializers.HandleSimpleArrayInitializer(callSiteInitBlock, 3, variableOrTemporary, typeArgsNewArr.Type, numberOfTypeArguments, out var typeArguments, out _))
if (!TransformArrayInitializers.HandleSimpleArrayInitializer(context.Function, callSiteInitBlock, 3, variableOrTemporary, typeArgsNewArr.Type, new[] { numberOfTypeArguments }, out var typeArguments, out _))
return false;
int i = 0;
callSiteInfo.TypeArguments = new IType[numberOfTypeArguments];
foreach (var typeArg in typeArguments) {
foreach (var (_, typeArg) in typeArguments) {
if (!TransformExpressionTrees.MatchGetTypeFromHandle(typeArg, out var type))
return false;
callSiteInfo.TypeArguments[i] = type;
@ -496,12 +496,12 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -496,12 +496,12 @@ namespace ICSharpCode.Decompiler.IL.Transforms
{
if (!(value is NewArr newArr2 && newArr2.Type.FullName == "Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo" && newArr2.Indices.Count == 1 && newArr2.Indices[0].MatchLdcI4(out var numberOfArguments)))
return false;
if (!TransformArrayInitializers.HandleSimpleArrayInitializer(callSiteInfo.InitBlock, instructionOffset, variable, newArr2.Type, numberOfArguments, out var arguments, out _))
if (!TransformArrayInitializers.HandleSimpleArrayInitializer(context.Function, callSiteInfo.InitBlock, instructionOffset, variable, newArr2.Type, new[] { numberOfArguments }, out var arguments, out _))
return false;
int i = 0;
callSiteInfo.ArgumentInfos = new CSharpArgumentInfo[numberOfArguments];
var compileTimeTypes = callSiteInfo.DelegateType.GetDelegateInvokeMethod().Parameters.SelectReadOnlyArray(p => p.Type);
foreach (var arg in arguments) {
foreach (var (_, arg) in arguments) {
if (!(arg is Call createCall))
return false;
if (!(createCall.Method.Name == "Create" && createCall.Method.DeclaringType.FullName == "Microsoft.CSharp.RuntimeBinder.CSharpArgumentInfo" && createCall.Arguments.Count == 2))

4
ICSharpCode.Decompiler/IL/Transforms/ILInlining.cs

@ -90,7 +90,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -90,7 +90,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return modified;
}
static bool IsInConstructorInitializer(ILFunction function, ILInstruction inst, ref int? ctorCallStart)
internal static bool IsInConstructorInitializer(ILFunction function, ILInstruction inst, ref int? ctorCallStart)
{
if (ctorCallStart == null) {
if (function == null || !function.Method.IsConstructor)
@ -109,7 +109,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -109,7 +109,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return topLevelInst.ILRange.InclusiveEnd < ctorCallStart.GetValueOrDefault();
}
static bool IsCatchWhenBlock(Block block)
internal static bool IsCatchWhenBlock(Block block)
{
var container = BlockContainer.FindClosestContainer(block);
return container?.Parent is TryCatchHandler handler

26
ICSharpCode.Decompiler/IL/Transforms/NullCoalescingTransform.cs

@ -55,11 +55,29 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -55,11 +55,29 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return false;
if (!block.Instructions[pos + 1].MatchIfInstruction(out var condition, out var trueInst))
return false;
if (!(condition.MatchCompEquals(out var left, out var right) && left.MatchLdLoc(stloc.Variable) && right.MatchLdNull()))
return false;
trueInst = Block.Unwrap(trueInst);
if (condition.MatchCompEquals(out var left, out var right) && left.MatchLdLoc(stloc.Variable) && right.MatchLdNull()
&& trueInst.MatchStLoc(stloc.Variable, out var fallbackValue)
) {
context.Step("NullCoalescingTransform (reference types)", stloc);
if (trueInst.MatchStLoc(stloc.Variable, out var fallbackValue)) {
context.Step("NullCoalescingTransform: simple (reference types)", stloc);
stloc.Value = new NullCoalescingInstruction(NullCoalescingKind.Ref, stloc.Value, fallbackValue);
block.Instructions.RemoveAt(pos + 1); // remove if instruction
ILInlining.InlineOneIfPossible(block, pos, InliningOptions.None, context);
return true;
}
// sometimes the compiler generates:
// stloc s(valueInst)
// if (comp(ldloc s == ldnull)) {
// stloc v(fallbackInst)
// stloc s(ldloc v)
// }
// v must be single-assign and single-use.
if (trueInst is Block trueBlock && trueBlock.Instructions.Count == 2
&& trueBlock.Instructions[0].MatchStLoc(out var temporary, out fallbackValue)
&& temporary.IsSingleDefinition && temporary.LoadCount == 1
&& trueBlock.Instructions[1].MatchStLoc(stloc.Variable, out var useOfTemporary)
&& useOfTemporary.MatchLdLoc(temporary)) {
context.Step("NullCoalescingTransform: with temporary variable (reference types)", stloc);
stloc.Value = new NullCoalescingInstruction(NullCoalescingKind.Ref, stloc.Value, fallbackValue);
block.Instructions.RemoveAt(pos + 1); // remove if instruction
ILInlining.InlineOneIfPossible(block, pos, InliningOptions.None, context);

158
ICSharpCode.Decompiler/IL/Transforms/TransformArrayInitializers.cs

@ -39,9 +39,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -39,9 +39,9 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return;
this.context = context;
try {
if (DoTransform(block, pos))
if (DoTransform(context.Function, block, pos))
return;
if (DoTransformMultiDim(block, pos))
if (DoTransformMultiDim(context.Function, block, pos))
return;
if (context.Settings.StackAllocInitializers && DoTransformStackAllocInitializer(block, pos))
return;
@ -50,14 +50,14 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -50,14 +50,14 @@ namespace ICSharpCode.Decompiler.IL.Transforms
}
}
bool DoTransform(Block body, int pos)
bool DoTransform(ILFunction function, Block body, int pos)
{
if (pos >= body.Instructions.Count - 2)
return false;
ILInstruction inst = body.Instructions[pos];
if (inst.MatchStLoc(out var v, out var newarrExpr) && MatchNewArr(newarrExpr, out var elementType, out var arrayLength)) {
if (ForwardScanInitializeArrayRuntimeHelper(body, pos + 1, v, elementType, arrayLength, out var values, out var initArrayPos)) {
context.Step("ForwardScanInitializeArrayRuntimeHelper", inst);
context.Step("ForwardScanInitializeArrayRuntimeHelper: single-dim", inst);
var tempStore = context.Function.RegisterVariable(VariableKind.InitializerTarget, v.Type);
var block = BlockFromInitializer(tempStore, elementType, arrayLength, values);
body.Instructions[pos] = new StLoc(v, block);
@ -66,16 +66,17 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -66,16 +66,17 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return true;
}
if (arrayLength.Length == 1) {
if (HandleSimpleArrayInitializer(body, pos + 1, v, elementType, arrayLength[0], out values, out var instructionsToRemove)) {
context.Step("HandleSimpleArrayInitializer", inst);
if (HandleSimpleArrayInitializer(function, body, pos + 1, v, elementType, arrayLength, out var arrayValues, out var instructionsToRemove)) {
context.Step("HandleSimpleArrayInitializer: single-dim", inst);
var block = new Block(BlockKind.ArrayInitializer);
var tempStore = context.Function.RegisterVariable(VariableKind.InitializerTarget, v.Type);
block.Instructions.Add(new StLoc(tempStore, new NewArr(elementType, arrayLength.Select(l => new LdcI4(l)).ToArray())));
block.Instructions.AddRange(values.SelectWithIndex(
(i, value) => {
block.Instructions.AddRange(arrayValues.Select(
t => {
var (indices, value) = t;
if (value == null)
value = GetNullExpression(elementType);
return StElem(new LdLoc(tempStore), new[] { new LdcI4(i) }, value, elementType);
return StElem(new LdLoc(tempStore), indices, value, elementType);
}
));
block.FinalInstruction = new LdLoc(tempStore);
@ -85,7 +86,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -85,7 +86,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return true;
}
if (HandleJaggedArrayInitializer(body, pos + 1, v, elementType, arrayLength[0], out ILVariable finalStore, out values, out instructionsToRemove)) {
context.Step("HandleJaggedArrayInitializer", inst);
context.Step("HandleJaggedArrayInitializer: single-dim", inst);
var block = new Block(BlockKind.ArrayInitializer);
var tempStore = context.Function.RegisterVariable(VariableKind.InitializerTarget, v.Type);
block.Instructions.Add(new StLoc(tempStore, new NewArr(elementType, arrayLength.Select(l => new LdcI4(l)).ToArray())));
@ -101,19 +102,39 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -101,19 +102,39 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return false;
}
bool DoTransformMultiDim(Block body, int pos)
bool DoTransformMultiDim(ILFunction function, Block body, int pos)
{
if (pos >= body.Instructions.Count - 2)
return false;
ILInstruction instr = body.Instructions[pos];
if (instr.MatchStLoc(out var v, out var newarrExpr) && MatchNewArr(newarrExpr, out var arrayType, out var length)) {
if (ForwardScanInitializeArrayRuntimeHelper(body, pos + 1, v, arrayType, length, out var values, out var initArrayPos)) {
var block = BlockFromInitializer(v, arrayType, length, values);
ILInstruction inst = body.Instructions[pos];
if (inst.MatchStLoc(out var v, out var newarrExpr) && MatchNewArr(newarrExpr, out var elementType, out var length)) {
if (ForwardScanInitializeArrayRuntimeHelper(body, pos + 1, v, elementType, length, out var values, out var initArrayPos)) {
context.Step("ForwardScanInitializeArrayRuntimeHelper: multi-dim", inst);
var block = BlockFromInitializer(v, elementType, length, values);
body.Instructions[pos].ReplaceWith(new StLoc(v, block));
body.Instructions.RemoveAt(initArrayPos);
ILInlining.InlineIfPossible(body, pos, context);
return true;
}
if (HandleSimpleArrayInitializer(function, body, pos + 1, v, elementType, length, out var arrayValues, out var instructionsToRemove)) {
context.Step("HandleSimpleArrayInitializer: multi-dim", inst);
var block = new Block(BlockKind.ArrayInitializer);
var tempStore = context.Function.RegisterVariable(VariableKind.InitializerTarget, v.Type);
block.Instructions.Add(new StLoc(tempStore, new NewArr(elementType, length.Select(l => new LdcI4(l)).ToArray())));
block.Instructions.AddRange(arrayValues.Select(
t => {
var (indices, value) = t;
if (value == null)
value = GetNullExpression(elementType);
return StElem(new LdLoc(tempStore), indices, value, elementType);
}
));
block.FinalInstruction = new LdLoc(tempStore);
body.Instructions[pos] = new StLoc(v, block);
body.Instructions.RemoveRange(pos + 1, instructionsToRemove);
ILInlining.InlineIfPossible(body, pos, context);
return true;
}
}
return false;
}
@ -277,39 +298,108 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -277,39 +298,108 @@ namespace ICSharpCode.Decompiler.IL.Transforms
/// <summary>
/// Handle simple case where RuntimeHelpers.InitializeArray is not used.
/// </summary>
internal static bool HandleSimpleArrayInitializer(Block block, int pos, ILVariable store, IType elementType, int length, out ILInstruction[] values, out int elementCount)
internal static bool HandleSimpleArrayInitializer(ILFunction function, Block block, int pos, ILVariable store, IType elementType, int[] arrayLength, out (ILInstruction[] Indices, ILInstruction Value)[] values, out int elementCount)
{
elementCount = 0;
values = new ILInstruction[length];
int nextMinimumIndex = 0;
for (int i = pos; i < block.Instructions.Count; i++) {
if (nextMinimumIndex >= length)
break;
if (!block.Instructions[i].MatchStObj(out ILInstruction target, out ILInstruction value, out IType type)
|| value.Descendants.OfType<IInstructionWithVariableOperand>().Any(inst => inst.Variable == store))
{
break;
}
var length = arrayLength.Aggregate(1, (t, l) => t * l);
values = new (ILInstruction[] Indices, ILInstruction Value)[length];
if (!(target is LdElema ldelem) || !ldelem.Array.MatchLdLoc(store) || ldelem.Indices.Count != 1
|| !ldelem.Indices[0].MatchLdcI4(out int index))
int[] nextMinimumIndex = new int[arrayLength.Length];
ILInstruction[] CalculateNextIndices(InstructionCollection<ILInstruction> indices, out bool exactMatch)
{
break;
var nextIndices = new ILInstruction[arrayLength.Length];
exactMatch = true;
if (indices == null) {
for (int k = 0; k < nextIndices.Length; k++) {
nextIndices[k] = new LdcI4(nextMinimumIndex[k]);
}
} else {
for (int k = 0; k < indices.Count; k++) {
if (!indices[k].MatchLdcI4(out int index))
return nextIndices;
// index must be in range [0..length[ and must be greater than or equal to nextMinimumIndex
// to avoid running out of bounds or accidentally reordering instructions or overwriting previous instructions.
// However, leaving array slots empty is allowed, as those are filled with default values when the
// initializer block is generated.
if (index < 0 || index >= length || index < nextMinimumIndex)
if (index < 0 || index >= arrayLength[k] || index < nextMinimumIndex[k])
return null;
if (index != nextMinimumIndex[k]) {
exactMatch = false;
nextIndices[k] = new LdcI4(nextMinimumIndex[k]);
} else {
nextIndices[k] = indices[k];
}
}
}
for (int k = nextMinimumIndex.Length - 1; k >= 0; k--) {
nextMinimumIndex[k]++;
if (nextMinimumIndex[k] < arrayLength[k])
break;
nextMinimumIndex[k] = 0;
}
return nextIndices;
}
int j = 0;
int i = pos;
for (; i < block.Instructions.Count; i++) {
if (!block.Instructions[i].MatchStObj(out ILInstruction target, out ILInstruction value, out IType type))
break;
if (value.Descendants.OfType<IInstructionWithVariableOperand>().Any(inst => inst.Variable == store))
break;
if (!(target is LdElema ldelem && ldelem.Array.MatchLdLoc(store)))
break;
var indices = ldelem.Indices;
if (indices.Count != arrayLength.Length)
break;
bool exact;
do {
var nextIndices = CalculateNextIndices(indices, out exact);
if (nextIndices == null)
return false;
nextMinimumIndex = index;
values[nextMinimumIndex] = value;
nextMinimumIndex++;
if (exact) {
values[j] = (nextIndices, value);
elementCount++;
} else {
values[j] = (nextIndices, null);
}
j++;
} while (!exact);
}
if (i < block.Instructions.Count) {
if (block.Instructions[i].MatchStObj(out ILInstruction target, out ILInstruction value, out IType type)) {
// An element of the array is modified directly after the initializer:
// Abort transform, so that partial initializers are not constructed.
if (target is LdElema ldelem && ldelem.Array.MatchLdLoc(store))
return false;
}
}
while (j < values.Length) {
var nextIndices = CalculateNextIndices(null, out _);
if (nextIndices == null)
return false;
values[j] = (nextIndices, null);
j++;
}
if (pos + elementCount >= block.Instructions.Count)
return false;
return elementCount > 0;
return ShouldTransformToInitializer(function, block, pos, elementCount, length);
}
static bool ShouldTransformToInitializer(ILFunction function, Block block, int startPos, int elementCount, int length)
{
if (elementCount == 0)
return false;
if (elementCount >= length / 3 - 5)
return true;
int? unused = null;
if (ILInlining.IsCatchWhenBlock(block) || ILInlining.IsInConstructorInitializer(function, block.Instructions[startPos], ref unused))
return true;
return false;
}
bool HandleJaggedArrayInitializer(Block block, int pos, ILVariable store, IType elementType, int length, out ILVariable finalStore, out ILInstruction[] values, out int instructionsToRemove)

18
ICSharpCode.Decompiler/IL/Transforms/TransformCollectionAndObjectInitializers.cs

@ -265,6 +265,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -265,6 +265,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
instruction = call.Arguments[0];
if (method.IsAccessor) {
var property = method.AccessorOwner as IProperty;
if (!CanBeUsedInInitializer(property, resolveContext, kind, path)) goto default;
var isGetter = method.Equals(property?.Getter);
var indices = call.Arguments.Skip(1).Take(call.Arguments.Count - (isGetter ? 1 : 2)).ToArray();
if (indices.Length > 0 && !settings.DictionaryInitializers) goto default;
@ -292,7 +293,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -292,7 +293,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
}
break;
case LdObj ldobj: {
if (ldobj.Target is LdFlda ldflda) {
if (ldobj.Target is LdFlda ldflda && (kind != AccessPathKind.Setter || !ldflda.Field.IsReadOnly)) {
path.Insert(0, new AccessPathElement(ldobj.OpCode, ldflda.Field));
instruction = ldflda.Target;
break;
@ -334,6 +335,21 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -334,6 +335,21 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return (kind, path, values, target);
}
private static bool CanBeUsedInInitializer(IProperty property, CSharpTypeResolveContext resolveContext, AccessPathKind kind, List<AccessPathElement> path)
{
if (property.CanSet && (property.Accessibility == property.Setter.Accessibility || IsAccessorAccessible(property.Setter, resolveContext)))
return true;
return kind != AccessPathKind.Setter;
}
private static bool IsAccessorAccessible(IMethod setter, CSharpTypeResolveContext resolveContext)
{
if (resolveContext == null)
return true;
var lookup = new MemberLookup(resolveContext.CurrentTypeDefinition, resolveContext.CurrentModule);
return lookup.IsAccessible(setter, allowProtectedAccess: setter.DeclaringTypeDefinition == resolveContext.CurrentTypeDefinition);
}
static bool IsMethodApplicable(IMethod method, IReadOnlyList<ILInstruction> arguments, IType rootType, CSharpTypeResolveContext resolveContext, DecompilerSettings settings)
{
if (method.IsStatic && !method.IsExtensionMethod)

41
ICSharpCode.Decompiler/IL/Transforms/TransformExpressionTrees.cs

@ -214,6 +214,10 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -214,6 +214,10 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return false;
if (!this.parameters.TryGetValue(v, out var value))
return false;
// Parameter variable cannot be used in two different compiler-generated expression trees,
// therefore we have to abort if the parameter is already mapped to a variable.
if (this.parameterMapping.ContainsKey(v))
return false;
var param = new ILVariable(VariableKind.Parameter, value.Item1, i) { Name = value.Item2 };
parameterMapping.Add(v, param);
parameterVariables.Add(param);
@ -227,7 +231,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -227,7 +231,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
}
}
(ILInstruction, IType) ConvertInstruction(ILInstruction instruction)
(ILInstruction, IType) ConvertInstruction(ILInstruction instruction, IType typeHint = null)
{
var result = Convert();
if (result.Item1 != null) {
@ -275,7 +279,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -275,7 +279,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
case "ExclusiveOr":
return ConvertBinaryNumericOperator(invocation, BinaryNumericOperator.BitXor);
case "Field":
return ConvertField(invocation);
return ConvertField(invocation, typeHint);
case "GreaterThan":
return ConvertComparison(invocation, ComparisonKind.GreaterThan);
case "GreaterThanOrEqual":
@ -345,8 +349,11 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -345,8 +349,11 @@ namespace ICSharpCode.Decompiler.IL.Transforms
if (IsExpressionTreeParameter(ldloc.Variable)) {
// Replace an already mapped parameter with the actual ILVariable,
// we generated earlier.
if (parameterMapping.TryGetValue(ldloc.Variable, out var v))
if (parameterMapping.TryGetValue(ldloc.Variable, out var v)) {
if (typeHint.SkipModifiers() is ByReferenceType brt && !v.Type.IsByRefLike)
return (new LdLoca(v), typeHint);
return (new LdLoc(v), v.Type);
}
// This is a parameter variable from an outer scope.
// We can't replace these variables just yet, because the transform works backwards.
// We simply return the same instruction again, but return the actual expected type,
@ -490,11 +497,15 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -490,11 +497,15 @@ namespace ICSharpCode.Decompiler.IL.Transforms
}
if (arguments == null)
return (null, SpecialType.UnknownType);
// TODO : do we need the types here?
arguments = arguments.Select(i => ConvertInstruction(i).Item1).ToArray();
if (arguments.Any(p => p == null))
return (null, SpecialType.UnknownType);
IMethod method = (IMethod)member;
Debug.Assert(arguments.Count == method.Parameters.Count);
for (int i = 0; i < arguments.Count; i++) {
var expectedType = method.Parameters[i].Type;
var (argument, argumentType) = ConvertInstruction(arguments[i], expectedType);
if (argument == null)
return (null, SpecialType.UnknownType);
arguments[i] = argument;
}
if (method.FullName == "System.Reflection.MethodInfo.CreateDelegate" && method.Parameters.Count == 2) {
if (!MatchGetMethodFromHandle(target, out var targetMethod))
return (null, SpecialType.UnknownType);
@ -668,7 +679,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -668,7 +679,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
return (call, member.ReturnType);
}
(ILInstruction, IType) ConvertField(CallInstruction invocation)
(ILInstruction, IType) ConvertField(CallInstruction invocation, IType typeHint)
{
if (invocation.Arguments.Count != 2)
return (null, SpecialType.UnknownType);
@ -680,15 +691,23 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -680,15 +691,23 @@ namespace ICSharpCode.Decompiler.IL.Transforms
}
if (!MatchGetFieldFromHandle(invocation.Arguments[1], out var member))
return (null, SpecialType.UnknownType);
IType type = member.ReturnType;
ILInstruction inst;
if (target == null) {
return (new LdObj(new LdsFlda((IField)member), member.ReturnType), member.ReturnType);
inst = new LdsFlda((IField)member);
} else {
if (member.DeclaringType.IsReferenceType == true) {
return (new LdObj(new LdFlda(target, (IField)member), member.ReturnType), member.ReturnType);
inst = new LdFlda(target, (IField)member);
} else {
return (new LdObj(new LdFlda(new AddressOf(target), (IField)member), member.ReturnType), member.ReturnType);
inst = new LdFlda(new AddressOf(target), (IField)member);
}
}
if (typeHint.SkipModifiers() is ByReferenceType brt && !member.ReturnType.IsByRefLike) {
type = typeHint;
} else {
inst = new LdObj(inst, member.ReturnType);
}
return (inst, type);
}
(ILInstruction, IType) ConvertInvoke(CallInstruction invocation)

2
ICSharpCode.Decompiler/IL/Transforms/UsingTransform.cs

@ -144,7 +144,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -144,7 +144,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
{
// non-generic IEnumerator does not implement IDisposable.
// This is a workaround for non-generic foreach.
if (type.IsKnownType(KnownTypeCode.IEnumerator))
if (type.IsKnownType(KnownTypeCode.IEnumerator) || type.GetAllBaseTypes().Any(b => b.IsKnownType(KnownTypeCode.IEnumerator)))
return true;
if (NullableType.GetUnderlyingType(type).GetAllBaseTypes().Any(b => b.IsKnownType(KnownTypeCode.IDisposable)))
return true;

6
ICSharpCode.Decompiler/Metadata/MetadataExtensions.cs

@ -84,7 +84,7 @@ namespace ICSharpCode.Decompiler.Metadata @@ -84,7 +84,7 @@ namespace ICSharpCode.Decompiler.Metadata
$"PublicKeyToken={publicKey}{properties}";
}
static string ToHexString(this IEnumerable<byte> bytes, int estimatedLength)
public static string ToHexString(this IEnumerable<byte> bytes, int estimatedLength)
{
StringBuilder sb = new StringBuilder(estimatedLength * 2);
foreach (var b in bytes)
@ -152,6 +152,10 @@ namespace ICSharpCode.Decompiler.Metadata @@ -152,6 +152,10 @@ namespace ICSharpCode.Decompiler.Metadata
get => minimalCorlibTypeProvider;
}
public static ISignatureTypeProvider<IType, TypeSystem.GenericContext> MinimalSignatureTypeProvider {
get => minimalCorlibTypeProvider;
}
public static PrimitiveTypeCode ToPrimitiveTypeCode(this KnownTypeCode typeCode)
{
switch (typeCode) {

52
ICSharpCode.Decompiler/Metadata/UniversalAssemblyResolver.cs

@ -374,7 +374,7 @@ namespace ICSharpCode.Decompiler.Metadata @@ -374,7 +374,7 @@ namespace ICSharpCode.Decompiler.Metadata
if (DetectMono()) {
path = GetMonoMscorlibBasePath(version);
} else {
path = GetMscorlibBasePath(version);
path = GetMscorlibBasePath(version, reference.PublicKeyToken.ToHexString(8));
}
if (path == null)
@ -387,26 +387,8 @@ namespace ICSharpCode.Decompiler.Metadata @@ -387,26 +387,8 @@ namespace ICSharpCode.Decompiler.Metadata
return null;
}
string GetMscorlibBasePath(Version version)
string GetMscorlibBasePath(Version version, string publicKeyToken)
{
string rootPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "Microsoft.NET");
string[] frameworkPaths = new[] {
Path.Combine(rootPath, "Framework"),
Path.Combine(rootPath, "Framework64")
};
string folder = GetSubFolderForVersion();
foreach (var path in frameworkPaths) {
var basePath = Path.Combine(path, folder);
if (Directory.Exists(basePath))
return basePath;
}
if (throwOnError)
throw new NotSupportedException("Version not supported: " + version);
return null;
string GetSubFolderForVersion()
{
switch (version.Major) {
@ -424,6 +406,36 @@ namespace ICSharpCode.Decompiler.Metadata @@ -424,6 +406,36 @@ namespace ICSharpCode.Decompiler.Metadata
return null;
}
}
if (publicKeyToken == "969db8053d3322ac") {
string programFiles = Environment.Is64BitOperatingSystem ?
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) :
Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
string cfPath = $@"Microsoft.NET\SDK\CompactFramework\v{version.Major}.{version.Minor}\WindowsCE\";
string cfBasePath = Path.Combine(programFiles, cfPath);
if (Directory.Exists(cfBasePath))
return cfBasePath;
} else {
string rootPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "Microsoft.NET");
string[] frameworkPaths = new[] {
Path.Combine(rootPath, "Framework"),
Path.Combine(rootPath, "Framework64")
};
string folder = GetSubFolderForVersion();
if (folder != null) {
foreach (var path in frameworkPaths) {
var basePath = Path.Combine(path, folder);
if (Directory.Exists(basePath))
return basePath;
}
}
}
if (throwOnError)
throw new NotSupportedException("Version not supported: " + version);
return null;
}
string GetMonoMscorlibBasePath(Version version)

2
ICSharpCode.Decompiler/Semantics/LocalResolveResult.cs

@ -61,7 +61,7 @@ namespace ICSharpCode.Decompiler.Semantics @@ -61,7 +61,7 @@ namespace ICSharpCode.Decompiler.Semantics
}
public override object ConstantValue {
get { return IsParameter ? null : variable.ConstantValue; }
get { return IsParameter ? null : variable.GetConstantValue(); }
}
public override string ToString()

4
ICSharpCode.Decompiler/Semantics/MemberResolveResult.cs

@ -48,7 +48,7 @@ namespace ICSharpCode.Decompiler.Semantics @@ -48,7 +48,7 @@ namespace ICSharpCode.Decompiler.Semantics
if (field != null) {
isConstant = field.IsConst;
if (isConstant)
constantValue = field.ConstantValue;
constantValue = field.GetConstantValue();
}
}
@ -62,7 +62,7 @@ namespace ICSharpCode.Decompiler.Semantics @@ -62,7 +62,7 @@ namespace ICSharpCode.Decompiler.Semantics
if (field != null) {
isConstant = field.IsConst;
if (isConstant)
constantValue = field.ConstantValue;
constantValue = field.GetConstantValue();
}
}

2
ICSharpCode.Decompiler/TypeSystem/IVariable.cs

@ -42,6 +42,6 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -42,6 +42,6 @@ namespace ICSharpCode.Decompiler.TypeSystem
/// If this field is a constant, retrieves the value.
/// For parameters, this is the default value.
/// </summary>
object ConstantValue { get; }
object GetConstantValue(bool throwOnInvalidMetadata = false);
}
}

10
ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultParameter.cs

@ -111,8 +111,9 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -111,8 +111,9 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
get { return IsOptional; }
}
public object ConstantValue {
get { return defaultValue; }
public object GetConstantValue(bool throwOnInvalidMetadata)
{
return defaultValue;
}
public override string ToString()
@ -134,8 +135,9 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -134,8 +135,9 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
b.Append(parameter.Type.ReflectionName);
if (parameter.IsOptional && parameter.HasConstantValueInSignature) {
b.Append(" = ");
if (parameter.ConstantValue != null)
b.Append(parameter.ConstantValue.ToString());
object val = parameter.GetConstantValue(throwOnInvalidMetadata: false);
if (val != null)
b.Append(val.ToString());
else
b.Append("null");
}

5
ICSharpCode.Decompiler/TypeSystem/Implementation/DefaultVariable.cs

@ -60,8 +60,9 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -60,8 +60,9 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
get { return isConst; }
}
public object ConstantValue {
get { return constantValue; }
public object GetConstantValue(bool throwOnInvalidMetadata)
{
return constantValue;
}
public SymbolKind SymbolKind {

2
ICSharpCode.Decompiler/TypeSystem/Implementation/FakeMember.cs

@ -108,7 +108,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -108,7 +108,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
bool IField.IsVolatile => false;
bool IVariable.IsConst => false;
object IVariable.ConstantValue => null;
object IVariable.GetConstantValue(bool throwOnInvalidMetadata) => null;
IType IVariable.Type => ReturnType;
public override SymbolKind SymbolKind => SymbolKind.Field;

11
ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataField.cs

@ -201,11 +201,12 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -201,11 +201,12 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
}
}
public object ConstantValue {
get {
public object GetConstantValue(bool throwOnInvalidMetadata)
{
object val = LazyInit.VolatileRead(ref this.constantValue);
if (val != null)
return val;
try {
var metadata = module.metadata;
var fieldDef = metadata.GetFieldDefinition(handle);
if (IsDecimalConstant && DecimalConstantHelper.AllowsDecimalConstants(module)) {
@ -216,9 +217,15 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -216,9 +217,15 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
return null;
var constant = metadata.GetConstant(constantHandle);
var blobReader = metadata.GetBlobReader(constant.Value);
try {
val = blobReader.ReadConstant(constant.TypeCode);
} catch (ArgumentOutOfRangeException) {
throw new BadImageFormatException($"Constant with invalid typecode: {constant.TypeCode}");
}
}
return LazyInit.GetOrSet(ref this.constantValue, val);
} catch (BadImageFormatException) when (!throwOnInvalidMetadata) {
return null;
}
}

11
ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataParameter.cs

@ -130,8 +130,9 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -130,8 +130,9 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
bool IVariable.IsConst => false;
public object ConstantValue {
get {
public object GetConstantValue(bool throwOnInvalidMetadata)
{
try {
var metadata = module.metadata;
var parameterDef = metadata.GetParameter(handle);
if (IsDecimalConstant)
@ -143,7 +144,13 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -143,7 +144,13 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
var constant = metadata.GetConstant(constantHandle);
var blobReader = metadata.GetBlobReader(constant.Value);
try {
return blobReader.ReadConstant(constant.TypeCode);
} catch (ArgumentOutOfRangeException) {
throw new BadImageFormatException($"Constant with invalid typecode: {constant.TypeCode}");
}
} catch (BadImageFormatException) when (!throwOnInvalidMetadata) {
return null;
}
}

4
ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedField.cs

@ -60,8 +60,8 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -60,8 +60,8 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
get { return fieldDefinition.IsConst; }
}
public object ConstantValue {
get { return fieldDefinition.ConstantValue; }
public object GetConstantValue(bool throwOnInvalidMetadata) {
return fieldDefinition.GetConstantValue(throwOnInvalidMetadata);
}
}
}

2
ICSharpCode.Decompiler/TypeSystem/Implementation/SpecializedParameter.cs

@ -47,7 +47,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -47,7 +47,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
string ISymbol.Name => baseParameter.Name;
IType IVariable.Type => newType;
bool IVariable.IsConst => baseParameter.IsConst;
object IVariable.ConstantValue => baseParameter.ConstantValue;
object IVariable.GetConstantValue(bool throwOnInvalidMetadata) => baseParameter.GetConstantValue(throwOnInvalidMetadata);
SymbolKind ISymbol.SymbolKind => SymbolKind.Parameter;
public override string ToString()

13
ICSharpCode.Decompiler/TypeSystem/MetadataModule.cs

@ -141,7 +141,7 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -141,7 +141,7 @@ namespace ICSharpCode.Decompiler.TypeSystem
var attrValue = attr.DecodeValue(this.TypeProvider);
if (attrValue.FixedArguments.Length == 1) {
if (attrValue.FixedArguments[0].Value is string s) {
list.Add(s);
list.Add(GetShortName(s));
}
}
}
@ -152,6 +152,17 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -152,6 +152,17 @@ namespace ICSharpCode.Decompiler.TypeSystem
}
return LazyInit.GetOrSet(ref this.internalsVisibleTo, result);
}
static string GetShortName(string fullAssemblyName)
{
if (fullAssemblyName == null)
return null;
int pos = fullAssemblyName.IndexOf(',');
if (pos < 0)
return fullAssemblyName;
else
return fullAssemblyName.Substring(0, pos);
}
#endregion
#region GetDefinition

3
ILSpy/CommandLineArguments.cs

@ -30,6 +30,7 @@ namespace ICSharpCode.ILSpy @@ -30,6 +30,7 @@ namespace ICSharpCode.ILSpy
public string Search;
public string Language;
public bool NoActivate;
public string ConfigFile;
public CommandLineArguments(IEnumerable<string> arguments)
{
@ -49,6 +50,8 @@ namespace ICSharpCode.ILSpy @@ -49,6 +50,8 @@ namespace ICSharpCode.ILSpy
this.Language = arg.Substring("/language:".Length);
else if (arg.Equals("/noActivate", StringComparison.OrdinalIgnoreCase))
this.NoActivate = true;
else if (arg.StartsWith("/config:", StringComparison.OrdinalIgnoreCase))
this.ConfigFile = arg.Substring("/config:".Length);
} else {
this.AssembliesToLoad.Add(arg);
}

2
ILSpy/Commands/DecompileAllCommand.cs

@ -45,7 +45,7 @@ namespace ICSharpCode.ILSpy @@ -45,7 +45,7 @@ namespace ICSharpCode.ILSpy
Exception exception = null;
using (var writer = new System.IO.StreamWriter("c:\\temp\\decompiled\\" + asm.ShortName + ".cs")) {
try {
//new CSharpLanguage().DecompileAssembly(asm, new Decompiler.PlainTextOutput(writer), new DecompilationOptions() { FullDecompilation = true, CancellationToken = ct });
new CSharpLanguage().DecompileAssembly(asm, new Decompiler.PlainTextOutput(writer), new DecompilationOptions() { FullDecompilation = true, CancellationToken = ct });
}
catch (Exception ex) {
writer.WriteLine(ex.ToString());

10
ILSpy/DecompilationOptions.cs

@ -68,23 +68,23 @@ namespace ICSharpCode.ILSpy @@ -68,23 +68,23 @@ namespace ICSharpCode.ILSpy
internal bool IsDebug = false;
public DecompilationOptions()
: this(MainWindow.Instance.CurrentLanguageVersion, DecompilerSettingsPanel.CurrentDecompilerSettings)
: this(MainWindow.Instance.CurrentLanguageVersion, DecompilerSettingsPanel.CurrentDecompilerSettings, DisplaySettingsPanel.CurrentDisplaySettings)
{
}
public DecompilationOptions(LanguageVersion version)
: this(version, DecompilerSettingsPanel.CurrentDecompilerSettings)
: this(version, DecompilerSettingsPanel.CurrentDecompilerSettings, DisplaySettingsPanel.CurrentDisplaySettings)
{
}
public DecompilationOptions(LanguageVersion version, Options.DecompilerSettings settings)
public DecompilationOptions(LanguageVersion version, Options.DecompilerSettings settings, Options.DisplaySettings displaySettings)
{
if (!Enum.TryParse(version.Version, out Decompiler.CSharp.LanguageVersion languageVersion))
languageVersion = Decompiler.CSharp.LanguageVersion.Latest;
this.DecompilerSettings = new Decompiler.DecompilerSettings(languageVersion) {
AlwaysUseBraces = settings.AlwaysUseBraces,
ExpandMemberDefinitions = settings.ExpandMemberDefinitions,
FoldBraces = settings.FoldBraces,
ExpandMemberDefinitions = displaySettings.ExpandMemberDefinitions,
FoldBraces = displaySettings.FoldBraces,
RemoveDeadCode = settings.RemoveDeadCode,
ShowDebugInfo = settings.ShowDebugInfo,
ShowXmlDocumentation = settings.ShowXmlDocumentation,

42
ILSpy/ExtensionMethods.cs

@ -101,52 +101,40 @@ namespace ICSharpCode.ILSpy @@ -101,52 +101,40 @@ namespace ICSharpCode.ILSpy
return false;
}
*/
public static string ToSuffixString(this System.Reflection.Metadata.EntityHandle token)
public static string ToSuffixString(this System.Reflection.Metadata.EntityHandle handle)
{
if (!DisplaySettingsPanel.CurrentDisplaySettings.ShowMetadataTokens)
return string.Empty;
return " @" + System.Reflection.Metadata.Ecma335.MetadataTokens.GetToken(token).ToString("x8");
int token = System.Reflection.Metadata.Ecma335.MetadataTokens.GetToken(handle);
if (DisplaySettingsPanel.CurrentDisplaySettings.ShowMetadataTokensInBase10)
return " @" + token;
return " @" + token.ToString("x8");
}
public static string ToSuffixString(this System.Reflection.Metadata.MethodDefinitionHandle token)
public static string ToSuffixString(this System.Reflection.Metadata.MethodDefinitionHandle handle)
{
if (!DisplaySettingsPanel.CurrentDisplaySettings.ShowMetadataTokens)
return string.Empty;
return " @" + System.Reflection.Metadata.Ecma335.MetadataTokens.GetToken(token).ToString("x8");
return ToSuffixString((System.Reflection.Metadata.EntityHandle)handle);
}
public static string ToSuffixString(this System.Reflection.Metadata.PropertyDefinitionHandle token)
public static string ToSuffixString(this System.Reflection.Metadata.PropertyDefinitionHandle handle)
{
if (!DisplaySettingsPanel.CurrentDisplaySettings.ShowMetadataTokens)
return string.Empty;
return " @" + System.Reflection.Metadata.Ecma335.MetadataTokens.GetToken(token).ToString("x8");
return ToSuffixString((System.Reflection.Metadata.EntityHandle)handle);
}
public static string ToSuffixString(this System.Reflection.Metadata.EventDefinitionHandle token)
public static string ToSuffixString(this System.Reflection.Metadata.EventDefinitionHandle handle)
{
if (!DisplaySettingsPanel.CurrentDisplaySettings.ShowMetadataTokens)
return string.Empty;
return " @" + System.Reflection.Metadata.Ecma335.MetadataTokens.GetToken(token).ToString("x8");
return ToSuffixString((System.Reflection.Metadata.EntityHandle)handle);
}
public static string ToSuffixString(this System.Reflection.Metadata.FieldDefinitionHandle token)
public static string ToSuffixString(this System.Reflection.Metadata.FieldDefinitionHandle handle)
{
if (!DisplaySettingsPanel.CurrentDisplaySettings.ShowMetadataTokens)
return string.Empty;
return " @" + System.Reflection.Metadata.Ecma335.MetadataTokens.GetToken(token).ToString("x8");
return ToSuffixString((System.Reflection.Metadata.EntityHandle)handle);
}
public static string ToSuffixString(this System.Reflection.Metadata.TypeDefinitionHandle token)
public static string ToSuffixString(this System.Reflection.Metadata.TypeDefinitionHandle handle)
{
if (!DisplaySettingsPanel.CurrentDisplaySettings.ShowMetadataTokens)
return string.Empty;
return " @" + System.Reflection.Metadata.Ecma335.MetadataTokens.GetToken(token).ToString("x8");
return ToSuffixString((System.Reflection.Metadata.EntityHandle)handle);
}
/// <summary>

49
ILSpy/FilterSettings.cs

@ -36,7 +36,7 @@ namespace ICSharpCode.ILSpy @@ -36,7 +36,7 @@ namespace ICSharpCode.ILSpy
{
public FilterSettings(XElement element)
{
this.ShowInternalApi = (bool?)element.Element("ShowInternalAPI") ?? true;
this.ShowApiLevel = (ApiVisibility?)(int?)element.Element("ShowAPILevel") ?? ApiVisibility.PublicOnly;
this.Language = Languages.GetLanguage((string)element.Element("Language"));
this.LanguageVersion = Language.LanguageVersions.FirstOrDefault(v => v.Version == (string)element.Element("LanguageVersion"));
if (this.LanguageVersion == default(LanguageVersion))
@ -47,7 +47,7 @@ namespace ICSharpCode.ILSpy @@ -47,7 +47,7 @@ namespace ICSharpCode.ILSpy
{
return new XElement(
"FilterSettings",
new XElement("ShowInternalAPI", this.ShowInternalApi),
new XElement("ShowAPILevel", (int)this.ShowApiLevel),
new XElement("Language", this.Language.Name),
new XElement("LanguageVersion", this.LanguageVersion.Version)
);
@ -79,18 +79,44 @@ namespace ICSharpCode.ILSpy @@ -79,18 +79,44 @@ namespace ICSharpCode.ILSpy
return text.IndexOf(searchTerm, StringComparison.OrdinalIgnoreCase) >= 0;
}
bool showInternalApi;
ApiVisibility showApiLevel;
/// <summary>
/// Gets/Sets whether internal API members should be shown.
/// Gets/Sets whether public, internal or all API members should be shown.
/// </summary>
public ApiVisibility ShowApiLevel {
get { return showApiLevel; }
set {
if (showApiLevel != value) {
showApiLevel = value;
OnPropertyChanged("ShowApiLevel");
}
}
}
public bool ShowInternalApi {
get { return showInternalApi; }
get { return ShowApiLevel == ApiVisibility.PublicAndInternal; }
set {
if (showInternalApi != value) {
showInternalApi = value;
OnPropertyChanged("ShowInternalAPI");
if (ShowApiLevel == ApiVisibility.PublicAndInternal) {
ShowApiLevel = ApiVisibility.PublicOnly;
} else {
ShowApiLevel = ApiVisibility.PublicAndInternal;
}
OnPropertyChanged("ShowInternalApi");
OnPropertyChanged("ShowAllApi");
}
}
public bool ShowAllApi {
get { return ShowApiLevel == ApiVisibility.All; }
set {
if (ShowApiLevel == ApiVisibility.All) {
ShowApiLevel = ApiVisibility.PublicOnly;
} else {
ShowApiLevel = ApiVisibility.All;
}
OnPropertyChanged("ShowInternalApi");
OnPropertyChanged("ShowAllApi");
}
}
@ -149,4 +175,11 @@ namespace ICSharpCode.ILSpy @@ -149,4 +175,11 @@ namespace ICSharpCode.ILSpy
return f;
}
}
public enum ApiVisibility
{
PublicOnly,
PublicAndInternal,
All
}
}

1
ILSpy/ILSpy.csproj

@ -368,6 +368,7 @@ @@ -368,6 +368,7 @@
<Resource Include="Images\VirtualMethod.png" />
<Resource Include="Images\PInvokeMethod.png" />
<Resource Include="Images\Warning.png" />
<Resource Include="Images\ShowAll.png" />
</ItemGroup>
<ItemGroup>

2
ILSpy/ILSpySettings.cs

@ -114,6 +114,8 @@ namespace ICSharpCode.ILSpy @@ -114,6 +114,8 @@ namespace ICSharpCode.ILSpy
static string GetConfigFile()
{
if (App.CommandLineArguments.ConfigFile != null)
return App.CommandLineArguments.ConfigFile;
string localPath = Path.Combine(Path.GetDirectoryName(typeof(MainWindow).Assembly.Location), "ILSpy.xml");
if (File.Exists(localPath))
return localPath;

BIN
ILSpy/Images/ShowAll.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 B

44
ILSpy/Languages/CSharpLanguage.cs

@ -21,6 +21,7 @@ using System.Collections.Generic; @@ -21,6 +21,7 @@ using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Metadata;
using System.Text;
using System.Windows;
@ -270,7 +271,7 @@ namespace ICSharpCode.ILSpy @@ -270,7 +271,7 @@ namespace ICSharpCode.ILSpy
PEFile assembly = @event.ParentModule.PEFile;
AddReferenceAssemblyWarningMessage(assembly, output);
AddReferenceWarningMessage(assembly, output);
base.WriteCommentLine(output, TypeToString(@event.DeclaringType, includeNamespace: true));
WriteCommentLine(output, TypeToString(@event.DeclaringType, includeNamespace: true));
CSharpDecompiler decompiler = CreateDecompiler(assembly, options);
WriteCode(output, options.DecompilerSettings, decompiler.Decompile(@event.MetadataToken), decompiler.TypeSystem);
}
@ -381,6 +382,21 @@ namespace ICSharpCode.ILSpy @@ -381,6 +382,21 @@ namespace ICSharpCode.ILSpy
if (runtimeName != null) {
output.WriteLine("// Runtime: " + runtimeName);
}
if ((corHeader.Flags & System.Reflection.PortableExecutable.CorFlags.StrongNameSigned) != 0) {
output.WriteLine("// This assembly is signed with a strong name key.");
}
if (metadata.IsAssembly) {
var asm = metadata.GetAssemblyDefinition();
if (asm.HashAlgorithm != System.Reflection.AssemblyHashAlgorithm.None)
output.WriteLine("// Hash algorithm: " + asm.HashAlgorithm.ToString().ToUpper());
if (!asm.PublicKey.IsNil) {
output.Write("// Public key: ");
var reader = metadata.GetBlobReader(asm.PublicKey);
while (reader.RemainingBytes > 0)
output.Write(reader.ReadByte().ToString("x"));
output.WriteLine();
}
}
var debugInfo = assembly.GetDebugInfoOrNull();
if (debugInfo != null) {
output.WriteLine("// Debug info: " + debugInfo.Description);
@ -455,10 +471,16 @@ namespace ICSharpCode.ILSpy @@ -455,10 +471,16 @@ namespace ICSharpCode.ILSpy
throw new ArgumentNullException(nameof(type));
var ambience = CreateAmbience();
// Do not forget to update CSharpAmbienceTests.ILSpyMainTreeViewFlags, if this ever changes.
if (includeNamespace)
if (includeNamespace) {
ambience.ConversionFlags |= ConversionFlags.UseFullyQualifiedTypeNames;
ambience.ConversionFlags |= ConversionFlags.UseFullyQualifiedEntityNames;
}
if (type is ITypeDefinition definition) {
return ambience.ConvertSymbol(definition);
// HACK : UnknownType is not supported by CSharpAmbience.
} else if (type.Kind == TypeKind.Unknown) {
return (includeNamespace ? type.FullName : type.Name)
+ (type.TypeParameterCount > 0 ? "<" + string.Join(",", type.TypeArguments.Select(t => t.Name)) + ">" : "");
} else {
return ambience.ConvertType(type);
}
@ -541,10 +563,23 @@ namespace ICSharpCode.ILSpy @@ -541,10 +563,23 @@ namespace ICSharpCode.ILSpy
var md = metadata.GetMethodDefinition((MethodDefinitionHandle)handle);
declaringType = md.GetDeclaringType();
string methodName = metadata.GetString(md.Name);
if (methodName == ".ctor" || methodName == ".cctor") {
switch (methodName) {
case ".ctor":
case ".cctor":
var td = metadata.GetTypeDefinition(declaringType);
methodName = ReflectionHelper.SplitTypeParameterCountFromReflectionName(metadata.GetString(td.Name));
} else {
break;
case "Finalize":
const MethodAttributes finalizerAttributes = (MethodAttributes.Virtual | MethodAttributes.Family | MethodAttributes.HideBySig);
if ((md.Attributes & finalizerAttributes) != finalizerAttributes)
goto default;
MethodSignature<IType> methodSignature = md.DecodeSignature(MetadataExtensions.MinimalSignatureTypeProvider, default);
if (methodSignature.GenericParameterCount != 0 || methodSignature.ParameterTypes.Length != 0)
goto default;
td = metadata.GetTypeDefinition(declaringType);
methodName = "~" + ReflectionHelper.SplitTypeParameterCountFromReflectionName(metadata.GetString(td.Name));
break;
default:
var genericParams = md.GetGenericParameters();
if (genericParams.Count > 0) {
methodName += "<";
@ -557,6 +592,7 @@ namespace ICSharpCode.ILSpy @@ -557,6 +592,7 @@ namespace ICSharpCode.ILSpy
}
methodName += ">";
}
break;
}
if (fullName)
return ToCSharpString(metadata, declaringType, fullName) + "." + methodName;

1
ILSpy/Languages/ILLanguage.cs

@ -56,6 +56,7 @@ namespace ICSharpCode.ILSpy @@ -56,6 +56,7 @@ namespace ICSharpCode.ILSpy
DetectControlStructure = detectControlStructure,
ShowSequencePoints = options.DecompilerSettings.ShowDebugInfo,
ShowMetadataTokens = Options.DisplaySettingsPanel.CurrentDisplaySettings.ShowMetadataTokens,
ShowMetadataTokensInBase10 = Options.DisplaySettingsPanel.CurrentDisplaySettings.ShowMetadataTokensInBase10,
ExpandMemberDefinitions = options.DecompilerSettings.ExpandMemberDefinitions
};
}

8
ILSpy/MainWindow.xaml

@ -55,6 +55,11 @@ @@ -55,6 +55,11 @@
<Image Width="16" Height="16" Source="Images/PrivateInternal.png" />
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="Show _all types and members" IsCheckable="True" IsChecked="{Binding FilterSettings.ShowAllApi}">
<MenuItem.Icon>
<Image Width="16" Height="16" Source="Images/ShowAll.png" />
</MenuItem.Icon>
</MenuItem>
</MenuItem>
</Menu>
<!-- ToolBar -->
@ -80,6 +85,9 @@ @@ -80,6 +85,9 @@
<CheckBox IsChecked="{Binding FilterSettings.ShowInternalApi}" ToolTip="Show internal types and members">
<Image Width="16" Height="16" Source="Images/PrivateInternal.png" />
</CheckBox>
<CheckBox IsChecked="{Binding FilterSettings.ShowAllApi}" ToolTip="Show all types and members">
<Image Width="16" Height="16" Source="Images/ShowAll.png" />
</CheckBox>
<Separator />
<ComboBox Name="languageComboBox" DisplayMemberPath="Name" Width="100" MaxDropDownHeight="Auto"
ItemsSource="{x:Static local:Languages.AllLanguages}"

2
ILSpy/Options/DecompilerSettingsPanel.xaml

@ -11,11 +11,9 @@ @@ -11,11 +11,9 @@
<CheckBox IsChecked="{Binding UseDebugSymbols}">Use variable names from debug symbols, if available</CheckBox>
<CheckBox IsChecked="{Binding ShowDebugInfo}">Show info from debug symbols, if available</CheckBox>
<CheckBox IsChecked="{Binding ShowXmlDocumentation}">Show XML documentation in decompiled code</CheckBox>
<CheckBox IsChecked="{Binding FoldBraces}">Enable folding on all blocks in braces</CheckBox>
<CheckBox IsChecked="{Binding RemoveDeadCode}">Remove dead and side effect free code</CheckBox>
<CheckBox IsChecked="{Binding UsingDeclarations}">Insert using declarations</CheckBox>
<CheckBox IsChecked="{Binding AlwaysUseBraces}">Always use braces</CheckBox>
<CheckBox IsChecked="{Binding ExpandMemberDefinitions}">Expand member definitions after decompilation</CheckBox>
<CheckBox IsChecked="{Binding ApplyWindowsRuntimeProjections}">Apply Windows Runtime projections on loaded assemblies</CheckBox>
</StackPanel>
</UserControl>

28
ILSpy/Options/DecompilerSettingsPanel.xaml.cs

@ -53,8 +53,6 @@ namespace ICSharpCode.ILSpy.Options @@ -53,8 +53,6 @@ namespace ICSharpCode.ILSpy.Options
DecompilerSettings s = new DecompilerSettings();
s.ShowDebugInfo = (bool?)e.Attribute("showDebugInfo") ?? s.ShowDebugInfo;
s.ShowXmlDocumentation = (bool?)e.Attribute("xmlDoc") ?? s.ShowXmlDocumentation;
s.FoldBraces = (bool?)e.Attribute("foldBraces") ?? s.FoldBraces;
s.ExpandMemberDefinitions = (bool?)e.Attribute("expandMemberDefinitions") ?? s.ExpandMemberDefinitions;
s.RemoveDeadCode = (bool?)e.Attribute("removeDeadCode") ?? s.RemoveDeadCode;
s.UsingDeclarations = (bool?)e.Attribute("usingDeclarations") ?? s.UsingDeclarations;
s.AlwaysUseBraces = (bool?)e.Attribute("alwaysUseBraces") ?? s.AlwaysUseBraces;
@ -69,8 +67,6 @@ namespace ICSharpCode.ILSpy.Options @@ -69,8 +67,6 @@ namespace ICSharpCode.ILSpy.Options
section.SetAttributeValue("useDebugSymbols", s.UseDebugSymbols);
section.SetAttributeValue("showDebugInfo", s.ShowDebugInfo);
section.SetAttributeValue("xmlDoc", s.ShowXmlDocumentation);
section.SetAttributeValue("foldBraces", s.FoldBraces);
section.SetAttributeValue("expandMemberDefinitions", s.ExpandMemberDefinitions);
section.SetAttributeValue("removeDeadCode", s.RemoveDeadCode);
section.SetAttributeValue("usingDeclarations", s.UsingDeclarations);
section.SetAttributeValue("alwaysUseBraces", s.AlwaysUseBraces);
@ -103,30 +99,6 @@ namespace ICSharpCode.ILSpy.Options @@ -103,30 +99,6 @@ namespace ICSharpCode.ILSpy.Options
}
}
bool foldBraces = false;
public bool FoldBraces {
get { return foldBraces; }
set {
if (foldBraces != value) {
foldBraces = value;
OnPropertyChanged();
}
}
}
bool expandMemberDefinitions = false;
public bool ExpandMemberDefinitions {
get { return expandMemberDefinitions; }
set {
if (expandMemberDefinitions != value) {
expandMemberDefinitions = value;
OnPropertyChanged();
}
}
}
bool decompileMemberBodies = true;
/// <summary>

42
ILSpy/Options/DisplaySettings.cs

@ -83,8 +83,7 @@ namespace ICSharpCode.ILSpy.Options @@ -83,8 +83,7 @@ namespace ICSharpCode.ILSpy.Options
bool showMetadataTokens;
public bool ShowMetadataTokens
{
public bool ShowMetadataTokens {
get { return showMetadataTokens; }
set {
if (showMetadataTokens != value) {
@ -94,6 +93,18 @@ namespace ICSharpCode.ILSpy.Options @@ -94,6 +93,18 @@ namespace ICSharpCode.ILSpy.Options
}
}
bool showMetadataTokensInBase10;
public bool ShowMetadataTokensInBase10 {
get { return showMetadataTokensInBase10; }
set {
if (showMetadataTokensInBase10 != value) {
showMetadataTokensInBase10 = value;
OnPropertyChanged();
}
}
}
bool enableWordWrap;
public bool EnableWordWrap
@ -120,14 +131,41 @@ namespace ICSharpCode.ILSpy.Options @@ -120,14 +131,41 @@ namespace ICSharpCode.ILSpy.Options
}
}
bool foldBraces = false;
public bool FoldBraces {
get { return foldBraces; }
set {
if (foldBraces != value) {
foldBraces = value;
OnPropertyChanged();
}
}
}
bool expandMemberDefinitions = false;
public bool ExpandMemberDefinitions {
get { return expandMemberDefinitions; }
set {
if (expandMemberDefinitions != value) {
expandMemberDefinitions = value;
OnPropertyChanged();
}
}
}
public void CopyValues(DisplaySettings s)
{
this.SelectedFont = s.selectedFont;
this.SelectedFontSize = s.selectedFontSize;
this.ShowLineNumbers = s.showLineNumbers;
this.ShowMetadataTokens = s.showMetadataTokens;
this.ShowMetadataTokensInBase10 = s.showMetadataTokensInBase10;
this.EnableWordWrap = s.enableWordWrap;
this.SortResults = s.sortResults;
this.FoldBraces = s.foldBraces;
this.ExpandMemberDefinitions = s.expandMemberDefinitions;
}
}
}

3
ILSpy/Options/DisplaySettingsPanel.xaml

@ -61,8 +61,11 @@ @@ -61,8 +61,11 @@
<StackPanel Margin="3">
<CheckBox IsChecked="{Binding ShowLineNumbers}">Show line numbers</CheckBox>
<CheckBox IsChecked="{Binding ShowMetadataTokens}">Show metadata tokens</CheckBox>
<CheckBox IsChecked="{Binding ShowMetadataTokensInBase10}">Show metadata tokens in base 10</CheckBox>
<CheckBox IsChecked="{Binding EnableWordWrap}">Enable word wrap</CheckBox>
<CheckBox IsChecked="{Binding FoldBraces}">Enable folding on all blocks in braces</CheckBox>
<CheckBox IsChecked="{Binding SortResults}">Sort results by fitness</CheckBox>
<CheckBox IsChecked="{Binding ExpandMemberDefinitions}">Expand member definitions after decompilation</CheckBox>
</StackPanel>
</GroupBox>
</Grid>

19
ILSpy/Options/DisplaySettingsPanel.xaml.cs

@ -100,9 +100,12 @@ namespace ICSharpCode.ILSpy.Options @@ -100,9 +100,12 @@ namespace ICSharpCode.ILSpy.Options
s.SelectedFont = new FontFamily((string)e.Attribute("Font") ?? "Consolas");
s.SelectedFontSize = (double?)e.Attribute("FontSize") ?? 10.0 * 4 / 3;
s.ShowLineNumbers = (bool?)e.Attribute("ShowLineNumbers") ?? false;
s.ShowMetadataTokens = (bool?) e.Attribute("ShowMetadataTokens") ?? false;
s.ShowMetadataTokens = (bool?)e.Attribute("ShowMetadataTokens") ?? false;
s.ShowMetadataTokensInBase10 = (bool?)e.Attribute("ShowMetadataTokensInBase10") ?? false;
s.EnableWordWrap = (bool?)e.Attribute("EnableWordWrap") ?? false;
s.SortResults = (bool?)e.Attribute("SortResults") ?? true;
s.FoldBraces = (bool?)e.Attribute("FoldBraces") ?? false;
s.ExpandMemberDefinitions = (bool?)e.Attribute("ExpandMemberDefinitions") ?? false;
return s;
}
@ -116,8 +119,11 @@ namespace ICSharpCode.ILSpy.Options @@ -116,8 +119,11 @@ namespace ICSharpCode.ILSpy.Options
section.SetAttributeValue("FontSize", s.SelectedFontSize);
section.SetAttributeValue("ShowLineNumbers", s.ShowLineNumbers);
section.SetAttributeValue("ShowMetadataTokens", s.ShowMetadataTokens);
section.SetAttributeValue("ShowMetadataTokensInBase10", s.ShowMetadataTokensInBase10);
section.SetAttributeValue("EnableWordWrap", s.EnableWordWrap);
section.SetAttributeValue("SortResults", s.SortResults);
section.SetAttributeValue("FoldBraces", s.FoldBraces);
section.SetAttributeValue("ExpandMemberDefinitions", s.ExpandMemberDefinitions);
XElement existingElement = root.Element("DisplaySettings");
if (existingElement != null)
@ -134,8 +140,8 @@ namespace ICSharpCode.ILSpy.Options @@ -134,8 +140,8 @@ namespace ICSharpCode.ILSpy.Options
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value is double) {
return Math.Round((double)value / 4 * 3);
if (value is double d) {
return Math.Round(d / 4 * 3);
}
throw new NotImplementedException();
@ -143,11 +149,10 @@ namespace ICSharpCode.ILSpy.Options @@ -143,11 +149,10 @@ namespace ICSharpCode.ILSpy.Options
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value is string) {
double d;
if (double.TryParse((string)value, out d))
if (value is string s) {
if (double.TryParse(s, out double d))
return d * 4 / 3;
return 11 * 4 / 3;
return 11.0 * 4 / 3;
}
throw new NotImplementedException();

2
ILSpy/README.txt

@ -2,7 +2,7 @@ ILSpy is the open-source .NET assembly browser and decompiler. @@ -2,7 +2,7 @@ ILSpy is the open-source .NET assembly browser and decompiler.
Website: https://ilspy.net/
Found a bug?: https://github.com/icsharpcode/ILSpy/issues/new
Copyright 2011-2017 AlphaSierraPapa for the SharpDevelop team
Copyright 2011-2019 AlphaSierraPapa for the SharpDevelop team
License: ILSpy is distributed under the MIT License.
Included open-source libraries:

4
ILSpy/TreeNodes/DerivedTypesEntryNode.cs

@ -49,10 +49,10 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -49,10 +49,10 @@ namespace ICSharpCode.ILSpy.TreeNodes
public override FilterResult Filter(FilterSettings settings)
{
if (!settings.ShowInternalApi && !IsPublicAPI)
if (settings.ShowApiLevel == ApiVisibility.PublicOnly && !IsPublicAPI)
return FilterResult.Hidden;
if (settings.SearchTermMatches(type.Name)) {
if (type.DeclaringType != null && !settings.Language.ShowMember(type))
if (type.DeclaringType != null && (settings.ShowApiLevel != ApiVisibility.All || !settings.Language.ShowMember(type)))
return FilterResult.Hidden;
else
return FilterResult.Match;

4
ILSpy/TreeNodes/EventTreeNode.cs

@ -59,9 +59,9 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -59,9 +59,9 @@ namespace ICSharpCode.ILSpy.TreeNodes
public override FilterResult Filter(FilterSettings settings)
{
if (!settings.ShowInternalApi && !IsPublicAPI)
if (settings.ShowApiLevel == ApiVisibility.PublicOnly && !IsPublicAPI)
return FilterResult.Hidden;
if (settings.SearchTermMatches(EventDefinition.Name) && settings.Language.ShowMember(EventDefinition))
if (settings.SearchTermMatches(EventDefinition.Name) && (settings.ShowApiLevel == ApiVisibility.All || settings.Language.ShowMember(EventDefinition)))
return FilterResult.Match;
else
return FilterResult.Hidden;

4
ILSpy/TreeNodes/FieldTreeNode.cs

@ -60,9 +60,9 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -60,9 +60,9 @@ namespace ICSharpCode.ILSpy.TreeNodes
public override FilterResult Filter(FilterSettings settings)
{
if (!settings.ShowInternalApi && !IsPublicAPI)
if (settings.ShowApiLevel == ApiVisibility.PublicOnly && !IsPublicAPI)
return FilterResult.Hidden;
if (settings.SearchTermMatches(FieldDefinition.Name) && settings.Language.ShowMember(FieldDefinition))
if (settings.SearchTermMatches(FieldDefinition.Name) && (settings.ShowApiLevel == ApiVisibility.All || settings.Language.ShowMember(FieldDefinition)))
return FilterResult.Match;
else
return FilterResult.Hidden;

4
ILSpy/TreeNodes/MethodTreeNode.cs

@ -90,9 +90,9 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -90,9 +90,9 @@ namespace ICSharpCode.ILSpy.TreeNodes
public override FilterResult Filter(FilterSettings settings)
{
if (!settings.ShowInternalApi && !IsPublicAPI)
if (settings.ShowApiLevel == ApiVisibility.PublicOnly && !IsPublicAPI)
return FilterResult.Hidden;
if (settings.SearchTermMatches(MethodDefinition.Name) && settings.Language.ShowMember(MethodDefinition))
if (settings.SearchTermMatches(MethodDefinition.Name) && (settings.ShowApiLevel == ApiVisibility.All || settings.Language.ShowMember(MethodDefinition)))
return FilterResult.Match;
else
return FilterResult.Hidden;

4
ILSpy/TreeNodes/PropertyTreeNode.cs

@ -66,9 +66,9 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -66,9 +66,9 @@ namespace ICSharpCode.ILSpy.TreeNodes
public override FilterResult Filter(FilterSettings settings)
{
if (!settings.ShowInternalApi && !IsPublicAPI)
if (settings.ShowApiLevel == ApiVisibility.PublicOnly && !IsPublicAPI)
return FilterResult.Hidden;
if (settings.SearchTermMatches(PropertyDefinition.Name) && settings.Language.ShowMember(PropertyDefinition))
if (settings.SearchTermMatches(PropertyDefinition.Name) && (settings.ShowApiLevel == ApiVisibility.All || settings.Language.ShowMember(PropertyDefinition)))
return FilterResult.Match;
else
return FilterResult.Hidden;

2
ILSpy/TreeNodes/ResourceNodes/ResourceTreeNode.cs

@ -58,7 +58,7 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -58,7 +58,7 @@ namespace ICSharpCode.ILSpy.TreeNodes
public override FilterResult Filter(FilterSettings settings)
{
if (!settings.ShowInternalApi && (r.Attributes & ManifestResourceAttributes.VisibilityMask) == ManifestResourceAttributes.Private)
if (settings.ShowApiLevel == ApiVisibility.PublicOnly && (r.Attributes & ManifestResourceAttributes.VisibilityMask) == ManifestResourceAttributes.Private)
return FilterResult.Hidden;
if (settings.SearchTermMatches(r.Name))
return FilterResult.Match;

4
ILSpy/TreeNodes/TypeTreeNode.cs

@ -58,10 +58,10 @@ namespace ICSharpCode.ILSpy.TreeNodes @@ -58,10 +58,10 @@ namespace ICSharpCode.ILSpy.TreeNodes
public override FilterResult Filter(FilterSettings settings)
{
if (!settings.ShowInternalApi && !IsPublicAPI)
if (settings.ShowApiLevel == ApiVisibility.PublicOnly && !IsPublicAPI)
return FilterResult.Hidden;
if (settings.SearchTermMatches(TypeDefinition.Name)) {
if (settings.Language.ShowMember(TypeDefinition))
if (settings.ShowApiLevel == ApiVisibility.All || settings.Language.ShowMember(TypeDefinition))
return FilterResult.Match;
else
return FilterResult.Hidden;

2
doc/copyright.txt

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
Copyright 2011-2018 for the SharpDevelop team
Copyright 2011-2019 for the SharpDevelop team
by
AlphaSierraPapa, Christoph Wille

Loading…
Cancel
Save