Browse Source

Fix some unnecessary casts, adjust test cases

pull/988/head
Siegfried Pammer 8 years ago
parent
commit
9d0ff70f08
  1. 15
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.cs
  2. 308
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.il
  3. 307
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.opt.il
  4. 272
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.opt.roslyn.il
  5. 271
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ExpressionTrees.roslyn.il
  6. 4
      ICSharpCode.Decompiler/IL/Transforms/TransformExpressionTrees.cs

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

@ -193,7 +193,7 @@ public class ExpressionTrees @@ -193,7 +193,7 @@ public class ExpressionTrees
{
int i = 1;
string x = "X";
ExpressionTrees.ToCode(ExpressionTrees.X(), () => (("a\n\\b" ?? x) + x).Length == 2 ? false : true && (1m + -i > 0 || false));
ExpressionTrees.ToCode(ExpressionTrees.X(), () => ((("a\n\\b" ?? x) + x).Length == 2) ? false : (true && (1m + (decimal)(-i) > 0m || false)));
}
public void NotImplicitCast()
@ -241,12 +241,12 @@ public class ExpressionTrees @@ -241,12 +241,12 @@ public class ExpressionTrees
public void MethodGroupAsExtensionMethod()
{
ExpressionTrees.ToCode(ExpressionTrees.X(), () => (Func<bool>)new int[4] {
ExpressionTrees.ToCode(ExpressionTrees.X(), (Expression<Func<Func<bool>>>)(() => ((IEnumerable<int>)new int[4] {
2000,
2004,
2008,
2012
}.Any);
}).Any<int>));
}
public void MethodGroupConstant()
@ -266,7 +266,7 @@ public class ExpressionTrees @@ -266,7 +266,7 @@ public class ExpressionTrees
2012
}.All(set.Add));
Func<Func<object, object, bool>, bool> sink = f => f(null, null);
Func<Func<object, object, bool>, bool> sink = (Func<object, object, bool> f) => f(null, null);
ExpressionTrees.ToCode(ExpressionTrees.X(), () => sink(object.Equals));
}
@ -299,7 +299,7 @@ public class ExpressionTrees @@ -299,7 +299,7 @@ public class ExpressionTrees
public void CurriedLambda()
{
ExpressionTrees.ToCode<int, Func<int, Func<int, int>>>(ExpressionTrees.X(), a => b => c => a + b + c);
ExpressionTrees.ToCode(ExpressionTrees.X(), (Expression<Func<int, Func<int, Func<int, int>>>>)((int a) => (int b) => (int c) => a + b + c));
}
private bool Fizz(Func<int, bool> a)
@ -431,11 +431,6 @@ public class ExpressionTrees @@ -431,11 +431,6 @@ public class ExpressionTrees
ExpressionTrees.ToCode(ExpressionTrees.X(), () => (("a\n\\b" ?? x) + x).Length == 2 ? false : true && (1m + (decimal)-i > 0m || false));
}
public void StringAccessor()
{
ExpressionTrees.ToCode(ExpressionTrees.X(), () => (int)"abc"[1] == 98);
}
public void GenericClassInstance()
{
ExpressionTrees.ToCode(ExpressionTrees.X(), () => (double)new GenericClass<int>().InstanceField + new GenericClass<double>().InstanceProperty);

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

@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 4:0:0:0
}
.assembly bkuaf15t
.assembly pwk1zrwf
{
.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.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
@ -30,15 +30,15 @@ @@ -30,15 +30,15 @@
.hash algorithm 0x00008004
.ver 0:0:0:0
}
.module bkuaf15t.dll
// MVID: {E4EF857C-F542-4940-9C71-2C5B582D4409}
.module pwk1zrwf.dll
// MVID: {F6BFC7E4-C360-4730-8ABB-47735EBDDEBC}
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 )
.imagebase 0x10000000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
// Image base: 0x00E00000
// Image base: 0x00CE0000
// =============== CLASS MEMBERS DECLARATION ===================
@ -1940,7 +1940,7 @@ @@ -1940,7 +1940,7 @@
.method public hidebysig instance void
MembersDefault() cil managed
{
// Code size 574 (0x23e)
// Code size 589 (0x24d)
.maxstack 7
.locals init (valuetype [mscorlib]System.DateTime V_0,
class [System.Core]System.Linq.Expressions.Expression[] V_1)
@ -1977,156 +1977,160 @@ @@ -1977,156 +1977,160 @@
IL_0062: pop
IL_0063: call object ExpressionTrees::X()
IL_0068: ldnull
IL_0069: box int32[]
IL_006e: ldtoken int32[]
IL_0069: box [mscorlib]System.Array
IL_006e: ldtoken [mscorlib]System.Array
IL_0073: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0078: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_007d: call class [System.Core]System.Linq.Expressions.UnaryExpression [System.Core]System.Linq.Expressions.Expression::ArrayLength(class [System.Core]System.Linq.Expressions.Expression)
IL_0082: ldc.i4.0
IL_0083: box [mscorlib]System.Int32
IL_0088: ldtoken [mscorlib]System.Int32
IL_008d: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0092: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
IL_007d: ldtoken method instance int32 [mscorlib]System.Array::get_Length()
IL_0082: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0087: castclass [mscorlib]System.Reflection.MethodInfo
IL_008c: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo)
IL_0091: ldc.i4.0
IL_0092: box [mscorlib]System.Int32
IL_0097: ldtoken [mscorlib]System.Int32
IL_009c: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00a1: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0097: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::Equal(class [System.Core]System.Linq.Expressions.Expression,
IL_00a6: 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_009c: ldc.i4.0
IL_009d: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_00a2: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_00ab: ldc.i4.0
IL_00ac: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_00b1: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_00a7: call object ExpressionTrees::ToCode<bool>(object,
IL_00b6: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_00ac: pop
IL_00ad: call object ExpressionTrees::X()
IL_00b2: ldnull
IL_00b3: box [mscorlib]System.Type
IL_00b8: ldtoken [mscorlib]System.Type
IL_00bd: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00c2: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_00c7: ldtoken method instance bool [mscorlib]System.Type::get_IsLayoutSequential()
IL_00cc: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_00d1: castclass [mscorlib]System.Reflection.MethodInfo
IL_00d6: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
IL_00bb: pop
IL_00bc: call object ExpressionTrees::X()
IL_00c1: ldnull
IL_00c2: box [mscorlib]System.Type
IL_00c7: ldtoken [mscorlib]System.Type
IL_00cc: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00d1: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_00d6: ldtoken method instance bool [mscorlib]System.Type::get_IsLayoutSequential()
IL_00db: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_00e0: castclass [mscorlib]System.Reflection.MethodInfo
IL_00e5: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo)
IL_00db: ldc.i4.0
IL_00dc: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_00e1: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_00ea: ldc.i4.0
IL_00eb: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_00f0: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_00e6: call object ExpressionTrees::ToCode<bool>(object,
IL_00f5: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_00eb: pop
IL_00ec: call object ExpressionTrees::X()
IL_00f1: ldnull
IL_00f2: box class [mscorlib]System.Collections.Generic.List`1<int32>
IL_00f7: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_00fc: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0101: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0106: ldtoken method instance int32 class [mscorlib]System.Collections.Generic.List`1<int32>::get_Count()
IL_010b: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_0110: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
IL_00fa: pop
IL_00fb: call object ExpressionTrees::X()
IL_0100: ldnull
IL_0101: box class [mscorlib]System.Collections.Generic.List`1<int32>
IL_0106: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_010b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0110: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0115: ldtoken method instance int32 class [mscorlib]System.Collections.Generic.List`1<int32>::get_Count()
IL_011a: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_011f: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0115: castclass [mscorlib]System.Reflection.MethodInfo
IL_011a: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
IL_0124: castclass [mscorlib]System.Reflection.MethodInfo
IL_0129: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo)
IL_011f: ldc.i4.0
IL_0120: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0125: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<int32>>(class [System.Core]System.Linq.Expressions.Expression,
IL_012e: ldc.i4.0
IL_012f: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0134: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<int32>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_012a: call object ExpressionTrees::ToCode<int32>(object,
IL_0139: call object ExpressionTrees::ToCode<int32>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_012f: pop
IL_0130: call object ExpressionTrees::X()
IL_0135: ldnull
IL_0136: box int32[]
IL_013b: ldtoken int32[]
IL_0140: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0145: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_014a: ldtoken method instance object [mscorlib]System.Array::Clone()
IL_014f: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0154: castclass [mscorlib]System.Reflection.MethodInfo
IL_0159: ldc.i4.0
IL_015a: newarr [System.Core]System.Linq.Expressions.Expression
IL_015f: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
IL_013e: pop
IL_013f: call object ExpressionTrees::X()
IL_0144: ldnull
IL_0145: box [mscorlib]System.Array
IL_014a: ldtoken [mscorlib]System.Array
IL_014f: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0154: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0159: ldtoken method instance object [mscorlib]System.Array::Clone()
IL_015e: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0163: castclass [mscorlib]System.Reflection.MethodInfo
IL_0168: ldc.i4.0
IL_0169: newarr [System.Core]System.Linq.Expressions.Expression
IL_016e: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_0164: ldnull
IL_0165: box [mscorlib]System.Object
IL_016a: ldtoken [mscorlib]System.Object
IL_016f: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0174: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
IL_0173: ldnull
IL_0174: box [mscorlib]System.Object
IL_0179: ldtoken [mscorlib]System.Object
IL_017e: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0183: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0179: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::Equal(class [System.Core]System.Linq.Expressions.Expression,
IL_0188: 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_017e: ldc.i4.0
IL_017f: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0184: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_018d: ldc.i4.0
IL_018e: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0193: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0189: call object ExpressionTrees::ToCode<bool>(object,
IL_0198: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_018e: pop
IL_018f: call object ExpressionTrees::X()
IL_0194: ldnull
IL_0195: box [mscorlib]System.Type
IL_019a: ldtoken [mscorlib]System.Type
IL_019f: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01a4: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_01a9: ldtoken method instance bool [mscorlib]System.Type::IsInstanceOfType(object)
IL_01ae: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_01b3: castclass [mscorlib]System.Reflection.MethodInfo
IL_01b8: ldc.i4.1
IL_01b9: newarr [System.Core]System.Linq.Expressions.Expression
IL_01be: stloc.1
IL_01bf: ldloc.1
IL_01c0: ldc.i4.0
IL_01c1: ldtoken method instance void [mscorlib]System.Object::.ctor()
IL_01c6: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_01cb: castclass [mscorlib]System.Reflection.ConstructorInfo
IL_01d0: ldc.i4.0
IL_01d1: newarr [System.Core]System.Linq.Expressions.Expression
IL_01d6: call class [System.Core]System.Linq.Expressions.NewExpression [System.Core]System.Linq.Expressions.Expression::New(class [mscorlib]System.Reflection.ConstructorInfo,
IL_019d: pop
IL_019e: call object ExpressionTrees::X()
IL_01a3: ldnull
IL_01a4: box [mscorlib]System.Type
IL_01a9: ldtoken [mscorlib]System.Type
IL_01ae: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01b3: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_01b8: ldtoken method instance bool [mscorlib]System.Type::IsInstanceOfType(object)
IL_01bd: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_01c2: castclass [mscorlib]System.Reflection.MethodInfo
IL_01c7: ldc.i4.1
IL_01c8: newarr [System.Core]System.Linq.Expressions.Expression
IL_01cd: stloc.1
IL_01ce: ldloc.1
IL_01cf: ldc.i4.0
IL_01d0: ldtoken method instance void [mscorlib]System.Object::.ctor()
IL_01d5: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_01da: castclass [mscorlib]System.Reflection.ConstructorInfo
IL_01df: ldc.i4.0
IL_01e0: newarr [System.Core]System.Linq.Expressions.Expression
IL_01e5: call class [System.Core]System.Linq.Expressions.NewExpression [System.Core]System.Linq.Expressions.Expression::New(class [mscorlib]System.Reflection.ConstructorInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_01db: stelem.ref
IL_01dc: ldloc.1
IL_01dd: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
IL_01ea: stelem.ref
IL_01eb: ldloc.1
IL_01ec: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_01e2: ldc.i4.0
IL_01e3: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_01e8: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_01f1: ldc.i4.0
IL_01f2: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_01f7: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_01ed: call object ExpressionTrees::ToCode<bool>(object,
IL_01fc: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_01f2: pop
IL_01f3: call object ExpressionTrees::X()
IL_01f8: ldnull
IL_01f9: box class [mscorlib]System.Collections.Generic.List`1<int32>
IL_01fe: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_0203: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0208: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_020d: ldtoken method instance class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<!0> class [mscorlib]System.Collections.Generic.List`1<int32>::AsReadOnly()
IL_0212: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_0217: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
IL_0201: pop
IL_0202: call object ExpressionTrees::X()
IL_0207: ldnull
IL_0208: box class [mscorlib]System.Collections.Generic.List`1<int32>
IL_020d: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_0212: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0217: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_021c: ldtoken method instance class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<!0> class [mscorlib]System.Collections.Generic.List`1<int32>::AsReadOnly()
IL_0221: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_0226: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
valuetype [mscorlib]System.RuntimeTypeHandle)
IL_021c: castclass [mscorlib]System.Reflection.MethodInfo
IL_0221: ldc.i4.0
IL_0222: newarr [System.Core]System.Linq.Expressions.Expression
IL_0227: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
IL_022b: castclass [mscorlib]System.Reflection.MethodInfo
IL_0230: ldc.i4.0
IL_0231: newarr [System.Core]System.Linq.Expressions.Expression
IL_0236: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_022c: ldc.i4.0
IL_022d: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0232: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>>(class [System.Core]System.Linq.Expressions.Expression,
IL_023b: ldc.i4.0
IL_023c: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0241: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0237: call object ExpressionTrees::ToCode<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>(object,
IL_0246: call object ExpressionTrees::ToCode<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_023c: pop
IL_023d: ret
IL_024b: pop
IL_024c: ret
} // end of method ExpressionTrees::MembersDefault
.method public hidebysig instance void
@ -4570,60 +4574,6 @@ @@ -4570,60 +4574,6 @@
IL_0179: ret
} // end of method ExpressionTrees::Strings
.method public hidebysig instance void
StringAccessor() cil managed
{
// Code size 138 (0x8a)
.maxstack 7
.locals init (class [System.Core]System.Linq.Expressions.Expression[] V_0)
IL_0000: nop
IL_0001: call object ExpressionTrees::X()
IL_0006: ldstr "abc"
IL_000b: ldtoken [mscorlib]System.String
IL_0010: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0015: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_001a: ldtoken method instance char [mscorlib]System.String::get_Chars(int32)
IL_001f: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0024: castclass [mscorlib]System.Reflection.MethodInfo
IL_0029: ldc.i4.1
IL_002a: newarr [System.Core]System.Linq.Expressions.Expression
IL_002f: stloc.0
IL_0030: ldloc.0
IL_0031: ldc.i4.0
IL_0032: ldc.i4.1
IL_0033: box [mscorlib]System.Int32
IL_0038: ldtoken [mscorlib]System.Int32
IL_003d: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0042: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0047: stelem.ref
IL_0048: ldloc.0
IL_0049: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_004e: ldtoken [mscorlib]System.Int32
IL_0053: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0058: call class [System.Core]System.Linq.Expressions.UnaryExpression [System.Core]System.Linq.Expressions.Expression::Convert(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Type)
IL_005d: ldc.i4.s 98
IL_005f: box [mscorlib]System.Int32
IL_0064: ldtoken [mscorlib]System.Int32
IL_0069: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_006e: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0073: 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_0078: ldc.i4.0
IL_0079: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_007e: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0083: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_0088: pop
IL_0089: ret
} // end of method ExpressionTrees::StringAccessor
.method public hidebysig instance void
GenericClassInstance() cil managed
{

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

@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 4:0:0:0
}
.assembly zkgfee0m
.assembly '52ioesty'
{
.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.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx
@ -30,15 +30,15 @@ @@ -30,15 +30,15 @@
.hash algorithm 0x00008004
.ver 0:0:0:0
}
.module zkgfee0m.dll
// MVID: {CE4214BB-7BBF-471B-81A0-5ECC07FB8BB5}
.module '52ioesty.dll'
// MVID: {9B3D89BE-AD40-44EF-A532-1D94E4515C78}
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 )
.imagebase 0x10000000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
// Image base: 0x00AF0000
// Image base: 0x05050000
// =============== CLASS MEMBERS DECLARATION ===================
@ -1886,7 +1886,7 @@ @@ -1886,7 +1886,7 @@
.method public hidebysig instance void
MembersDefault() cil managed
{
// Code size 573 (0x23d)
// Code size 588 (0x24c)
.maxstack 7
.locals init (valuetype [mscorlib]System.DateTime V_0,
class [System.Core]System.Linq.Expressions.Expression[] V_1)
@ -1922,156 +1922,160 @@ @@ -1922,156 +1922,160 @@
IL_0061: pop
IL_0062: call object ExpressionTrees::X()
IL_0067: ldnull
IL_0068: box int32[]
IL_006d: ldtoken int32[]
IL_0068: box [mscorlib]System.Array
IL_006d: ldtoken [mscorlib]System.Array
IL_0072: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0077: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_007c: call class [System.Core]System.Linq.Expressions.UnaryExpression [System.Core]System.Linq.Expressions.Expression::ArrayLength(class [System.Core]System.Linq.Expressions.Expression)
IL_0081: ldc.i4.0
IL_0082: box [mscorlib]System.Int32
IL_0087: ldtoken [mscorlib]System.Int32
IL_008c: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0091: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
IL_007c: ldtoken method instance int32 [mscorlib]System.Array::get_Length()
IL_0081: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0086: castclass [mscorlib]System.Reflection.MethodInfo
IL_008b: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo)
IL_0090: ldc.i4.0
IL_0091: box [mscorlib]System.Int32
IL_0096: ldtoken [mscorlib]System.Int32
IL_009b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00a0: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0096: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::Equal(class [System.Core]System.Linq.Expressions.Expression,
IL_00a5: 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_009b: ldc.i4.0
IL_009c: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_00a1: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_00aa: ldc.i4.0
IL_00ab: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_00b0: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_00a6: call object ExpressionTrees::ToCode<bool>(object,
IL_00b5: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_00ab: pop
IL_00ac: call object ExpressionTrees::X()
IL_00b1: ldnull
IL_00b2: box [mscorlib]System.Type
IL_00b7: ldtoken [mscorlib]System.Type
IL_00bc: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00c1: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_00c6: ldtoken method instance bool [mscorlib]System.Type::get_IsLayoutSequential()
IL_00cb: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_00d0: castclass [mscorlib]System.Reflection.MethodInfo
IL_00d5: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
IL_00ba: pop
IL_00bb: call object ExpressionTrees::X()
IL_00c0: ldnull
IL_00c1: box [mscorlib]System.Type
IL_00c6: ldtoken [mscorlib]System.Type
IL_00cb: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00d0: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_00d5: ldtoken method instance bool [mscorlib]System.Type::get_IsLayoutSequential()
IL_00da: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_00df: castclass [mscorlib]System.Reflection.MethodInfo
IL_00e4: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo)
IL_00da: ldc.i4.0
IL_00db: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_00e0: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_00e9: ldc.i4.0
IL_00ea: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_00ef: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_00e5: call object ExpressionTrees::ToCode<bool>(object,
IL_00f4: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_00ea: pop
IL_00eb: call object ExpressionTrees::X()
IL_00f0: ldnull
IL_00f1: box class [mscorlib]System.Collections.Generic.List`1<int32>
IL_00f6: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_00fb: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0100: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0105: ldtoken method instance int32 class [mscorlib]System.Collections.Generic.List`1<int32>::get_Count()
IL_010a: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_010f: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
IL_00f9: pop
IL_00fa: call object ExpressionTrees::X()
IL_00ff: ldnull
IL_0100: box class [mscorlib]System.Collections.Generic.List`1<int32>
IL_0105: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_010a: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_010f: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0114: ldtoken method instance int32 class [mscorlib]System.Collections.Generic.List`1<int32>::get_Count()
IL_0119: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_011e: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0114: castclass [mscorlib]System.Reflection.MethodInfo
IL_0119: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
IL_0123: castclass [mscorlib]System.Reflection.MethodInfo
IL_0128: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo)
IL_011e: ldc.i4.0
IL_011f: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0124: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<int32>>(class [System.Core]System.Linq.Expressions.Expression,
IL_012d: ldc.i4.0
IL_012e: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0133: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<int32>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0129: call object ExpressionTrees::ToCode<int32>(object,
IL_0138: call object ExpressionTrees::ToCode<int32>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_012e: pop
IL_012f: call object ExpressionTrees::X()
IL_0134: ldnull
IL_0135: box int32[]
IL_013a: ldtoken int32[]
IL_013f: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0144: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0149: ldtoken method instance object [mscorlib]System.Array::Clone()
IL_014e: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0153: castclass [mscorlib]System.Reflection.MethodInfo
IL_0158: ldc.i4.0
IL_0159: newarr [System.Core]System.Linq.Expressions.Expression
IL_015e: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
IL_013d: pop
IL_013e: call object ExpressionTrees::X()
IL_0143: ldnull
IL_0144: box [mscorlib]System.Array
IL_0149: ldtoken [mscorlib]System.Array
IL_014e: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0153: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0158: ldtoken method instance object [mscorlib]System.Array::Clone()
IL_015d: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0162: castclass [mscorlib]System.Reflection.MethodInfo
IL_0167: ldc.i4.0
IL_0168: newarr [System.Core]System.Linq.Expressions.Expression
IL_016d: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_0163: ldnull
IL_0164: box [mscorlib]System.Object
IL_0169: ldtoken [mscorlib]System.Object
IL_016e: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0173: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
IL_0172: ldnull
IL_0173: box [mscorlib]System.Object
IL_0178: ldtoken [mscorlib]System.Object
IL_017d: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0182: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0178: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::Equal(class [System.Core]System.Linq.Expressions.Expression,
IL_0187: 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_017d: ldc.i4.0
IL_017e: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0183: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_018c: ldc.i4.0
IL_018d: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0192: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0188: call object ExpressionTrees::ToCode<bool>(object,
IL_0197: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_018d: pop
IL_018e: call object ExpressionTrees::X()
IL_0193: ldnull
IL_0194: box [mscorlib]System.Type
IL_0199: ldtoken [mscorlib]System.Type
IL_019e: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01a3: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_01a8: ldtoken method instance bool [mscorlib]System.Type::IsInstanceOfType(object)
IL_01ad: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_01b2: castclass [mscorlib]System.Reflection.MethodInfo
IL_01b7: ldc.i4.1
IL_01b8: newarr [System.Core]System.Linq.Expressions.Expression
IL_01bd: stloc.1
IL_01be: ldloc.1
IL_01bf: ldc.i4.0
IL_01c0: ldtoken method instance void [mscorlib]System.Object::.ctor()
IL_01c5: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_01ca: castclass [mscorlib]System.Reflection.ConstructorInfo
IL_01cf: ldc.i4.0
IL_01d0: newarr [System.Core]System.Linq.Expressions.Expression
IL_01d5: call class [System.Core]System.Linq.Expressions.NewExpression [System.Core]System.Linq.Expressions.Expression::New(class [mscorlib]System.Reflection.ConstructorInfo,
IL_019c: pop
IL_019d: call object ExpressionTrees::X()
IL_01a2: ldnull
IL_01a3: box [mscorlib]System.Type
IL_01a8: ldtoken [mscorlib]System.Type
IL_01ad: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01b2: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_01b7: ldtoken method instance bool [mscorlib]System.Type::IsInstanceOfType(object)
IL_01bc: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_01c1: castclass [mscorlib]System.Reflection.MethodInfo
IL_01c6: ldc.i4.1
IL_01c7: newarr [System.Core]System.Linq.Expressions.Expression
IL_01cc: stloc.1
IL_01cd: ldloc.1
IL_01ce: ldc.i4.0
IL_01cf: ldtoken method instance void [mscorlib]System.Object::.ctor()
IL_01d4: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_01d9: castclass [mscorlib]System.Reflection.ConstructorInfo
IL_01de: ldc.i4.0
IL_01df: newarr [System.Core]System.Linq.Expressions.Expression
IL_01e4: call class [System.Core]System.Linq.Expressions.NewExpression [System.Core]System.Linq.Expressions.Expression::New(class [mscorlib]System.Reflection.ConstructorInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_01da: stelem.ref
IL_01db: ldloc.1
IL_01dc: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
IL_01e9: stelem.ref
IL_01ea: ldloc.1
IL_01eb: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_01e1: ldc.i4.0
IL_01e2: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_01e7: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_01f0: ldc.i4.0
IL_01f1: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_01f6: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_01ec: call object ExpressionTrees::ToCode<bool>(object,
IL_01fb: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_01f1: pop
IL_01f2: call object ExpressionTrees::X()
IL_01f7: ldnull
IL_01f8: box class [mscorlib]System.Collections.Generic.List`1<int32>
IL_01fd: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_0202: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0207: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_020c: ldtoken method instance class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<!0> class [mscorlib]System.Collections.Generic.List`1<int32>::AsReadOnly()
IL_0211: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_0216: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
IL_0200: pop
IL_0201: call object ExpressionTrees::X()
IL_0206: ldnull
IL_0207: box class [mscorlib]System.Collections.Generic.List`1<int32>
IL_020c: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_0211: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0216: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_021b: ldtoken method instance class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<!0> class [mscorlib]System.Collections.Generic.List`1<int32>::AsReadOnly()
IL_0220: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_0225: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
valuetype [mscorlib]System.RuntimeTypeHandle)
IL_021b: castclass [mscorlib]System.Reflection.MethodInfo
IL_0220: ldc.i4.0
IL_0221: newarr [System.Core]System.Linq.Expressions.Expression
IL_0226: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
IL_022a: castclass [mscorlib]System.Reflection.MethodInfo
IL_022f: ldc.i4.0
IL_0230: newarr [System.Core]System.Linq.Expressions.Expression
IL_0235: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_022b: ldc.i4.0
IL_022c: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0231: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>>(class [System.Core]System.Linq.Expressions.Expression,
IL_023a: ldc.i4.0
IL_023b: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0240: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0236: call object ExpressionTrees::ToCode<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>(object,
IL_0245: call object ExpressionTrees::ToCode<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_023b: pop
IL_023c: ret
IL_024a: pop
IL_024b: ret
} // end of method ExpressionTrees::MembersDefault
.method public hidebysig instance void
@ -4476,59 +4480,6 @@ @@ -4476,59 +4480,6 @@
IL_0177: ret
} // end of method ExpressionTrees::Strings
.method public hidebysig instance void
StringAccessor() cil managed
{
// Code size 137 (0x89)
.maxstack 7
.locals init (class [System.Core]System.Linq.Expressions.Expression[] V_0)
IL_0000: call object ExpressionTrees::X()
IL_0005: ldstr "abc"
IL_000a: ldtoken [mscorlib]System.String
IL_000f: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0014: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0019: ldtoken method instance char [mscorlib]System.String::get_Chars(int32)
IL_001e: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0023: castclass [mscorlib]System.Reflection.MethodInfo
IL_0028: ldc.i4.1
IL_0029: newarr [System.Core]System.Linq.Expressions.Expression
IL_002e: stloc.0
IL_002f: ldloc.0
IL_0030: ldc.i4.0
IL_0031: ldc.i4.1
IL_0032: box [mscorlib]System.Int32
IL_0037: ldtoken [mscorlib]System.Int32
IL_003c: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0041: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0046: stelem.ref
IL_0047: ldloc.0
IL_0048: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_004d: ldtoken [mscorlib]System.Int32
IL_0052: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0057: call class [System.Core]System.Linq.Expressions.UnaryExpression [System.Core]System.Linq.Expressions.Expression::Convert(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Type)
IL_005c: ldc.i4.s 98
IL_005e: box [mscorlib]System.Int32
IL_0063: ldtoken [mscorlib]System.Int32
IL_0068: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_006d: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0072: 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_0077: ldc.i4.0
IL_0078: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_007d: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0082: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_0087: pop
IL_0088: ret
} // end of method ExpressionTrees::StringAccessor
.method public hidebysig instance void
GenericClassInstance() cil managed
{

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

@ -35,14 +35,14 @@ @@ -35,14 +35,14 @@
.ver 0:0:0:0
}
.module ExpressionTrees.dll
// MVID: {40B0725B-4128-4144-86C1-FC7C593DEAA3}
// MVID: {011EC1DC-4E6D-41D3-A477-6AFAB3E4853A}
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 )
.imagebase 0x10000000
.file alignment 0x00000200
.stackreserve 0x00100000
.subsystem 0x0003 // WINDOWS_CUI
.corflags 0x00000001 // ILONLY
// Image base: 0x00F70000
// Image base: 0x04DC0000
// =============== CLASS MEMBERS DECLARATION ===================
@ -2233,7 +2233,7 @@ @@ -2233,7 +2233,7 @@
.method public hidebysig instance void
MembersDefault() cil managed
{
// Code size 525 (0x20d)
// Code size 540 (0x21c)
.maxstack 7
.locals init (valuetype [mscorlib]System.DateTime V_0)
IL_0000: call object ExpressionTrees::X()
@ -2268,143 +2268,147 @@ @@ -2268,143 +2268,147 @@
IL_0061: pop
IL_0062: call object ExpressionTrees::X()
IL_0067: ldnull
IL_0068: ldtoken int32[]
IL_0068: ldtoken [mscorlib]System.Array
IL_006d: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0072: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0077: call class [System.Core]System.Linq.Expressions.UnaryExpression [System.Core]System.Linq.Expressions.Expression::ArrayLength(class [System.Core]System.Linq.Expressions.Expression)
IL_007c: ldc.i4.0
IL_007d: box [mscorlib]System.Int32
IL_0082: ldtoken [mscorlib]System.Int32
IL_0087: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_008c: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
IL_0077: ldtoken method instance int32 [mscorlib]System.Array::get_Length()
IL_007c: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0081: castclass [mscorlib]System.Reflection.MethodInfo
IL_0086: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo)
IL_008b: ldc.i4.0
IL_008c: box [mscorlib]System.Int32
IL_0091: ldtoken [mscorlib]System.Int32
IL_0096: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_009b: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0091: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::Equal(class [System.Core]System.Linq.Expressions.Expression,
IL_00a0: 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_0096: ldc.i4.0
IL_0097: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_009c: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_00a5: ldc.i4.0
IL_00a6: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_00ab: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_00a1: call object ExpressionTrees::ToCode<bool>(object,
IL_00b0: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_00a6: pop
IL_00a7: call object ExpressionTrees::X()
IL_00ac: ldnull
IL_00ad: ldtoken [mscorlib]System.Type
IL_00b2: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00b7: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
IL_00b5: pop
IL_00b6: call object ExpressionTrees::X()
IL_00bb: ldnull
IL_00bc: ldtoken [mscorlib]System.Type
IL_00c1: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00c6: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_00bc: ldtoken method instance bool [mscorlib]System.Type::get_IsLayoutSequential()
IL_00c1: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_00c6: castclass [mscorlib]System.Reflection.MethodInfo
IL_00cb: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
IL_00cb: ldtoken method instance bool [mscorlib]System.Type::get_IsLayoutSequential()
IL_00d0: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_00d5: castclass [mscorlib]System.Reflection.MethodInfo
IL_00da: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo)
IL_00d0: ldc.i4.0
IL_00d1: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_00d6: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_00df: ldc.i4.0
IL_00e0: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_00e5: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_00db: call object ExpressionTrees::ToCode<bool>(object,
IL_00ea: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_00e0: pop
IL_00e1: call object ExpressionTrees::X()
IL_00e6: ldnull
IL_00e7: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_00ec: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00f1: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
IL_00ef: pop
IL_00f0: call object ExpressionTrees::X()
IL_00f5: ldnull
IL_00f6: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_00fb: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0100: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_00f6: ldtoken method instance int32 class [mscorlib]System.Collections.Generic.List`1<int32>::get_Count()
IL_00fb: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_0100: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
IL_0105: ldtoken method instance int32 class [mscorlib]System.Collections.Generic.List`1<int32>::get_Count()
IL_010a: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_010f: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0105: castclass [mscorlib]System.Reflection.MethodInfo
IL_010a: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
IL_0114: castclass [mscorlib]System.Reflection.MethodInfo
IL_0119: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo)
IL_010f: ldc.i4.0
IL_0110: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0115: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<int32>>(class [System.Core]System.Linq.Expressions.Expression,
IL_011e: ldc.i4.0
IL_011f: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0124: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<int32>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_011a: call object ExpressionTrees::ToCode<int32>(object,
IL_0129: call object ExpressionTrees::ToCode<int32>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_011f: pop
IL_0120: call object ExpressionTrees::X()
IL_0125: ldnull
IL_0126: ldtoken int32[]
IL_012b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0130: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0135: ldtoken method instance object [mscorlib]System.Array::Clone()
IL_013a: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_013f: castclass [mscorlib]System.Reflection.MethodInfo
IL_0144: ldc.i4.0
IL_0145: newarr [System.Core]System.Linq.Expressions.Expression
IL_014a: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
IL_012e: pop
IL_012f: call object ExpressionTrees::X()
IL_0134: ldnull
IL_0135: ldtoken [mscorlib]System.Array
IL_013a: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_013f: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0144: ldtoken method instance object [mscorlib]System.Array::Clone()
IL_0149: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_014e: castclass [mscorlib]System.Reflection.MethodInfo
IL_0153: ldc.i4.0
IL_0154: newarr [System.Core]System.Linq.Expressions.Expression
IL_0159: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_014f: ldnull
IL_0150: ldtoken [mscorlib]System.Object
IL_0155: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_015a: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
IL_015e: ldnull
IL_015f: ldtoken [mscorlib]System.Object
IL_0164: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0169: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_015f: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::Equal(class [System.Core]System.Linq.Expressions.Expression,
IL_016e: 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_0164: ldc.i4.0
IL_0165: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_016a: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_0173: ldc.i4.0
IL_0174: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0179: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_016f: call object ExpressionTrees::ToCode<bool>(object,
IL_017e: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_0174: pop
IL_0175: call object ExpressionTrees::X()
IL_017a: ldnull
IL_017b: ldtoken [mscorlib]System.Type
IL_0180: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0185: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_018a: ldtoken method instance bool [mscorlib]System.Type::IsInstanceOfType(object)
IL_018f: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0194: castclass [mscorlib]System.Reflection.MethodInfo
IL_0199: ldc.i4.1
IL_019a: newarr [System.Core]System.Linq.Expressions.Expression
IL_019f: dup
IL_01a0: ldc.i4.0
IL_01a1: ldtoken [mscorlib]System.Object
IL_01a6: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01ab: call class [System.Core]System.Linq.Expressions.NewExpression [System.Core]System.Linq.Expressions.Expression::New(class [mscorlib]System.Type)
IL_01b0: stelem.ref
IL_01b1: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
IL_0183: pop
IL_0184: call object ExpressionTrees::X()
IL_0189: ldnull
IL_018a: ldtoken [mscorlib]System.Type
IL_018f: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0194: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0199: ldtoken method instance bool [mscorlib]System.Type::IsInstanceOfType(object)
IL_019e: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_01a3: castclass [mscorlib]System.Reflection.MethodInfo
IL_01a8: ldc.i4.1
IL_01a9: newarr [System.Core]System.Linq.Expressions.Expression
IL_01ae: dup
IL_01af: ldc.i4.0
IL_01b0: ldtoken [mscorlib]System.Object
IL_01b5: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01ba: call class [System.Core]System.Linq.Expressions.NewExpression [System.Core]System.Linq.Expressions.Expression::New(class [mscorlib]System.Type)
IL_01bf: stelem.ref
IL_01c0: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_01b6: ldc.i4.0
IL_01b7: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_01bc: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_01c5: ldc.i4.0
IL_01c6: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_01cb: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_01c1: call object ExpressionTrees::ToCode<bool>(object,
IL_01d0: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_01c6: pop
IL_01c7: call object ExpressionTrees::X()
IL_01cc: ldnull
IL_01cd: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_01d2: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01d7: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_01dc: ldtoken method instance class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<!0> class [mscorlib]System.Collections.Generic.List`1<int32>::AsReadOnly()
IL_01e1: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_01e6: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
IL_01d5: pop
IL_01d6: call object ExpressionTrees::X()
IL_01db: ldnull
IL_01dc: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_01e1: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01e6: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_01eb: ldtoken method instance class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<!0> class [mscorlib]System.Collections.Generic.List`1<int32>::AsReadOnly()
IL_01f0: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_01f5: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01eb: castclass [mscorlib]System.Reflection.MethodInfo
IL_01f0: ldc.i4.0
IL_01f1: newarr [System.Core]System.Linq.Expressions.Expression
IL_01f6: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
IL_01fa: castclass [mscorlib]System.Reflection.MethodInfo
IL_01ff: ldc.i4.0
IL_0200: newarr [System.Core]System.Linq.Expressions.Expression
IL_0205: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_01fb: ldc.i4.0
IL_01fc: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0201: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>>(class [System.Core]System.Linq.Expressions.Expression,
IL_020a: ldc.i4.0
IL_020b: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0210: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0206: call object ExpressionTrees::ToCode<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>(object,
IL_0215: call object ExpressionTrees::ToCode<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_020b: pop
IL_020c: ret
IL_021a: pop
IL_021b: ret
} // end of method ExpressionTrees::MembersDefault
.method public hidebysig instance void
@ -4631,56 +4635,6 @@ @@ -4631,56 +4635,6 @@
IL_0195: ret
} // end of method ExpressionTrees::Strings
.method public hidebysig instance void
StringAccessor() cil managed
{
// Code size 135 (0x87)
.maxstack 8
IL_0000: call object ExpressionTrees::X()
IL_0005: ldstr "abc"
IL_000a: ldtoken [mscorlib]System.String
IL_000f: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0014: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0019: ldtoken method instance char [mscorlib]System.String::get_Chars(int32)
IL_001e: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0023: castclass [mscorlib]System.Reflection.MethodInfo
IL_0028: ldc.i4.1
IL_0029: newarr [System.Core]System.Linq.Expressions.Expression
IL_002e: dup
IL_002f: ldc.i4.0
IL_0030: ldc.i4.1
IL_0031: box [mscorlib]System.Int32
IL_0036: ldtoken [mscorlib]System.Int32
IL_003b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0040: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0045: stelem.ref
IL_0046: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_004b: ldtoken [mscorlib]System.Int32
IL_0050: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0055: call class [System.Core]System.Linq.Expressions.UnaryExpression [System.Core]System.Linq.Expressions.Expression::Convert(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Type)
IL_005a: ldc.i4.s 98
IL_005c: box [mscorlib]System.Int32
IL_0061: ldtoken [mscorlib]System.Int32
IL_0066: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_006b: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0070: 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_0075: ldc.i4.0
IL_0076: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_007b: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0080: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_0085: pop
IL_0086: ret
} // end of method ExpressionTrees::StringAccessor
.method public hidebysig instance void
GenericClassInstance() cil managed
{

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

@ -35,7 +35,7 @@ @@ -35,7 +35,7 @@
.ver 0:0:0:0
}
.module ExpressionTrees.dll
// MVID: {D68B624D-BA3C-4BAF-8282-A46E4994F3C5}
// MVID: {8FA0BC83-A8B7-4800-8E3F-0A672A66BCAE}
.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 )
.imagebase 0x10000000
.file alignment 0x00000200
@ -2301,7 +2301,7 @@ @@ -2301,7 +2301,7 @@
.method public hidebysig instance void
MembersDefault() cil managed
{
// Code size 526 (0x20e)
// Code size 541 (0x21d)
.maxstack 7
.locals init (valuetype [mscorlib]System.DateTime V_0)
IL_0000: nop
@ -2337,143 +2337,147 @@ @@ -2337,143 +2337,147 @@
IL_0062: pop
IL_0063: call object ExpressionTrees::X()
IL_0068: ldnull
IL_0069: ldtoken int32[]
IL_0069: ldtoken [mscorlib]System.Array
IL_006e: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0073: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0078: call class [System.Core]System.Linq.Expressions.UnaryExpression [System.Core]System.Linq.Expressions.Expression::ArrayLength(class [System.Core]System.Linq.Expressions.Expression)
IL_007d: ldc.i4.0
IL_007e: box [mscorlib]System.Int32
IL_0083: ldtoken [mscorlib]System.Int32
IL_0088: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_008d: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
IL_0078: ldtoken method instance int32 [mscorlib]System.Array::get_Length()
IL_007d: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0082: castclass [mscorlib]System.Reflection.MethodInfo
IL_0087: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo)
IL_008c: ldc.i4.0
IL_008d: box [mscorlib]System.Int32
IL_0092: ldtoken [mscorlib]System.Int32
IL_0097: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_009c: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0092: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::Equal(class [System.Core]System.Linq.Expressions.Expression,
IL_00a1: 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_0097: ldc.i4.0
IL_0098: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_009d: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_00a6: ldc.i4.0
IL_00a7: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_00ac: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_00a2: call object ExpressionTrees::ToCode<bool>(object,
IL_00b1: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_00a7: pop
IL_00a8: call object ExpressionTrees::X()
IL_00ad: ldnull
IL_00ae: ldtoken [mscorlib]System.Type
IL_00b3: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00b8: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
IL_00b6: pop
IL_00b7: call object ExpressionTrees::X()
IL_00bc: ldnull
IL_00bd: ldtoken [mscorlib]System.Type
IL_00c2: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00c7: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_00bd: ldtoken method instance bool [mscorlib]System.Type::get_IsLayoutSequential()
IL_00c2: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_00c7: castclass [mscorlib]System.Reflection.MethodInfo
IL_00cc: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
IL_00cc: ldtoken method instance bool [mscorlib]System.Type::get_IsLayoutSequential()
IL_00d1: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_00d6: castclass [mscorlib]System.Reflection.MethodInfo
IL_00db: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo)
IL_00d1: ldc.i4.0
IL_00d2: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_00d7: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_00e0: ldc.i4.0
IL_00e1: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_00e6: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_00dc: call object ExpressionTrees::ToCode<bool>(object,
IL_00eb: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_00e1: pop
IL_00e2: call object ExpressionTrees::X()
IL_00e7: ldnull
IL_00e8: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_00ed: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_00f2: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
IL_00f0: pop
IL_00f1: call object ExpressionTrees::X()
IL_00f6: ldnull
IL_00f7: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_00fc: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0101: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_00f7: ldtoken method instance int32 class [mscorlib]System.Collections.Generic.List`1<int32>::get_Count()
IL_00fc: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_0101: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
IL_0106: ldtoken method instance int32 class [mscorlib]System.Collections.Generic.List`1<int32>::get_Count()
IL_010b: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_0110: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0106: castclass [mscorlib]System.Reflection.MethodInfo
IL_010b: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
IL_0115: castclass [mscorlib]System.Reflection.MethodInfo
IL_011a: call class [System.Core]System.Linq.Expressions.MemberExpression [System.Core]System.Linq.Expressions.Expression::Property(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo)
IL_0110: ldc.i4.0
IL_0111: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0116: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<int32>>(class [System.Core]System.Linq.Expressions.Expression,
IL_011f: ldc.i4.0
IL_0120: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0125: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<int32>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_011b: call object ExpressionTrees::ToCode<int32>(object,
IL_012a: call object ExpressionTrees::ToCode<int32>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_0120: pop
IL_0121: call object ExpressionTrees::X()
IL_0126: ldnull
IL_0127: ldtoken int32[]
IL_012c: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0131: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0136: ldtoken method instance object [mscorlib]System.Array::Clone()
IL_013b: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0140: castclass [mscorlib]System.Reflection.MethodInfo
IL_0145: ldc.i4.0
IL_0146: newarr [System.Core]System.Linq.Expressions.Expression
IL_014b: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
IL_012f: pop
IL_0130: call object ExpressionTrees::X()
IL_0135: ldnull
IL_0136: ldtoken [mscorlib]System.Array
IL_013b: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0140: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0145: ldtoken method instance object [mscorlib]System.Array::Clone()
IL_014a: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_014f: castclass [mscorlib]System.Reflection.MethodInfo
IL_0154: ldc.i4.0
IL_0155: newarr [System.Core]System.Linq.Expressions.Expression
IL_015a: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_0150: ldnull
IL_0151: ldtoken [mscorlib]System.Object
IL_0156: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_015b: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
IL_015f: ldnull
IL_0160: ldtoken [mscorlib]System.Object
IL_0165: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_016a: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0160: call class [System.Core]System.Linq.Expressions.BinaryExpression [System.Core]System.Linq.Expressions.Expression::Equal(class [System.Core]System.Linq.Expressions.Expression,
IL_016f: 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_0165: ldc.i4.0
IL_0166: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_016b: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_0174: ldc.i4.0
IL_0175: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_017a: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0170: call object ExpressionTrees::ToCode<bool>(object,
IL_017f: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_0175: pop
IL_0176: call object ExpressionTrees::X()
IL_017b: ldnull
IL_017c: ldtoken [mscorlib]System.Type
IL_0181: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0186: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_018b: ldtoken method instance bool [mscorlib]System.Type::IsInstanceOfType(object)
IL_0190: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0195: castclass [mscorlib]System.Reflection.MethodInfo
IL_019a: ldc.i4.1
IL_019b: newarr [System.Core]System.Linq.Expressions.Expression
IL_01a0: dup
IL_01a1: ldc.i4.0
IL_01a2: ldtoken [mscorlib]System.Object
IL_01a7: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01ac: call class [System.Core]System.Linq.Expressions.NewExpression [System.Core]System.Linq.Expressions.Expression::New(class [mscorlib]System.Type)
IL_01b1: stelem.ref
IL_01b2: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
IL_0184: pop
IL_0185: call object ExpressionTrees::X()
IL_018a: ldnull
IL_018b: ldtoken [mscorlib]System.Type
IL_0190: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0195: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_019a: ldtoken method instance bool [mscorlib]System.Type::IsInstanceOfType(object)
IL_019f: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_01a4: castclass [mscorlib]System.Reflection.MethodInfo
IL_01a9: ldc.i4.1
IL_01aa: newarr [System.Core]System.Linq.Expressions.Expression
IL_01af: dup
IL_01b0: ldc.i4.0
IL_01b1: ldtoken [mscorlib]System.Object
IL_01b6: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01bb: call class [System.Core]System.Linq.Expressions.NewExpression [System.Core]System.Linq.Expressions.Expression::New(class [mscorlib]System.Type)
IL_01c0: stelem.ref
IL_01c1: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_01b7: ldc.i4.0
IL_01b8: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_01bd: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
IL_01c6: ldc.i4.0
IL_01c7: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_01cc: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_01c2: call object ExpressionTrees::ToCode<bool>(object,
IL_01d1: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_01c7: pop
IL_01c8: call object ExpressionTrees::X()
IL_01cd: ldnull
IL_01ce: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_01d3: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01d8: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_01dd: ldtoken method instance class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<!0> class [mscorlib]System.Collections.Generic.List`1<int32>::AsReadOnly()
IL_01e2: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_01e7: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
IL_01d6: pop
IL_01d7: call object ExpressionTrees::X()
IL_01dc: ldnull
IL_01dd: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_01e2: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01e7: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_01ec: ldtoken method instance class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<!0> class [mscorlib]System.Collections.Generic.List`1<int32>::AsReadOnly()
IL_01f1: ldtoken class [mscorlib]System.Collections.Generic.List`1<int32>
IL_01f6: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle,
valuetype [mscorlib]System.RuntimeTypeHandle)
IL_01ec: castclass [mscorlib]System.Reflection.MethodInfo
IL_01f1: ldc.i4.0
IL_01f2: newarr [System.Core]System.Linq.Expressions.Expression
IL_01f7: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
IL_01fb: castclass [mscorlib]System.Reflection.MethodInfo
IL_0200: ldc.i4.0
IL_0201: newarr [System.Core]System.Linq.Expressions.Expression
IL_0206: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_01fc: ldc.i4.0
IL_01fd: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0202: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>>(class [System.Core]System.Linq.Expressions.Expression,
IL_020b: ldc.i4.0
IL_020c: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_0211: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0207: call object ExpressionTrees::ToCode<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>(object,
IL_0216: call object ExpressionTrees::ToCode<class [mscorlib]System.Collections.ObjectModel.ReadOnlyCollection`1<int32>>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_020c: pop
IL_020d: ret
IL_021b: pop
IL_021c: ret
} // end of method ExpressionTrees::MembersDefault
.method public hidebysig instance void
@ -4755,57 +4759,6 @@ @@ -4755,57 +4759,6 @@
IL_0196: ret
} // end of method ExpressionTrees::Strings
.method public hidebysig instance void
StringAccessor() cil managed
{
// Code size 136 (0x88)
.maxstack 8
IL_0000: nop
IL_0001: call object ExpressionTrees::X()
IL_0006: ldstr "abc"
IL_000b: ldtoken [mscorlib]System.String
IL_0010: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0015: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_001a: ldtoken method instance char [mscorlib]System.String::get_Chars(int32)
IL_001f: call class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Reflection.MethodBase::GetMethodFromHandle(valuetype [mscorlib]System.RuntimeMethodHandle)
IL_0024: castclass [mscorlib]System.Reflection.MethodInfo
IL_0029: ldc.i4.1
IL_002a: newarr [System.Core]System.Linq.Expressions.Expression
IL_002f: dup
IL_0030: ldc.i4.0
IL_0031: ldc.i4.1
IL_0032: box [mscorlib]System.Int32
IL_0037: ldtoken [mscorlib]System.Int32
IL_003c: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0041: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0046: stelem.ref
IL_0047: call class [System.Core]System.Linq.Expressions.MethodCallExpression [System.Core]System.Linq.Expressions.Expression::Call(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Reflection.MethodInfo,
class [System.Core]System.Linq.Expressions.Expression[])
IL_004c: ldtoken [mscorlib]System.Int32
IL_0051: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0056: call class [System.Core]System.Linq.Expressions.UnaryExpression [System.Core]System.Linq.Expressions.Expression::Convert(class [System.Core]System.Linq.Expressions.Expression,
class [mscorlib]System.Type)
IL_005b: ldc.i4.s 98
IL_005d: box [mscorlib]System.Int32
IL_0062: ldtoken [mscorlib]System.Int32
IL_0067: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_006c: call class [System.Core]System.Linq.Expressions.ConstantExpression [System.Core]System.Linq.Expressions.Expression::Constant(object,
class [mscorlib]System.Type)
IL_0071: 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_0076: ldc.i4.0
IL_0077: newarr [System.Core]System.Linq.Expressions.ParameterExpression
IL_007c: call class [System.Core]System.Linq.Expressions.Expression`1<!!0> [System.Core]System.Linq.Expressions.Expression::Lambda<class [mscorlib]System.Func`1<bool>>(class [System.Core]System.Linq.Expressions.Expression,
class [System.Core]System.Linq.Expressions.ParameterExpression[])
IL_0081: call object ExpressionTrees::ToCode<bool>(object,
class [System.Core]System.Linq.Expressions.Expression`1<class [mscorlib]System.Func`1<!!0>>)
IL_0086: pop
IL_0087: ret
} // end of method ExpressionTrees::StringAccessor
.method public hidebysig instance void
GenericClassInstance() cil managed
{

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

@ -461,6 +461,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -461,6 +461,8 @@ namespace ICSharpCode.Decompiler.IL.Transforms
var (expr, exprType) = ConvertInstruction(invocation.Arguments[0]);
if (expr == null)
return (null, SpecialType.UnknownType);
if (exprType.IsSmallIntegerType() && targetType.IsKnownType(KnownTypeCode.Int32))
return (expr, targetType);
return (new ExpressionTreeCast(targetType, expr, isChecked), targetType);
}
@ -531,7 +533,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms @@ -531,7 +533,7 @@ namespace ICSharpCode.Decompiler.IL.Transforms
if (!MatchConstantCall(invocation, out var value, out var type))
return (null, SpecialType.UnknownType);
if (value.MatchBox(out var arg, out var boxType)) {
if (boxType.Kind == TypeKind.Enum)
if (boxType.Kind == TypeKind.Enum || boxType.IsKnownType(KnownTypeCode.Boolean))
return (new ExpressionTreeCast(boxType, ConvertValue(arg, invocation).Item1, false), boxType);
value = ConvertValue(arg, invocation).Item1;
return (value, type);

Loading…
Cancel
Save