diff --git a/ICSharpCode.Decompiler.PdbProvider.Cecil/ICSharpCode.Decompiler.PdbProvider.Cecil.csproj b/ICSharpCode.Decompiler.PdbProvider.Cecil/ICSharpCode.Decompiler.PdbProvider.Cecil.csproj
index bd51bff90..c545c43a9 100644
--- a/ICSharpCode.Decompiler.PdbProvider.Cecil/ICSharpCode.Decompiler.PdbProvider.Cecil.csproj
+++ b/ICSharpCode.Decompiler.PdbProvider.Cecil/ICSharpCode.Decompiler.PdbProvider.Cecil.csproj
@@ -7,7 +7,7 @@
-
+
diff --git a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
index f3b3721d5..627f37cb6 100644
--- a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
+++ b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
@@ -37,11 +37,11 @@
-
-
-
-
-
+
+
+
+
+
@@ -71,11 +71,15 @@
+
+
+
+
diff --git a/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs b/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs
index 12fcbb8fd..226f1c151 100644
--- a/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs
+++ b/ICSharpCode.Decompiler.Tests/ILPrettyTestRunner.cs
@@ -124,6 +124,12 @@ namespace ICSharpCode.Decompiler.Tests
Run();
}
+ [Test]
+ public void Issue1323()
+ {
+ Run();
+ }
+
[Test]
public void FSharpLoops_Debug()
{
diff --git a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs
index 344905d7f..445e23082 100644
--- a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs
+++ b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs
@@ -85,31 +85,31 @@ namespace ICSharpCode.Decompiler.Tests
}
[Test]
- public void InlineAssignmentTest([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void InlineAssignmentTest([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void CompoundAssignmentTest([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void CompoundAssignmentTest([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void ShortCircuit([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void ShortCircuit([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void CustomShortCircuitOperators([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void CustomShortCircuitOperators([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void ExceptionHandling([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void ExceptionHandling([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions, decompilerSettings: new DecompilerSettings {
NullPropagation = false,
@@ -119,7 +119,7 @@ namespace ICSharpCode.Decompiler.Tests
}
[Test]
- public void Switch([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void Switch([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions, decompilerSettings: new DecompilerSettings {
// legacy csc generates a dead store in debug builds
@@ -128,49 +128,55 @@ namespace ICSharpCode.Decompiler.Tests
}
[Test]
- public void DelegateConstruction([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void ReduceNesting([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void AnonymousTypes([ValueSource("defaultOptionsWithMcs")] CSharpCompilerOptions cscOptions)
+ public void DelegateConstruction([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void Async([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void AnonymousTypes([ValueSource(nameof(defaultOptionsWithMcs))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void Lock([ValueSource("defaultOptionsWithMcs")] CSharpCompilerOptions cscOptions)
+ public void Async([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void Using([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void Lock([ValueSource(nameof(defaultOptionsWithMcs))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void LiftedOperators([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void Using([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void Generics([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void LiftedOperators([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void Loops([ValueSource("defaultOptionsWithMcs")] CSharpCompilerOptions cscOptions)
+ public void Generics([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
+ {
+ RunForLibrary(cscOptions: cscOptions);
+ }
+
+ [Test]
+ public void Loops([ValueSource(nameof(defaultOptionsWithMcs))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions, decompilerSettings: new DecompilerSettings {
// legacy csc generates a dead store in debug builds
@@ -179,62 +185,62 @@ namespace ICSharpCode.Decompiler.Tests
}
[Test]
- public void PropertiesAndEvents([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void PropertiesAndEvents([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void AutoProperties([ValueSource("roslynOnlyOptions")] CSharpCompilerOptions cscOptions)
+ public void AutoProperties([ValueSource(nameof(roslynOnlyOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void QueryExpressions([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void QueryExpressions([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void TypeAnalysisTests([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void TypeAnalysisTests([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void CheckedUnchecked([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void CheckedUnchecked([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void UnsafeCode([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void UnsafeCode([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void PInvoke([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void PInvoke([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
// This tests needs our own disassembler; ildasm has a bug with marshalinfo.
RunForLibrary(cscOptions: cscOptions, asmOptions: AssemblerOptions.UseOwnDisassembler);
}
[Test]
- public void InitializerTests([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void InitializerTests([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void DynamicTests([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void DynamicTests([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void ExpressionTrees([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void ExpressionTrees([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
@@ -246,79 +252,79 @@ namespace ICSharpCode.Decompiler.Tests
}
[Test]
- public void VariableNaming([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void VariableNaming([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void VariableNamingWithoutSymbols([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void VariableNamingWithoutSymbols([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions, decompilerSettings: new DecompilerSettings { UseDebugSymbols = false });
}
[Test]
- public void CS72_PrivateProtected([ValueSource("roslynOnlyOptions")] CSharpCompilerOptions cscOptions)
+ public void CS72_PrivateProtected([ValueSource(nameof(roslynOnlyOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void AsyncMain([ValueSource("roslynOnlyOptions")] CSharpCompilerOptions cscOptions)
+ public void AsyncMain([ValueSource(nameof(roslynOnlyOptions))] CSharpCompilerOptions cscOptions)
{
Run(cscOptions: cscOptions);
}
[Test]
- public void NullPropagation([ValueSource("roslynOnlyOptions")] CSharpCompilerOptions cscOptions)
+ public void NullPropagation([ValueSource(nameof(roslynOnlyOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void CS6_StringInterpolation([ValueSource("roslynOnlyOptions")] CSharpCompilerOptions cscOptions)
+ public void CS6_StringInterpolation([ValueSource(nameof(roslynOnlyOptions))] CSharpCompilerOptions cscOptions)
{
Run(cscOptions: cscOptions);
}
[Test]
- public void CS73_StackAllocInitializers([ValueSource("roslynOnlyOptions")] CSharpCompilerOptions cscOptions)
+ public void CS73_StackAllocInitializers([ValueSource(nameof(roslynOnlyOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void RefLocalsAndReturns([ValueSource("roslynOnlyOptions")] CSharpCompilerOptions cscOptions)
+ public void RefLocalsAndReturns([ValueSource(nameof(roslynOnlyOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void WellKnownConstants([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void WellKnownConstants([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void QualifierTests([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void QualifierTests([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void TupleTests([ValueSource("roslynOnlyOptions")] CSharpCompilerOptions cscOptions)
+ public void TupleTests([ValueSource(nameof(roslynOnlyOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void NamedArguments([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void NamedArguments([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void OptionalArguments([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void OptionalArguments([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
@@ -354,13 +360,19 @@ namespace ICSharpCode.Decompiler.Tests
}
[Test]
- public void MemberTests([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void MemberTests([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
+ {
+ RunForLibrary(cscOptions: cscOptions);
+ }
+
+ [Test]
+ public void TypeTests([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
[Test]
- public void TypeTests([ValueSource("defaultOptions")] CSharpCompilerOptions cscOptions)
+ public void YieldReturn([ValueSource(nameof(defaultOptions))] CSharpCompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Correctness/Loops.cs b/ICSharpCode.Decompiler.Tests/TestCases/Correctness/Loops.cs
index da2685955..4f79d5850 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Correctness/Loops.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Correctness/Loops.cs
@@ -79,6 +79,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
Console.WriteLine(NoForeachDueToMultipleCurrentAccess(new List { 1, 2, 3, 4, 5 }));
Console.WriteLine(NoForeachCallWithSideEffect(new CustomClassEnumeratorWithIDisposable()));
LoopWithGotoRepeat();
+ Console.WriteLine("LoopFollowedByIf: {0}", LoopFollowedByIf());
}
public static void ForWithMultipleVariables()
@@ -246,5 +247,17 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
}
Console.WriteLine("after finally");
}
+
+ private static int LoopFollowedByIf()
+ {
+ int num = 0;
+ while (num == 0) {
+ num++;
+ }
+ if (num == 0) {
+ return -1;
+ }
+ return num;
+ }
}
}
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Correctness/OverloadResolution.cs b/ICSharpCode.Decompiler.Tests/TestCases/Correctness/OverloadResolution.cs
index 8ba323779..fe271f020 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Correctness/OverloadResolution.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Correctness/OverloadResolution.cs
@@ -32,6 +32,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
Generics();
ConstructorTest();
TestIndexer();
+ Issue1281();
}
#region ConstructorTest
@@ -86,6 +87,24 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
{
Console.WriteLine("TestCall with params: " + (p2 == null ? "null" : p2.Length.ToString()));
}
+
+ static void Issue1281()
+ {
+ var arg = new object[0];
+ TestCallIssue1281(arg);
+ TestCallIssue1281((object)arg);
+ TestCallIssue1281(new[] { arg });
+ }
+
+ static void TestCallIssue1281(params object[] args)
+ {
+ Console.Write("TestCallIssue1281: count = " + args.Length + ": ");
+ foreach (var arg in args) {
+ Console.Write(arg);
+ Console.Write(", ");
+ }
+ Console.WriteLine();
+ }
#endregion
#region Simple Overloaded Method
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Correctness/YieldReturn.cs b/ICSharpCode.Decompiler.Tests/TestCases/Correctness/YieldReturn.cs
index 18483b8cd..6398f740b 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Correctness/YieldReturn.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Correctness/YieldReturn.cs
@@ -76,6 +76,14 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
int fieldOnThis;
+ public static IEnumerable YieldChars {
+ get {
+ yield return 'a';
+ yield return 'b';
+ yield return 'c';
+ }
+ }
+
public static IEnumerable SimpleYieldReturn()
{
yield return "A";
@@ -188,8 +196,9 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
yield return "E";
yield return "F";
// outer try-finally block
- foreach (string line in input)
+ foreach (string line in input) {
yield return line.ToUpper();
+ }
}
public static IEnumerable> YieldReturnWithAnonymousMethods1(IEnumerable input)
@@ -210,17 +219,9 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
public static IEnumerable GetEvenNumbers(int n)
{
for (int i = 0; i < n; i++) {
- if (i % 2 == 0)
+ if (i % 2 == 0) {
yield return i;
- }
- }
-
- public static IEnumerable YieldChars
- {
- get {
- yield return 'a';
- yield return 'b';
- yield return 'c';
+ }
}
}
@@ -283,7 +284,8 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
yield return 0;
try {
Console.WriteLine("In Try");
- yield break; // same compiler bug as in YieldBreakInCatchInTryFinally
+ // same compiler bug as in YieldBreakInCatchInTryFinally
+ yield break;
} catch {
Console.WriteLine("Catch");
}
@@ -299,8 +301,10 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
yield return 0;
try {
Console.WriteLine("In Try");
- if (b)
- yield break; // same compiler bug as in YieldBreakInCatchInTryFinally
+ if (b) {
+ // same compiler bug as in YieldBreakInCatchInTryFinally
+ yield break;
+ }
} finally {
Console.WriteLine("Inner Finally");
}
@@ -406,7 +410,6 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
public static IEnumerable TryFinallyWithTwoExitPointsInNestedCatch(bool b)
{
- // The first user IL instruction is already in 2 nested try blocks.
try {
yield return 1;
try {
@@ -434,9 +437,9 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
try {
yield return 2;
} finally {
- T b = a;
- b.Dispose();
- b.Dispose();
+ T val = a;
+ val.Dispose();
+ val.Dispose();
}
yield return 3;
}
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1323.cs b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1323.cs
new file mode 100644
index 000000000..abfeafed1
--- /dev/null
+++ b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1323.cs
@@ -0,0 +1,11 @@
+public enum Enum0
+{
+ // error: enumerator has no value
+ const_0,
+ // error: enumerator has no value
+ const_1,
+ // error: enumerator has no value
+ const_2,
+ // error: enumerator has no value
+ const_3
+}
\ No newline at end of file
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1323.il b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1323.il
new file mode 100644
index 000000000..55674611a
--- /dev/null
+++ b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue1323.il
@@ -0,0 +1,40 @@
+// Metadata version: v4.0.30319
+.assembly extern mscorlib
+{
+ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
+ .ver 4:0:0:0
+}
+.assembly extern System
+{
+ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
+ .ver 4:0:0:0
+}
+.assembly extern System.Core
+{
+ .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
+ .ver 4:0:0:0
+}
+.assembly Issue1323
+{
+ .ver 1:0:0:0
+}
+.module Issue1323.dll
+// MVID: {B973FCD6-A9C4-48A9-8291-26DDC248E208}
+.imagebase 0x00400000
+.file alignment 0x00000200
+.stackreserve 0x00100000
+.subsystem 0x0003 // WINDOWS_CUI
+.corflags 0x00020003 // ILONLY 32BITPREFERRED
+// Image base: 0x000001C4B6C90000
+
+.class public auto ansi sealed Enum0
+ extends [mscorlib]System.Enum
+{
+ // Fields
+ .field public specialname rtspecialname int32 value__
+ .field public static literal valuetype Enum0 const_0
+ .field public static literal valuetype Enum0 const_1
+ .field public static literal valuetype Enum0 const_2
+ .field public static literal valuetype Enum0 const_3
+
+} // end of class Enum0
\ No newline at end of file
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue959.cs b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue959.cs
index c9fc8ee2a..cee558bc4 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue959.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/ILPretty/Issue959.cs
@@ -4,7 +4,7 @@
{
public void Test(bool arg)
{
- switch (arg) {
+ if (!arg && arg) {
}
}
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AutoProperties.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AutoProperties.cs
index 6e2b5a74d..0632affe9 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AutoProperties.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AutoProperties.cs
@@ -29,5 +29,14 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
get;
set;
}
+
+ public int issue1319 {
+ get;
+ }
+
+ public AutoProperties(int issue1319)
+ {
+ this.issue1319 = issue1319;
+ }
}
}
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AutoProperties.opt.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AutoProperties.opt.roslyn.il
index 2cbd82acc..e1857272e 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AutoProperties.opt.roslyn.il
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AutoProperties.opt.roslyn.il
@@ -47,6 +47,8 @@
.field private int32 'k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.ObsoleteAttribute::.ctor(string) = ( 01 00 05 46 69 65 6C 64 00 00 ) // ...Field..
+ .field private initonly int32 'k__BackingField'
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.method public hidebysig specialname instance int32
get_A() cil managed
{
@@ -135,10 +137,21 @@
IL_0007: ret
} // end of method AutoProperties::set_PropertyWithAttributeOnBackingField
+ .method public hidebysig specialname instance int32
+ get_issue1319() 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 int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField'
+ IL_0006: ret
+ } // end of method AutoProperties::get_issue1319
+
.method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
+ instance void .ctor(int32 issue1319) cil managed
{
- // Code size 21 (0x15)
+ // Code size 28 (0x1c)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldc.i4.1
@@ -148,7 +161,10 @@
IL_0009: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField'
IL_000e: ldarg.0
IL_000f: call instance void [mscorlib]System.Object::.ctor()
- IL_0014: ret
+ IL_0014: ldarg.0
+ IL_0015: ldarg.1
+ IL_0016: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField'
+ IL_001b: ret
} // end of method AutoProperties::.ctor
.method private hidebysig specialname rtspecialname static
@@ -187,6 +203,10 @@
.get instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::get_PropertyWithAttributeOnBackingField()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::set_PropertyWithAttributeOnBackingField(int32)
} // end of property AutoProperties::PropertyWithAttributeOnBackingField
+ .property instance int32 issue1319()
+ {
+ .get instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::get_issue1319()
+ } // end of property AutoProperties::issue1319
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AutoProperties.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AutoProperties.roslyn.il
index 1fec1b71f..100b4390b 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AutoProperties.roslyn.il
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/AutoProperties.roslyn.il
@@ -52,6 +52,9 @@
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.custom instance void [mscorlib]System.ObsoleteAttribute::.ctor(string) = ( 01 00 05 46 69 65 6C 64 00 00 ) // ...Field..
+ .field private initonly int32 'k__BackingField'
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.method public hidebysig specialname instance int32
get_A() cil managed
{
@@ -140,10 +143,21 @@
IL_0007: ret
} // end of method AutoProperties::set_PropertyWithAttributeOnBackingField
+ .method public hidebysig specialname instance int32
+ get_issue1319() 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 int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField'
+ IL_0006: ret
+ } // end of method AutoProperties::get_issue1319
+
.method public hidebysig specialname rtspecialname
- instance void .ctor() cil managed
+ instance void .ctor(int32 issue1319) cil managed
{
- // Code size 22 (0x16)
+ // Code size 30 (0x1e)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldc.i4.1
@@ -154,7 +168,11 @@
IL_000e: ldarg.0
IL_000f: call instance void [mscorlib]System.Object::.ctor()
IL_0014: nop
- IL_0015: ret
+ IL_0015: nop
+ IL_0016: ldarg.0
+ IL_0017: ldarg.1
+ IL_0018: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::'k__BackingField'
+ IL_001d: ret
} // end of method AutoProperties::.ctor
.method private hidebysig specialname rtspecialname static
@@ -193,6 +211,10 @@
.get instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::get_PropertyWithAttributeOnBackingField()
.set instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::set_PropertyWithAttributeOnBackingField(int32)
} // end of property AutoProperties::PropertyWithAttributeOnBackingField
+ .property instance int32 issue1319()
+ {
+ .get instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties::get_issue1319()
+ } // end of property AutoProperties::issue1319
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.AutoProperties
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS6_StringInterpolation.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS6_StringInterpolation.cs
index 18dbfd1d5..b82bd474b 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS6_StringInterpolation.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS6_StringInterpolation.cs
@@ -21,8 +21,15 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
Console.WriteLine($"\ta{$"a{args.Length}" == args[0]}");
}
+ public static void ArrayExpansionSpecialCases(object[] args)
+ {
+ Console.WriteLine($"args: {args}");
+ Console.WriteLine(string.Format("args: {0}", args));
+ }
+
public static void InvalidFormatString(string[] args)
{
+#pragma warning disable IDE0043
Console.WriteLine(string.Format("", args.Length));
Console.WriteLine(string.Format("a", args.Length));
Console.WriteLine(string.Format("}", args.Length));
@@ -47,6 +54,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
Console.WriteLine(string.Format("{0:}", args.Length));
Console.WriteLine(string.Format("{0{a}0}", args.Length));
Console.WriteLine(string.Format("test: {0}", string.Join(",", args)));
+#pragma warning restore
}
public void FormattableStrings(FormattableString s, string[] args)
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS6_StringInterpolation.opt.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS6_StringInterpolation.opt.roslyn.il
index d971dcadf..362395e88 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS6_StringInterpolation.opt.roslyn.il
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS6_StringInterpolation.opt.roslyn.il
@@ -169,6 +169,23 @@
IL_0115: ret
} // end of method CS6_StringInterpolation::General
+ .method public hidebysig static void ArrayExpansionSpecialCases(object[] args) cil managed
+ {
+ // Code size 33 (0x21)
+ .maxstack 8
+ IL_0000: ldstr "args: {0}"
+ IL_0005: ldarg.0
+ IL_0006: call string [mscorlib]System.String::Format(string,
+ object)
+ IL_000b: call void [mscorlib]System.Console::WriteLine(string)
+ IL_0010: ldstr "args: {0}"
+ IL_0015: ldarg.0
+ IL_0016: call string [mscorlib]System.String::Format(string,
+ object[])
+ IL_001b: call void [mscorlib]System.Console::WriteLine(string)
+ IL_0020: ret
+ } // end of method CS6_StringInterpolation::ArrayExpansionSpecialCases
+
.method public hidebysig static void InvalidFormatString(string[] args) cil managed
{
// Code size 556 (0x22c)
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS6_StringInterpolation.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS6_StringInterpolation.roslyn.il
index 06695b28b..0049393e9 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS6_StringInterpolation.roslyn.il
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CS6_StringInterpolation.roslyn.il
@@ -180,6 +180,26 @@
IL_011f: ret
} // end of method CS6_StringInterpolation::General
+ .method public hidebysig static void ArrayExpansionSpecialCases(object[] args) cil managed
+ {
+ // Code size 36 (0x24)
+ .maxstack 8
+ IL_0000: nop
+ IL_0001: ldstr "args: {0}"
+ IL_0006: ldarg.0
+ IL_0007: call string [mscorlib]System.String::Format(string,
+ object)
+ IL_000c: call void [mscorlib]System.Console::WriteLine(string)
+ IL_0011: nop
+ IL_0012: ldstr "args: {0}"
+ IL_0017: ldarg.0
+ IL_0018: call string [mscorlib]System.String::Format(string,
+ object[])
+ IL_001d: call void [mscorlib]System.Console::WriteLine(string)
+ IL_0022: nop
+ IL_0023: ret
+ } // end of method CS6_StringInterpolation::ArrayExpansionSpecialCases
+
.method public hidebysig static void InvalidFormatString(string[] args) cil managed
{
// Code size 581 (0x245)
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.cs
index 58dc08cbb..a8d00d066 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.cs
@@ -103,5 +103,29 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
{
Console.WriteLine(new int[checked(a + b)]);
}
+
+ public short Unbox(TypeCode c, object b)
+ {
+ checked {
+ switch (c) {
+ case TypeCode.Int32:
+ return (short)((Box)b).Value;
+ case TypeCode.UInt32:
+ return (short)((Box)b).Value;
+ case TypeCode.Double: {
+ float num = (float)((Box)b).Value;
+ Console.WriteLine(num);
+ return (short)num;
+ }
+ default:
+ throw new Exception();
+ }
+ }
+ }
+ }
+
+ internal class Box
+ {
+ public readonly T Value;
}
}
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.il
index 112211827..2ea8d69a4 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.il
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.il
@@ -345,6 +345,66 @@
IL_000f: ret
} // end of method CheckedUnchecked::CheckedInArrayCreationArgument
+ .method public hidebysig instance int16
+ Unbox(valuetype [mscorlib]System.TypeCode c,
+ object b) cil managed
+ {
+ // Code size 92 (0x5c)
+ .maxstack 2
+ .locals init (float32 V_0,
+ int16 V_1,
+ valuetype [mscorlib]System.TypeCode V_2)
+ IL_0000: nop
+ IL_0001: nop
+ IL_0002: ldarg.1
+ IL_0003: stloc.2
+ IL_0004: ldloc.2
+ IL_0005: ldc.i4.s 9
+ IL_0007: sub
+ IL_0008: switch (
+ IL_001c,
+ IL_002b)
+ IL_0015: ldloc.2
+ IL_0016: ldc.i4.s 14
+ IL_0018: beq.s IL_003a
+
+ IL_001a: br.s IL_0054
+
+ IL_001c: ldarg.2
+ IL_001d: castclass class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ IL_0022: ldfld !0 class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1::Value
+ IL_0027: conv.ovf.i2
+ IL_0028: stloc.1
+ IL_0029: br.s IL_005a
+
+ IL_002b: ldarg.2
+ IL_002c: castclass class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ IL_0031: ldfld !0 class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1::Value
+ IL_0036: conv.ovf.i2.un
+ IL_0037: stloc.1
+ IL_0038: br.s IL_005a
+
+ IL_003a: nop
+ IL_003b: ldarg.2
+ IL_003c: castclass class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ IL_0041: ldfld !0 class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1::Value
+ IL_0046: conv.r4
+ IL_0047: stloc.0
+ IL_0048: ldloc.0
+ IL_0049: call void [mscorlib]System.Console::WriteLine(float32)
+ IL_004e: nop
+ IL_004f: ldloc.0
+ IL_0050: conv.ovf.i2
+ IL_0051: stloc.1
+ IL_0052: br.s IL_005a
+
+ IL_0054: newobj instance void [mscorlib]System.Exception::.ctor()
+ IL_0059: throw
+
+ IL_005a: ldloc.1
+ IL_005b: ret
+ } // end of method CheckedUnchecked::Unbox
+
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
@@ -440,6 +500,22 @@
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked
+.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ extends [mscorlib]System.Object
+{
+ .field public initonly !T Value
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor() cil managed
+ {
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Object::.ctor()
+ IL_0006: ret
+ } // end of method Box`1::.ctor
+
+} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+
.class private auto ansi sealed beforefieldinit '<>f__AnonymousType0`2'<'j__TPar','j__TPar'>
extends [mscorlib]System.Object
{
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.il
index bda202d27..6efda9e25 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.il
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.il
@@ -300,6 +300,55 @@
IL_000d: ret
} // end of method CheckedUnchecked::CheckedInArrayCreationArgument
+ .method public hidebysig instance int16
+ Unbox(valuetype [mscorlib]System.TypeCode c,
+ object b) cil managed
+ {
+ // Code size 80 (0x50)
+ .maxstack 2
+ .locals init (float32 V_0,
+ valuetype [mscorlib]System.TypeCode V_1)
+ IL_0000: ldarg.1
+ IL_0001: stloc.1
+ IL_0002: ldloc.1
+ IL_0003: ldc.i4.s 9
+ IL_0005: sub
+ IL_0006: switch (
+ IL_001a,
+ IL_0027)
+ IL_0013: ldloc.1
+ IL_0014: ldc.i4.s 14
+ IL_0016: beq.s IL_0034
+
+ IL_0018: br.s IL_004a
+
+ IL_001a: ldarg.2
+ IL_001b: castclass class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ IL_0020: ldfld !0 class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1::Value
+ IL_0025: conv.ovf.i2
+ IL_0026: ret
+
+ IL_0027: ldarg.2
+ IL_0028: castclass class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ IL_002d: ldfld !0 class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1::Value
+ IL_0032: conv.ovf.i2.un
+ IL_0033: ret
+
+ IL_0034: ldarg.2
+ IL_0035: castclass class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ IL_003a: ldfld !0 class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1::Value
+ IL_003f: conv.r4
+ IL_0040: stloc.0
+ IL_0041: ldloc.0
+ IL_0042: call void [mscorlib]System.Console::WriteLine(float32)
+ IL_0047: ldloc.0
+ IL_0048: conv.ovf.i2
+ IL_0049: ret
+
+ IL_004a: newobj instance void [mscorlib]System.Exception::.ctor()
+ IL_004f: throw
+ } // end of method CheckedUnchecked::Unbox
+
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
@@ -380,6 +429,22 @@
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked
+.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ extends [mscorlib]System.Object
+{
+ .field public initonly !T Value
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor() cil managed
+ {
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Object::.ctor()
+ IL_0006: ret
+ } // end of method Box`1::.ctor
+
+} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+
.class private auto ansi sealed beforefieldinit '<>f__AnonymousType0`2'<'j__TPar','j__TPar'>
extends [mscorlib]System.Object
{
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.roslyn.il
index 771fc6494..ffe87cffa 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.roslyn.il
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.roslyn.il
@@ -574,6 +574,51 @@
IL_000d: ret
} // end of method CheckedUnchecked::CheckedInArrayCreationArgument
+ .method public hidebysig instance int16
+ Unbox(valuetype [mscorlib]System.TypeCode c,
+ object b) cil managed
+ {
+ // Code size 69 (0x45)
+ .maxstack 2
+ IL_0000: ldarg.1
+ IL_0001: ldc.i4.s 9
+ IL_0003: beq.s IL_0011
+
+ IL_0005: ldarg.1
+ IL_0006: ldc.i4.s 10
+ IL_0008: beq.s IL_001e
+
+ IL_000a: ldarg.1
+ IL_000b: ldc.i4.s 14
+ IL_000d: beq.s IL_002b
+
+ IL_000f: br.s IL_003f
+
+ IL_0011: ldarg.2
+ IL_0012: castclass class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ IL_0017: ldfld !0 class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1::Value
+ IL_001c: conv.ovf.i2
+ IL_001d: ret
+
+ IL_001e: ldarg.2
+ IL_001f: castclass class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ IL_0024: ldfld !0 class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1::Value
+ IL_0029: conv.ovf.i2.un
+ IL_002a: ret
+
+ IL_002b: ldarg.2
+ IL_002c: castclass class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ IL_0031: ldfld !0 class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1::Value
+ IL_0036: conv.r4
+ IL_0037: dup
+ IL_0038: call void [mscorlib]System.Console::WriteLine(float32)
+ IL_003d: conv.ovf.i2
+ IL_003e: ret
+
+ IL_003f: newobj instance void [mscorlib]System.Exception::.ctor()
+ IL_0044: throw
+ } // end of method CheckedUnchecked::Unbox
+
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
@@ -586,6 +631,22 @@
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked
+.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ extends [mscorlib]System.Object
+{
+ .field public initonly !T Value
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor() cil managed
+ {
+ // Code size 7 (0x7)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Object::.ctor()
+ IL_0006: ret
+ } // end of method Box`1::.ctor
+
+} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+
// =============================================================
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.roslyn.il
index d43345401..154f67d1e 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.roslyn.il
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.roslyn.il
@@ -624,6 +624,72 @@
IL_000f: ret
} // end of method CheckedUnchecked::CheckedInArrayCreationArgument
+ .method public hidebysig instance int16
+ Unbox(valuetype [mscorlib]System.TypeCode c,
+ object b) cil managed
+ {
+ // Code size 89 (0x59)
+ .maxstack 2
+ .locals init (valuetype [mscorlib]System.TypeCode V_0,
+ int16 V_1,
+ float32 V_2)
+ IL_0000: nop
+ IL_0001: nop
+ IL_0002: ldarg.1
+ IL_0003: stloc.0
+ IL_0004: ldloc.0
+ IL_0005: ldc.i4.s 9
+ IL_0007: beq.s IL_0019
+
+ IL_0009: br.s IL_000b
+
+ IL_000b: ldloc.0
+ IL_000c: ldc.i4.s 10
+ IL_000e: beq.s IL_0028
+
+ IL_0010: br.s IL_0012
+
+ IL_0012: ldloc.0
+ IL_0013: ldc.i4.s 14
+ IL_0015: beq.s IL_0037
+
+ IL_0017: br.s IL_0051
+
+ IL_0019: ldarg.2
+ IL_001a: castclass class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ IL_001f: ldfld !0 class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1::Value
+ IL_0024: conv.ovf.i2
+ IL_0025: stloc.1
+ IL_0026: br.s IL_0057
+
+ IL_0028: ldarg.2
+ IL_0029: castclass class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ IL_002e: ldfld !0 class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1::Value
+ IL_0033: conv.ovf.i2.un
+ IL_0034: stloc.1
+ IL_0035: br.s IL_0057
+
+ IL_0037: nop
+ IL_0038: ldarg.2
+ IL_0039: castclass class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ IL_003e: ldfld !0 class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1::Value
+ IL_0043: conv.r4
+ IL_0044: stloc.2
+ IL_0045: ldloc.2
+ IL_0046: call void [mscorlib]System.Console::WriteLine(float32)
+ IL_004b: nop
+ IL_004c: ldloc.2
+ IL_004d: conv.ovf.i2
+ IL_004e: stloc.1
+ IL_004f: br.s IL_0057
+
+ IL_0051: newobj instance void [mscorlib]System.Exception::.ctor()
+ IL_0056: throw
+
+ IL_0057: ldloc.1
+ IL_0058: ret
+ } // end of method CheckedUnchecked::Unbox
+
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
@@ -637,6 +703,23 @@
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked
+.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+ extends [mscorlib]System.Object
+{
+ .field public initonly !T Value
+ .method public hidebysig specialname rtspecialname
+ instance void .ctor() cil managed
+ {
+ // Code size 8 (0x8)
+ .maxstack 8
+ IL_0000: ldarg.0
+ IL_0001: call instance void [mscorlib]System.Object::.ctor()
+ IL_0006: nop
+ IL_0007: ret
+ } // end of method Box`1::.ctor
+
+} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.Box`1
+
// =============================================================
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.cs
index f52159c98..d5cf71bcf 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.cs
@@ -435,5 +435,15 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
Console.WriteLine(GetBool(1) || GetDynamic(2));
Console.WriteLine(i == 1 || d == null);
}
+
+ private static int ImplicitCast(object o)
+ {
+ return (dynamic)o;
+ }
+
+ private static int ExplicitCast(object o)
+ {
+ return (int)(dynamic)o;
+ }
}
}
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.il
index c907db66f..e4951f8a6 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.il
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.il
@@ -20,10 +20,10 @@
}
.assembly DynamicTests
{
- .custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows.
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 )
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 )
.permissionset reqmin
= {[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SkipVerification' = bool(true)}}
.hash algorithm 0x00008004
@@ -112,8 +112,8 @@
.field public object Field
.custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
.field private object 'k__BackingField'
- .custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
.method public hidebysig specialname
instance object get_GetOnlyProperty() cil managed
{
@@ -802,12 +802,26 @@
.field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1> '<>p__Site17b'
} // end of class 'o__SiteContainer170'
+ .class abstract auto ansi sealed nested private beforefieldinit 'o__SiteContainer17c'
+ extends [mscorlib]System.Object
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1> '<>p__Site17d'
+ } // end of class 'o__SiteContainer17c'
+
+ .class abstract auto ansi sealed nested private beforefieldinit 'o__SiteContainer17e'
+ extends [mscorlib]System.Object
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1> '<>p__Site17f'
+ } // end of class 'o__SiteContainer17e'
+
.field private static object 'field'
.custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
.field private static object objectField
.field private object 'k__BackingField'
- .custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
.method public hidebysig specialname instance object
get_Property() cil managed
{
@@ -15600,6 +15614,76 @@
IL_043f: ret
} // end of method DynamicTests::LogicOrExtended
+ .method private hidebysig static int32
+ ImplicitCast(object o) cil managed
+ {
+ // Code size 72 (0x48)
+ .maxstack 3
+ .locals init (int32 V_0)
+ IL_0000: nop
+ IL_0001: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17c'::'<>p__Site17d'
+ IL_0006: brtrue.s IL_002e
+
+ IL_0008: ldc.i4.0
+ IL_0009: ldtoken [mscorlib]System.Int32
+ IL_000e: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0013: ldtoken ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests
+ IL_0018: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_001d: call class [System.Core]System.Runtime.CompilerServices.CallSiteBinder [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.Binder::Convert(valuetype [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags,
+ class [mscorlib]System.Type,
+ class [mscorlib]System.Type)
+ IL_0022: call class [System.Core]System.Runtime.CompilerServices.CallSite`1 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
+ IL_0027: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17c'::'<>p__Site17d'
+ IL_002c: br.s IL_002e
+
+ IL_002e: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17c'::'<>p__Site17d'
+ IL_0033: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Target
+ IL_0038: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17c'::'<>p__Site17d'
+ IL_003d: ldarg.0
+ IL_003e: callvirt instance !2 class [mscorlib]System.Func`3::Invoke(!0,
+ !1)
+ IL_0043: stloc.0
+ IL_0044: br.s IL_0046
+
+ IL_0046: ldloc.0
+ IL_0047: ret
+ } // end of method DynamicTests::ImplicitCast
+
+ .method private hidebysig static int32
+ ExplicitCast(object o) cil managed
+ {
+ // Code size 73 (0x49)
+ .maxstack 3
+ .locals init (int32 V_0)
+ IL_0000: nop
+ IL_0001: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17e'::'<>p__Site17f'
+ IL_0006: brtrue.s IL_002f
+
+ IL_0008: ldc.i4.s 16
+ IL_000a: ldtoken [mscorlib]System.Int32
+ IL_000f: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0014: ldtoken ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests
+ IL_0019: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_001e: call class [System.Core]System.Runtime.CompilerServices.CallSiteBinder [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.Binder::Convert(valuetype [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags,
+ class [mscorlib]System.Type,
+ class [mscorlib]System.Type)
+ IL_0023: call class [System.Core]System.Runtime.CompilerServices.CallSite`1 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
+ IL_0028: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17e'::'<>p__Site17f'
+ IL_002d: br.s IL_002f
+
+ IL_002f: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17e'::'<>p__Site17f'
+ IL_0034: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Target
+ IL_0039: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17e'::'<>p__Site17f'
+ IL_003e: ldarg.0
+ IL_003f: callvirt instance !2 class [mscorlib]System.Func`3::Invoke(!0,
+ !1)
+ IL_0044: stloc.0
+ IL_0045: br.s IL_0047
+
+ IL_0047: ldloc.0
+ IL_0048: ret
+ } // end of method DynamicTests::ExplicitCast
+
.property instance object Property()
{
.custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.opt.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.opt.il
index b87dcbe6f..055a4f4fc 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.opt.il
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.opt.il
@@ -20,10 +20,10 @@
}
.assembly DynamicTests.opt
{
- .custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows.
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 )
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 )
.permissionset reqmin
= {[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SkipVerification' = bool(true)}}
.hash algorithm 0x00008004
@@ -105,8 +105,8 @@
.field public object Field
.custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
.field private object 'k__BackingField'
- .custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
.method public hidebysig specialname
instance object get_GetOnlyProperty() cil managed
{
@@ -783,12 +783,26 @@
.field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1> '<>p__Site17b'
} // end of class 'o__SiteContainer170'
+ .class abstract auto ansi sealed nested private beforefieldinit 'o__SiteContainer17c'
+ extends [mscorlib]System.Object
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1> '<>p__Site17d'
+ } // end of class 'o__SiteContainer17c'
+
+ .class abstract auto ansi sealed nested private beforefieldinit 'o__SiteContainer17e'
+ extends [mscorlib]System.Object
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1> '<>p__Site17f'
+ } // end of class 'o__SiteContainer17e'
+
.field private static object 'field'
.custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
.field private static object objectField
.field private object 'k__BackingField'
- .custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
.method public hidebysig specialname instance object
get_Property() cil managed
{
@@ -14889,6 +14903,60 @@
IL_044b: ret
} // end of method DynamicTests::LogicOrExtended
+ .method private hidebysig static int32
+ ImplicitCast(object o) cil managed
+ {
+ // Code size 65 (0x41)
+ .maxstack 3
+ IL_0000: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17c'::'<>p__Site17d'
+ IL_0005: brtrue.s IL_002b
+
+ IL_0007: ldc.i4.0
+ IL_0008: ldtoken [mscorlib]System.Int32
+ IL_000d: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0012: ldtoken ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests
+ IL_0017: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_001c: call class [System.Core]System.Runtime.CompilerServices.CallSiteBinder [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.Binder::Convert(valuetype [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags,
+ class [mscorlib]System.Type,
+ class [mscorlib]System.Type)
+ IL_0021: call class [System.Core]System.Runtime.CompilerServices.CallSite`1 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
+ IL_0026: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17c'::'<>p__Site17d'
+ IL_002b: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17c'::'<>p__Site17d'
+ IL_0030: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Target
+ IL_0035: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17c'::'<>p__Site17d'
+ IL_003a: ldarg.0
+ IL_003b: callvirt instance !2 class [mscorlib]System.Func`3::Invoke(!0,
+ !1)
+ IL_0040: ret
+ } // end of method DynamicTests::ImplicitCast
+
+ .method private hidebysig static int32
+ ExplicitCast(object o) cil managed
+ {
+ // Code size 66 (0x42)
+ .maxstack 3
+ IL_0000: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17e'::'<>p__Site17f'
+ IL_0005: brtrue.s IL_002c
+
+ IL_0007: ldc.i4.s 16
+ IL_0009: ldtoken [mscorlib]System.Int32
+ IL_000e: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0013: ldtoken ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests
+ IL_0018: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_001d: call class [System.Core]System.Runtime.CompilerServices.CallSiteBinder [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.Binder::Convert(valuetype [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags,
+ class [mscorlib]System.Type,
+ class [mscorlib]System.Type)
+ IL_0022: call class [System.Core]System.Runtime.CompilerServices.CallSite`1 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
+ IL_0027: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17e'::'<>p__Site17f'
+ IL_002c: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17e'::'<>p__Site17f'
+ IL_0031: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Target
+ IL_0036: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'o__SiteContainer17e'::'<>p__Site17f'
+ IL_003b: ldarg.0
+ IL_003c: callvirt instance !2 class [mscorlib]System.Func`3::Invoke(!0,
+ !1)
+ IL_0041: ret
+ } // end of method DynamicTests::ExplicitCast
+
.property instance object Property()
{
.custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.opt.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.opt.roslyn.il
index 5a6c96794..be029cac9 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.opt.roslyn.il
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.opt.roslyn.il
@@ -785,6 +785,20 @@
.field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1> '<>p__10'
} // end of class '<>o__55'
+ .class abstract auto ansi sealed nested private beforefieldinit '<>o__56'
+ extends [mscorlib]System.Object
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1> '<>p__0'
+ } // end of class '<>o__56'
+
+ .class abstract auto ansi sealed nested private beforefieldinit '<>o__57'
+ extends [mscorlib]System.Object
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1> '<>p__0'
+ } // end of class '<>o__57'
+
.field private static object 'field'
.custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
.field private static object objectField
@@ -13951,6 +13965,60 @@
IL_040a: ret
} // end of method DynamicTests::LogicOrExtended
+ .method private hidebysig static int32
+ ImplicitCast(object o) cil managed
+ {
+ // Code size 65 (0x41)
+ .maxstack 3
+ IL_0000: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__56'::'<>p__0'
+ IL_0005: brtrue.s IL_002b
+
+ IL_0007: ldc.i4.0
+ IL_0008: ldtoken [mscorlib]System.Int32
+ IL_000d: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0012: ldtoken ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests
+ IL_0017: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_001c: call class [System.Core]System.Runtime.CompilerServices.CallSiteBinder [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.Binder::Convert(valuetype [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags,
+ class [mscorlib]System.Type,
+ class [mscorlib]System.Type)
+ IL_0021: call class [System.Core]System.Runtime.CompilerServices.CallSite`1 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
+ IL_0026: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__56'::'<>p__0'
+ IL_002b: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__56'::'<>p__0'
+ IL_0030: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Target
+ IL_0035: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__56'::'<>p__0'
+ IL_003a: ldarg.0
+ IL_003b: callvirt instance !2 class [mscorlib]System.Func`3::Invoke(!0,
+ !1)
+ IL_0040: ret
+ } // end of method DynamicTests::ImplicitCast
+
+ .method private hidebysig static int32
+ ExplicitCast(object o) cil managed
+ {
+ // Code size 66 (0x42)
+ .maxstack 3
+ IL_0000: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__57'::'<>p__0'
+ IL_0005: brtrue.s IL_002c
+
+ IL_0007: ldc.i4.s 16
+ IL_0009: ldtoken [mscorlib]System.Int32
+ IL_000e: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0013: ldtoken ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests
+ IL_0018: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_001d: call class [System.Core]System.Runtime.CompilerServices.CallSiteBinder [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.Binder::Convert(valuetype [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags,
+ class [mscorlib]System.Type,
+ class [mscorlib]System.Type)
+ IL_0022: call class [System.Core]System.Runtime.CompilerServices.CallSite`1 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
+ IL_0027: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__57'::'<>p__0'
+ IL_002c: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__57'::'<>p__0'
+ IL_0031: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Target
+ IL_0036: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__57'::'<>p__0'
+ IL_003b: ldarg.0
+ IL_003c: callvirt instance !2 class [mscorlib]System.Func`3::Invoke(!0,
+ !1)
+ IL_0041: ret
+ } // end of method DynamicTests::ExplicitCast
+
.property instance object Property()
{
.custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.roslyn.il
index f03c989b9..fd5392fab 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.roslyn.il
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/DynamicTests.roslyn.il
@@ -792,6 +792,20 @@
.field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1> '<>p__10'
} // end of class '<>o__55'
+ .class abstract auto ansi sealed nested private beforefieldinit '<>o__56'
+ extends [mscorlib]System.Object
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1> '<>p__0'
+ } // end of class '<>o__56'
+
+ .class abstract auto ansi sealed nested private beforefieldinit '<>o__57'
+ extends [mscorlib]System.Object
+ {
+ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
+ .field public static class [System.Core]System.Runtime.CompilerServices.CallSite`1> '<>p__0'
+ } // end of class '<>o__57'
+
.field private static object 'field'
.custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
.field private static object objectField
@@ -14904,6 +14918,76 @@
IL_0425: ret
} // end of method DynamicTests::LogicOrExtended
+ .method private hidebysig static int32
+ ImplicitCast(object o) cil managed
+ {
+ // Code size 72 (0x48)
+ .maxstack 3
+ .locals init (int32 V_0)
+ IL_0000: nop
+ IL_0001: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__56'::'<>p__0'
+ IL_0006: brfalse.s IL_000a
+
+ IL_0008: br.s IL_002e
+
+ IL_000a: ldc.i4.0
+ IL_000b: ldtoken [mscorlib]System.Int32
+ IL_0010: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0015: ldtoken ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests
+ IL_001a: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_001f: call class [System.Core]System.Runtime.CompilerServices.CallSiteBinder [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.Binder::Convert(valuetype [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags,
+ class [mscorlib]System.Type,
+ class [mscorlib]System.Type)
+ IL_0024: call class [System.Core]System.Runtime.CompilerServices.CallSite`1 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
+ IL_0029: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__56'::'<>p__0'
+ IL_002e: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__56'::'<>p__0'
+ IL_0033: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Target
+ IL_0038: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__56'::'<>p__0'
+ IL_003d: ldarg.0
+ IL_003e: callvirt instance !2 class [mscorlib]System.Func`3::Invoke(!0,
+ !1)
+ IL_0043: stloc.0
+ IL_0044: br.s IL_0046
+
+ IL_0046: ldloc.0
+ IL_0047: ret
+ } // end of method DynamicTests::ImplicitCast
+
+ .method private hidebysig static int32
+ ExplicitCast(object o) cil managed
+ {
+ // Code size 73 (0x49)
+ .maxstack 3
+ .locals init (int32 V_0)
+ IL_0000: nop
+ IL_0001: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__57'::'<>p__0'
+ IL_0006: brfalse.s IL_000a
+
+ IL_0008: br.s IL_002f
+
+ IL_000a: ldc.i4.s 16
+ IL_000c: ldtoken [mscorlib]System.Int32
+ IL_0011: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0016: ldtoken ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests
+ IL_001b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0020: call class [System.Core]System.Runtime.CompilerServices.CallSiteBinder [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.Binder::Convert(valuetype [Microsoft.CSharp]Microsoft.CSharp.RuntimeBinder.CSharpBinderFlags,
+ class [mscorlib]System.Type,
+ class [mscorlib]System.Type)
+ IL_0025: call class [System.Core]System.Runtime.CompilerServices.CallSite`1 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Create(class [System.Core]System.Runtime.CompilerServices.CallSiteBinder)
+ IL_002a: stsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__57'::'<>p__0'
+ IL_002f: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__57'::'<>p__0'
+ IL_0034: ldfld !0 class [System.Core]System.Runtime.CompilerServices.CallSite`1>::Target
+ IL_0039: ldsfld class [System.Core]System.Runtime.CompilerServices.CallSite`1> ICSharpCode.Decompiler.Tests.TestCases.Pretty.DynamicTests/'<>o__57'::'<>p__0'
+ IL_003e: ldarg.0
+ IL_003f: callvirt instance !2 class [mscorlib]System.Func`3::Invoke(!0,
+ !1)
+ IL_0044: stloc.0
+ IL_0045: br.s IL_0047
+
+ IL_0047: ldloc.0
+ IL_0048: ret
+ } // end of method DynamicTests::ExplicitCast
+
.property instance object Property()
{
.custom instance void [System.Core]System.Runtime.CompilerServices.DynamicAttribute::.ctor() = ( 01 00 00 00 )
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs
index 727680634..850b95d9d 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs
@@ -322,47 +322,47 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
{
if (ID == 0) {
ViewBag.data = "''";
- } else {
- var model = (from a in db.Contracts
- where a.ID == ID
- select new {
- ID = a.ID,
- ContractNo = a.ContractNo,
- HouseAddress = a.HouseAddress,
- AdminID = (from b in db.Administrator
- where b.ID == a.AdminID
- select b.TrueName).FirstOrDefault(),
- StoreID = (from b in db.Store
- where b.ID == a.StoreID
- select b.Name).FirstOrDefault(),
- SigningTime = a.SigningTime,
- YeWuPhone = (from b in db.Administrator
- where b.ID == a.AdminID
- select b.Phone).FirstOrDefault(),
- BuyerName = a.BuyerName,
- BuyerTelephone = a.BuyerTelephone,
- Customer = a.Customer,
- CustTelephone = a.CustTelephone,
- Credit = (from b in db.Loan
- where b.ContractNo == a.ContractNo
- select b.Credit).FirstOrDefault(),
- LoanBank = (from b in db.Loan
- where b.ContractNo == a.ContractNo
- select b.LoanBank).FirstOrDefault(),
- Remarks = (from b in db.Loan
- where b.ContractNo == a.ContractNo
- select b.Remarks).FirstOrDefault()
- }).FirstOrDefault();
- ViewBag.data = model.ToJson();
- DateTime? dateTime = (from b in db.Loan
- where b.ContractNo == model.ContractNo
- select b.ShenDate).FirstOrDefault();
- DateTime? dateTime2 = (from b in db.Loan
- where b.ContractNo == model.ContractNo
- select b.LoanDate).FirstOrDefault();
- ViewBag.ShenDate = ((!dateTime.HasValue) ? "" : dateTime.ParseDateTime().ToString("yyyy-MM-dd"));
- ViewBag.LoanDate = ((!dateTime2.HasValue) ? "" : dateTime2.ParseDateTime().ToString("yyyy-MM-dd"));
- }
+ return;
+ }
+ var model = (from a in db.Contracts
+ where a.ID == ID
+ select new {
+ ID = a.ID,
+ ContractNo = a.ContractNo,
+ HouseAddress = a.HouseAddress,
+ AdminID = (from b in db.Administrator
+ where b.ID == a.AdminID
+ select b.TrueName).FirstOrDefault(),
+ StoreID = (from b in db.Store
+ where b.ID == a.StoreID
+ select b.Name).FirstOrDefault(),
+ SigningTime = a.SigningTime,
+ YeWuPhone = (from b in db.Administrator
+ where b.ID == a.AdminID
+ select b.Phone).FirstOrDefault(),
+ BuyerName = a.BuyerName,
+ BuyerTelephone = a.BuyerTelephone,
+ Customer = a.Customer,
+ CustTelephone = a.CustTelephone,
+ Credit = (from b in db.Loan
+ where b.ContractNo == a.ContractNo
+ select b.Credit).FirstOrDefault(),
+ LoanBank = (from b in db.Loan
+ where b.ContractNo == a.ContractNo
+ select b.LoanBank).FirstOrDefault(),
+ Remarks = (from b in db.Loan
+ where b.ContractNo == a.ContractNo
+ select b.Remarks).FirstOrDefault()
+ }).FirstOrDefault();
+ ViewBag.data = model.ToJson();
+ DateTime? dateTime = (from b in db.Loan
+ where b.ContractNo == model.ContractNo
+ select b.ShenDate).FirstOrDefault();
+ DateTime? dateTime2 = (from b in db.Loan
+ where b.ContractNo == model.ContractNo
+ select b.LoanDate).FirstOrDefault();
+ ViewBag.ShenDate = ((!dateTime.HasValue) ? "" : dateTime.ParseDateTime().ToString("yyyy-MM-dd"));
+ ViewBag.LoanDate = ((!dateTime2.HasValue) ? "" : dateTime2.ParseDateTime().ToString("yyyy-MM-dd"));
}
private static object ToCode(object x, Expression> expr)
@@ -533,7 +533,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
public void MembersBuiltin()
{
ToCode(X(), () => 1.23m.ToString());
- ToCode(X(), () => AttributeTargets.All.HasFlag((Enum)AttributeTargets.Assembly));
+ ToCode(X(), () => AttributeTargets.All.HasFlag(AttributeTargets.Assembly));
ToCode(X(), () => "abc".Length == 3);
ToCode(X(), () => 'a'.CompareTo('b') < 0);
}
@@ -844,7 +844,7 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
ToCode(null, (object a) => a ?? new MyClass());
}
- public static void BinaryLogicalOperators()
+ public static void ComparisonOperators()
{
ToCode(null, (int a, int b) => a == b);
ToCode(null, (int a, int b) => a != b);
@@ -865,6 +865,16 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
ToCode(null, (int a, int b) => a == 1 || b == 2);
}
+ public static void LiftedComparisonOperators()
+ {
+ ToCode(X(), (int? a, int? b) => a == b);
+ ToCode(X(), (int? a, int? b) => a != b);
+ ToCode(X(), (int? a, int? b) => a < b);
+ ToCode(X(), (int? a, int? b) => a <= b);
+ ToCode(X(), (int? a, int? b) => a > b);
+ ToCode(X(), (int? a, int? b) => a >= b);
+ }
+
public static void UnaryArithmeticOperators()
{
Test>((int a) => a, (int a) => a);
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.il
index e4f39828b..0b7d72cbb 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.il
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.il
@@ -8876,7 +8876,7 @@
IL_00ac: ret
} // end of method ExpressionTrees::ConditionalOperator
- .method public hidebysig static void BinaryLogicalOperators() cil managed
+ .method public hidebysig static void ComparisonOperators() cil managed
{
// Code size 1639 (0x667)
.maxstack 5
@@ -9559,7 +9559,222 @@
class [System.Core]System.Linq.Expressions.Expression`1>)
IL_0665: pop
IL_0666: ret
- } // end of method ExpressionTrees::BinaryLogicalOperators
+ } // end of method ExpressionTrees::ComparisonOperators
+
+ .method public hidebysig static void LiftedComparisonOperators() cil managed
+ {
+ // Code size 488 (0x1e8)
+ .maxstack 5
+ .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: nop
+ IL_0001: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::X()
+ IL_0006: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_000b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0010: ldstr "a"
+ IL_0015: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_001a: stloc.0
+ IL_001b: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_0020: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0025: ldstr "b"
+ IL_002a: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_002f: stloc.1
+ IL_0030: ldloc.0
+ IL_0031: ldloc.1
+ IL_0032: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::Equal(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.Expression)
+ IL_0037: ldc.i4.2
+ IL_0038: newarr [System.Core]System.Linq.Expressions.ParameterExpression
+ IL_003d: stloc.2
+ IL_003e: ldloc.2
+ IL_003f: ldc.i4.0
+ IL_0040: ldloc.0
+ IL_0041: stelem.ref
+ IL_0042: ldloc.2
+ IL_0043: ldc.i4.1
+ IL_0044: ldloc.1
+ IL_0045: stelem.ref
+ IL_0046: ldloc.2
+ IL_0047: call class [System.Core]System.Linq.Expressions.Expression`1 [System.Core]System.Linq.Expressions.Expression::Lambda,valuetype [mscorlib]System.Nullable`1,bool>>(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.ParameterExpression[])
+ IL_004c: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::ToCode,valuetype [mscorlib]System.Nullable`1,bool>(object,
+ class [System.Core]System.Linq.Expressions.Expression`1>)
+ IL_0051: pop
+ IL_0052: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::X()
+ IL_0057: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_005c: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0061: ldstr "a"
+ IL_0066: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_006b: stloc.0
+ IL_006c: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_0071: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0076: ldstr "b"
+ IL_007b: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_0080: stloc.1
+ IL_0081: ldloc.0
+ IL_0082: ldloc.1
+ IL_0083: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::NotEqual(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.Expression)
+ IL_0088: ldc.i4.2
+ IL_0089: newarr [System.Core]System.Linq.Expressions.ParameterExpression
+ IL_008e: stloc.2
+ IL_008f: ldloc.2
+ IL_0090: ldc.i4.0
+ IL_0091: ldloc.0
+ IL_0092: stelem.ref
+ IL_0093: ldloc.2
+ IL_0094: ldc.i4.1
+ IL_0095: ldloc.1
+ IL_0096: stelem.ref
+ IL_0097: ldloc.2
+ IL_0098: call class [System.Core]System.Linq.Expressions.Expression`1 [System.Core]System.Linq.Expressions.Expression::Lambda,valuetype [mscorlib]System.Nullable`1,bool>>(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.ParameterExpression[])
+ IL_009d: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::ToCode,valuetype [mscorlib]System.Nullable`1,bool>(object,
+ class [System.Core]System.Linq.Expressions.Expression`1>)
+ IL_00a2: pop
+ IL_00a3: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::X()
+ IL_00a8: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_00ad: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_00b2: ldstr "a"
+ IL_00b7: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_00bc: stloc.0
+ IL_00bd: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_00c2: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_00c7: ldstr "b"
+ IL_00cc: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_00d1: stloc.1
+ IL_00d2: ldloc.0
+ IL_00d3: ldloc.1
+ IL_00d4: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::LessThan(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.Expression)
+ IL_00d9: ldc.i4.2
+ IL_00da: newarr [System.Core]System.Linq.Expressions.ParameterExpression
+ IL_00df: stloc.2
+ IL_00e0: ldloc.2
+ IL_00e1: ldc.i4.0
+ IL_00e2: ldloc.0
+ IL_00e3: stelem.ref
+ IL_00e4: ldloc.2
+ IL_00e5: ldc.i4.1
+ IL_00e6: ldloc.1
+ IL_00e7: stelem.ref
+ IL_00e8: ldloc.2
+ IL_00e9: call class [System.Core]System.Linq.Expressions.Expression`1 [System.Core]System.Linq.Expressions.Expression::Lambda,valuetype [mscorlib]System.Nullable`1,bool>>(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.ParameterExpression[])
+ IL_00ee: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::ToCode,valuetype [mscorlib]System.Nullable`1,bool>(object,
+ class [System.Core]System.Linq.Expressions.Expression`1>)
+ IL_00f3: pop
+ IL_00f4: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::X()
+ IL_00f9: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_00fe: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0103: ldstr "a"
+ IL_0108: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_010d: stloc.0
+ IL_010e: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_0113: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0118: ldstr "b"
+ IL_011d: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_0122: stloc.1
+ IL_0123: ldloc.0
+ IL_0124: ldloc.1
+ IL_0125: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::LessThanOrEqual(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.Expression)
+ IL_012a: ldc.i4.2
+ IL_012b: newarr [System.Core]System.Linq.Expressions.ParameterExpression
+ IL_0130: stloc.2
+ IL_0131: ldloc.2
+ IL_0132: ldc.i4.0
+ IL_0133: ldloc.0
+ IL_0134: stelem.ref
+ IL_0135: ldloc.2
+ IL_0136: ldc.i4.1
+ IL_0137: ldloc.1
+ IL_0138: stelem.ref
+ IL_0139: ldloc.2
+ IL_013a: call class [System.Core]System.Linq.Expressions.Expression`1 [System.Core]System.Linq.Expressions.Expression::Lambda,valuetype [mscorlib]System.Nullable`1,bool>>(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.ParameterExpression[])
+ IL_013f: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::ToCode,valuetype [mscorlib]System.Nullable`1,bool>(object,
+ class [System.Core]System.Linq.Expressions.Expression`1>)
+ IL_0144: pop
+ IL_0145: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::X()
+ IL_014a: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_014f: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0154: ldstr "a"
+ IL_0159: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_015e: stloc.0
+ IL_015f: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_0164: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0169: ldstr "b"
+ IL_016e: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_0173: stloc.1
+ IL_0174: ldloc.0
+ IL_0175: ldloc.1
+ IL_0176: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::GreaterThan(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.Expression)
+ IL_017b: ldc.i4.2
+ IL_017c: newarr [System.Core]System.Linq.Expressions.ParameterExpression
+ IL_0181: stloc.2
+ IL_0182: ldloc.2
+ IL_0183: ldc.i4.0
+ IL_0184: ldloc.0
+ IL_0185: stelem.ref
+ IL_0186: ldloc.2
+ IL_0187: ldc.i4.1
+ IL_0188: ldloc.1
+ IL_0189: stelem.ref
+ IL_018a: ldloc.2
+ IL_018b: call class [System.Core]System.Linq.Expressions.Expression`1 [System.Core]System.Linq.Expressions.Expression::Lambda,valuetype [mscorlib]System.Nullable`1,bool>>(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.ParameterExpression[])
+ IL_0190: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::ToCode,valuetype [mscorlib]System.Nullable`1,bool>(object,
+ class [System.Core]System.Linq.Expressions.Expression`1>)
+ IL_0195: pop
+ IL_0196: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::X()
+ IL_019b: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_01a0: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_01a5: ldstr "a"
+ IL_01aa: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_01af: stloc.0
+ IL_01b0: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_01b5: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_01ba: ldstr "b"
+ IL_01bf: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_01c4: stloc.1
+ IL_01c5: ldloc.0
+ IL_01c6: ldloc.1
+ IL_01c7: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::GreaterThanOrEqual(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.Expression)
+ IL_01cc: ldc.i4.2
+ IL_01cd: newarr [System.Core]System.Linq.Expressions.ParameterExpression
+ IL_01d2: stloc.2
+ IL_01d3: ldloc.2
+ IL_01d4: ldc.i4.0
+ IL_01d5: ldloc.0
+ IL_01d6: stelem.ref
+ IL_01d7: ldloc.2
+ IL_01d8: ldc.i4.1
+ IL_01d9: ldloc.1
+ IL_01da: stelem.ref
+ IL_01db: ldloc.2
+ IL_01dc: call class [System.Core]System.Linq.Expressions.Expression`1 [System.Core]System.Linq.Expressions.Expression::Lambda,valuetype [mscorlib]System.Nullable`1,bool>>(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.ParameterExpression[])
+ IL_01e1: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::ToCode,valuetype [mscorlib]System.Nullable`1,bool>(object,
+ class [System.Core]System.Linq.Expressions.Expression`1>)
+ IL_01e6: pop
+ IL_01e7: ret
+ } // end of method ExpressionTrees::LiftedComparisonOperators
.method public hidebysig static void UnaryArithmeticOperators() cil managed
{
@@ -12718,7 +12933,7 @@
IL_0000: ldc.i4.3
IL_0001: newarr [mscorlib]System.Int32
IL_0006: dup
- IL_0007: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=12' ''::'$$method0x600010d-1'
+ IL_0007: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=12' ''::'$$method0x600010e-1'
IL_000c: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array,
valuetype [mscorlib]System.RuntimeFieldHandle)
IL_0011: stloc.0
@@ -12794,7 +13009,7 @@
IL_0009: ldc.i4.3
IL_000a: newarr [mscorlib]System.Int32
IL_000f: dup
- IL_0010: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=12' ''::'$$method0x6000111-1'
+ IL_0010: ldtoken field valuetype ''/'__StaticArrayInitTypeSize=12' ''::'$$method0x6000112-1'
IL_0015: call void [mscorlib]System.Runtime.CompilerServices.RuntimeHelpers::InitializeArray(class [mscorlib]System.Array,
valuetype [mscorlib]System.RuntimeFieldHandle)
IL_001a: stelem.ref
@@ -14617,8 +14832,8 @@
.size 12
} // end of class '__StaticArrayInitTypeSize=12'
- .field static assembly valuetype ''/'__StaticArrayInitTypeSize=12' '$$method0x600010d-1' at I_00009008
- .field static assembly valuetype ''/'__StaticArrayInitTypeSize=12' '$$method0x6000111-1' at I_00009080
+ .field static assembly valuetype ''/'__StaticArrayInitTypeSize=12' '$$method0x600010e-1' at I_00009200
+ .field static assembly valuetype ''/'__StaticArrayInitTypeSize=12' '$$method0x6000112-1' at I_00009278
} // end of class ''
.class private auto ansi sealed beforefieldinit '<>f__AnonymousType3`2'<'j__TPar','j__TPar'>
@@ -14810,9 +15025,9 @@
// =============================================================
-.data cil I_00009008 = bytearray (
+.data cil I_00009200 = bytearray (
01 00 00 00 02 00 00 00 03 00 00 00)
-.data cil I_00009014 = int8[108]
-.data cil I_00009080 = bytearray (
+.data cil I_0000920C = int8[4]
+.data cil I_00009278 = bytearray (
01 00 00 00 02 00 00 00 03 00 00 00)
// *********** DISASSEMBLY COMPLETE ***********************
diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.opt.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.opt.il
index 2511d2870..ba5640bb7 100644
--- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.opt.il
+++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.opt.il
@@ -8565,7 +8565,7 @@
IL_00ab: ret
} // end of method ExpressionTrees::ConditionalOperator
- .method public hidebysig static void BinaryLogicalOperators() cil managed
+ .method public hidebysig static void ComparisonOperators() cil managed
{
// Code size 1795 (0x703)
.maxstack 5
@@ -9295,7 +9295,236 @@
class [System.Core]System.Linq.Expressions.Expression`1>)
IL_0701: pop
IL_0702: ret
- } // end of method ExpressionTrees::BinaryLogicalOperators
+ } // end of method ExpressionTrees::ComparisonOperators
+
+ .method public hidebysig static void LiftedComparisonOperators() cil managed
+ {
+ // Code size 534 (0x216)
+ .maxstack 5
+ .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,
+ class [System.Core]System.Linq.Expressions.ParameterExpression V_3,
+ class [System.Core]System.Linq.Expressions.ParameterExpression V_4,
+ class [System.Core]System.Linq.Expressions.ParameterExpression[] V_5,
+ class [System.Core]System.Linq.Expressions.ParameterExpression V_6,
+ class [System.Core]System.Linq.Expressions.ParameterExpression V_7,
+ class [System.Core]System.Linq.Expressions.ParameterExpression[] V_8,
+ class [System.Core]System.Linq.Expressions.ParameterExpression V_9,
+ class [System.Core]System.Linq.Expressions.ParameterExpression 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.ParameterExpression 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.ParameterExpression[] V_17)
+ IL_0000: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::X()
+ IL_0005: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_000a: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_000f: ldstr "a"
+ IL_0014: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_0019: stloc.0
+ IL_001a: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_001f: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0024: ldstr "b"
+ IL_0029: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_002e: stloc.1
+ IL_002f: ldloc.0
+ IL_0030: ldloc.1
+ IL_0031: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::Equal(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.Expression)
+ IL_0036: ldc.i4.2
+ IL_0037: newarr [System.Core]System.Linq.Expressions.ParameterExpression
+ IL_003c: stloc.2
+ IL_003d: ldloc.2
+ IL_003e: ldc.i4.0
+ IL_003f: ldloc.0
+ IL_0040: stelem.ref
+ IL_0041: ldloc.2
+ IL_0042: ldc.i4.1
+ IL_0043: ldloc.1
+ IL_0044: stelem.ref
+ IL_0045: ldloc.2
+ IL_0046: call class [System.Core]System.Linq.Expressions.Expression`1 [System.Core]System.Linq.Expressions.Expression::Lambda,valuetype [mscorlib]System.Nullable`1,bool>>(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.ParameterExpression[])
+ IL_004b: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::ToCode,valuetype [mscorlib]System.Nullable`1,bool>(object,
+ class [System.Core]System.Linq.Expressions.Expression`1>)
+ IL_0050: pop
+ IL_0051: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::X()
+ IL_0056: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_005b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0060: ldstr "a"
+ IL_0065: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_006a: stloc.3
+ IL_006b: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_0070: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0075: ldstr "b"
+ IL_007a: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_007f: stloc.s V_4
+ IL_0081: ldloc.3
+ IL_0082: ldloc.s V_4
+ IL_0084: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::NotEqual(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.Expression)
+ IL_0089: ldc.i4.2
+ IL_008a: newarr [System.Core]System.Linq.Expressions.ParameterExpression
+ IL_008f: stloc.s V_5
+ IL_0091: ldloc.s V_5
+ IL_0093: ldc.i4.0
+ IL_0094: ldloc.3
+ IL_0095: stelem.ref
+ IL_0096: ldloc.s V_5
+ IL_0098: ldc.i4.1
+ IL_0099: ldloc.s V_4
+ IL_009b: stelem.ref
+ IL_009c: ldloc.s V_5
+ IL_009e: call class [System.Core]System.Linq.Expressions.Expression`1 [System.Core]System.Linq.Expressions.Expression::Lambda,valuetype [mscorlib]System.Nullable`1,bool>>(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.ParameterExpression[])
+ IL_00a3: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::ToCode,valuetype [mscorlib]System.Nullable`1,bool>(object,
+ class [System.Core]System.Linq.Expressions.Expression`1>)
+ IL_00a8: pop
+ IL_00a9: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::X()
+ IL_00ae: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_00b3: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_00b8: ldstr "a"
+ IL_00bd: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_00c2: stloc.s V_6
+ IL_00c4: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_00c9: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_00ce: ldstr "b"
+ IL_00d3: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_00d8: stloc.s V_7
+ IL_00da: ldloc.s V_6
+ IL_00dc: ldloc.s V_7
+ IL_00de: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::LessThan(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.Expression)
+ IL_00e3: ldc.i4.2
+ IL_00e4: newarr [System.Core]System.Linq.Expressions.ParameterExpression
+ IL_00e9: stloc.s V_8
+ IL_00eb: ldloc.s V_8
+ IL_00ed: ldc.i4.0
+ IL_00ee: ldloc.s V_6
+ IL_00f0: stelem.ref
+ IL_00f1: ldloc.s V_8
+ IL_00f3: ldc.i4.1
+ IL_00f4: ldloc.s V_7
+ IL_00f6: stelem.ref
+ IL_00f7: ldloc.s V_8
+ IL_00f9: call class [System.Core]System.Linq.Expressions.Expression`1 [System.Core]System.Linq.Expressions.Expression::Lambda,valuetype [mscorlib]System.Nullable`1,bool>>(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.ParameterExpression[])
+ IL_00fe: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::ToCode,valuetype [mscorlib]System.Nullable`1,bool>(object,
+ class [System.Core]System.Linq.Expressions.Expression`1>)
+ IL_0103: pop
+ IL_0104: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::X()
+ IL_0109: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_010e: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0113: ldstr "a"
+ IL_0118: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_011d: stloc.s V_9
+ IL_011f: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_0124: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0129: ldstr "b"
+ IL_012e: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_0133: stloc.s V_10
+ IL_0135: ldloc.s V_9
+ IL_0137: ldloc.s V_10
+ IL_0139: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::LessThanOrEqual(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.Expression)
+ IL_013e: ldc.i4.2
+ IL_013f: newarr [System.Core]System.Linq.Expressions.ParameterExpression
+ IL_0144: stloc.s V_11
+ IL_0146: ldloc.s V_11
+ IL_0148: ldc.i4.0
+ IL_0149: ldloc.s V_9
+ IL_014b: stelem.ref
+ IL_014c: ldloc.s V_11
+ IL_014e: ldc.i4.1
+ IL_014f: ldloc.s V_10
+ IL_0151: stelem.ref
+ IL_0152: ldloc.s V_11
+ IL_0154: call class [System.Core]System.Linq.Expressions.Expression`1 [System.Core]System.Linq.Expressions.Expression::Lambda,valuetype [mscorlib]System.Nullable`1,bool>>(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.ParameterExpression[])
+ IL_0159: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::ToCode,valuetype [mscorlib]System.Nullable`1,bool>(object,
+ class [System.Core]System.Linq.Expressions.Expression`1>)
+ IL_015e: pop
+ IL_015f: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::X()
+ IL_0164: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_0169: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_016e: ldstr "a"
+ IL_0173: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_0178: stloc.s V_12
+ IL_017a: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_017f: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_0184: ldstr "b"
+ IL_0189: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_018e: stloc.s V_13
+ IL_0190: ldloc.s V_12
+ IL_0192: ldloc.s V_13
+ IL_0194: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::GreaterThan(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.Expression)
+ IL_0199: ldc.i4.2
+ IL_019a: newarr [System.Core]System.Linq.Expressions.ParameterExpression
+ IL_019f: stloc.s V_14
+ IL_01a1: ldloc.s V_14
+ IL_01a3: ldc.i4.0
+ IL_01a4: ldloc.s V_12
+ IL_01a6: stelem.ref
+ IL_01a7: ldloc.s V_14
+ IL_01a9: ldc.i4.1
+ IL_01aa: ldloc.s V_13
+ IL_01ac: stelem.ref
+ IL_01ad: ldloc.s V_14
+ IL_01af: call class [System.Core]System.Linq.Expressions.Expression`1 [System.Core]System.Linq.Expressions.Expression::Lambda,valuetype [mscorlib]System.Nullable`1,bool>>(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.ParameterExpression[])
+ IL_01b4: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::ToCode,valuetype [mscorlib]System.Nullable`1,bool>(object,
+ class [System.Core]System.Linq.Expressions.Expression`1>)
+ IL_01b9: pop
+ IL_01ba: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::X()
+ IL_01bf: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_01c4: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_01c9: ldstr "a"
+ IL_01ce: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_01d3: stloc.s V_15
+ IL_01d5: ldtoken valuetype [mscorlib]System.Nullable`1
+ IL_01da: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
+ IL_01df: ldstr "b"
+ IL_01e4: call class [System.Core]System.Linq.Expressions.ParameterExpression [System.Core]System.Linq.Expressions.Expression::Parameter(class [mscorlib]System.Type,
+ string)
+ IL_01e9: stloc.s V_16
+ IL_01eb: ldloc.s V_15
+ IL_01ed: ldloc.s V_16
+ IL_01ef: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::GreaterThanOrEqual(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.Expression)
+ IL_01f4: ldc.i4.2
+ IL_01f5: newarr [System.Core]System.Linq.Expressions.ParameterExpression
+ IL_01fa: stloc.s V_17
+ IL_01fc: ldloc.s V_17
+ IL_01fe: ldc.i4.0
+ IL_01ff: ldloc.s V_15
+ IL_0201: stelem.ref
+ IL_0202: ldloc.s V_17
+ IL_0204: ldc.i4.1
+ IL_0205: ldloc.s V_16
+ IL_0207: stelem.ref
+ IL_0208: ldloc.s V_17
+ IL_020a: call class [System.Core]System.Linq.Expressions.Expression`1 [System.Core]System.Linq.Expressions.Expression::Lambda,valuetype [mscorlib]System.Nullable`1,bool>>(class [System.Core]System.Linq.Expressions.Expression,
+ class [System.Core]System.Linq.Expressions.ParameterExpression[])
+ IL_020f: call object ICSharpCode.Decompiler.Tests.TestCases.Pretty.ExpressionTrees::ToCode