{
string s = "localvar";
Expression<Func<string>> e9 = () => s;
+ s = "changed";
+
AssertNodeType (e9, ExpressionType.MemberAccess);
- Assert ("localvar", e9.Compile ().Invoke ());
+ Assert ("changed", e9.Compile ().Invoke ());
}
void MemberInitTest ()
Assert (2, e.Compile ().Invoke ().Compile ().Invoke ());
}
+ void QuoteTest_2 ()
+ {
+ Expression<Func<string, Expression<Func<string>>>> e = (string s) => () => s;
+ AssertNodeType (e, ExpressionType.Quote);
+
+ // Blocked by https://bugzilla.novell.com/show_bug.cgi?id=550722
+ //Assert ("data", e.Compile ().Invoke ("data").Compile ().Invoke ());
+ }
+
void RightShiftTest ()
{
Expression<Func<ulong, short, ulong>> e = (ulong a, short b) => a >> b;
public static void Foo<T> (Expression<Func<T, T>> x)
{
}
+
+ static string Param (string b)
+ {
+ Expression<Func<string, Expression<Func<string>>>> e = (string s) => () => b;
+ return e.Compile () ("-##54!2").Compile () ();
+ }
- public static void Main ()
+ public static int Main ()
{
Foo<int> ((i) => i);
Expression<Func<int, int>> func = (i) => i;
Foo (func);
+
+ if (Param ("my test") != "my test")
+ return 1;
+
+ return 0;
}
}
<size>63</size>
</method>
<method name="Void MemberAccessTest_9()">
- <size>80</size>
+ <size>91</size>
</method>
<method name="Void MemberInitTest()">
<size>302</size>
<method name="Void LambdaTest()">
<size>89</size>
</method>
- </type>
- <type name="Tester+<MemberAccessTest>c__AnonStorey2">
- <method name="Void .ctor()">
- <size>7</size>
- </method>
- </type>
- <type name="Tester+<MemberAccessTest_3>c__AnonStorey3">
- <method name="Void .ctor()">
- <size>7</size>
- </method>
- </type>
- <type name="Tester+<MemberAccessTest_4>c__AnonStorey4">
- <method name="Void .ctor()">
- <size>7</size>
- </method>
- </type>
- <type name="Tester+<MemberAccessTest_6>c__AnonStorey5">
- <method name="Void .ctor()">
- <size>7</size>
- </method>
- </type>
- <type name="Tester+<MemberAccessTest_9>c__AnonStorey6">
- <method name="Void .ctor()">
- <size>7</size>
- </method>
- </type>
- <type name="Tester">
<method name="Void EqualTest_15()">
<size>159</size>
</method>
<method name="Void RightShiftTest_5()">
<size>152</size>
</method>
+ <method name="Void QuoteTest_2()">
+ <size>63</size>
+ </method>
+ </type>
+ <type name="Tester+<MemberAccessTest>c__AnonStorey1">
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="Tester+<MemberAccessTest_3>c__AnonStorey2">
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="Tester+<MemberAccessTest_4>c__AnonStorey3">
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="Tester+<MemberAccessTest_6>c__AnonStorey4">
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
+ </type>
+ <type name="Tester+<MemberAccessTest_9>c__AnonStorey5">
+ <method name="Void .ctor()">
+ <size>7</size>
+ </method>
</type>
</test>
<test name="gtest-etree-02.cs">
<method name="Void Foo[T](System.Linq.Expressions.Expression`1[System.Func`2[T,T]])">
<size>1</size>
</method>
- <method name="Void Main()">
- <size>129</size>
+ <method name="System.String Param(System.String)">
+ <size>114</size>
+ </method>
+ <method name="Int32 Main()">
+ <size>157</size>
+ </method>
+ </type>
+ <type name="M+<Param>c__AnonStorey0">
+ <method name="Void .ctor()">
+ <size>7</size>
</method>
</type>
</test>