2008-09-01 Marek Safar <marek.safar@gmail.com>
authorMarek Safar <marek.safar@gmail.com>
Mon, 1 Sep 2008 16:35:43 +0000 (16:35 -0000)
committerMarek Safar <marek.safar@gmail.com>
Mon, 1 Sep 2008 16:35:43 +0000 (16:35 -0000)
A fix for bug #418908
* class.cs: Use AddScopeStatement for field initializers.

svn path=/trunk/mcs/; revision=112045

mcs/tests/gtest-etree-12.cs [new file with mode: 0755]
mcs/tests/ver-il-gmcs.xml

diff --git a/mcs/tests/gtest-etree-12.cs b/mcs/tests/gtest-etree-12.cs
new file mode 100755 (executable)
index 0000000..083ab91
--- /dev/null
@@ -0,0 +1,30 @@
+using System;
+using System.Reflection;
+using System.Linq.Expressions;
+
+public static class TestCase
+{
+       // This causes all the trouble:
+       public static bool DUMMY = StaticMethodTakingAnExpression ((i) => true);
+
+       public static bool StaticMethodTakingAnExpression (
+         Expression<Func<object, bool>> expression)
+       {
+               // I don't execute the expression here!!!
+               return false;
+       }
+
+       public static void DummyToMakeTheStaticsInitialize ()
+       {
+               // Just a dummy method to make this static class get initialized
+       }
+}
+
+public class Program
+{
+       public static int Main ()
+       {
+               TestCase.DummyToMakeTheStaticsInitialize ();
+               return 0;
+       }
+}
index fe1d8cd4abb0ae6a9bfcbff9b8b26065f0b711f1..e774035627664de0d8671764513f6619ca9647a8 100644 (file)
       </method>
     </type>
   </test>
+  <test name="gtest-etree-12.cs">
+    <type name="TestCase">
+      <method name="Void .cctor()">
+        <size>68</size>
+      </method>
+      <method name="Boolean StaticMethodTakingAnExpression(System.Linq.Expressions.Expression`1[System.Func`2[System.Object,System.Boolean]])">
+        <size>2</size>
+      </method>
+      <method name="Void DummyToMakeTheStaticsInitialize()">
+        <size>1</size>
+      </method>
+    </type>
+    <type name="Program">
+      <method name="Void .ctor()">
+        <size>7</size>
+      </method>
+      <method name="Int32 Main()">
+        <size>7</size>
+      </method>
+    </type>
+  </test>
   <test name="gtest-exmethod-01.cs">
     <type name="SimpleTest">
       <method name="System.String Prefix(System.String, System.String)">