Add a test.
authorZoltan Varga <vargaz@gmail.com>
Sat, 24 Apr 2010 23:49:00 +0000 (23:49 -0000)
committerZoltan Varga <vargaz@gmail.com>
Sat, 24 Apr 2010 23:49:00 +0000 (23:49 -0000)
svn path=/trunk/mono/; revision=156053

mono/tests/Makefile.am
mono/tests/bug-599469.cs [new file with mode: 0644]

index deb9e1578d3086bb3451427a8766109ce82b4b0e..ece41ac8d4bcbcd06c2fdc5bffec62bc8cb9895e 100644 (file)
@@ -365,7 +365,8 @@ BASE_TEST_CS_SRC=           \
        large-gc-bitmap.cs      \
        bug-561239.cs   \
        bug-562150.cs   \
-       bug-575941.cs
+       bug-575941.cs   \
+       bug-599469.cs
 
 TEST_CS_SRC_DIST=      \
        $(BASE_TEST_CS_SRC)     \
diff --git a/mono/tests/bug-599469.cs b/mono/tests/bug-599469.cs
new file mode 100644 (file)
index 0000000..51c7c1f
--- /dev/null
@@ -0,0 +1,35 @@
+public class Grid<CT>
+        where CT : Grid<CT>.GPD.GC, new()
+{
+        public abstract class GPD
+        {
+                public GPD()
+                {
+                        ctInst = new CT();
+                }
+
+                public readonly CT ctInst;
+
+                public abstract class GC
+                {
+                }
+        }
+}
+
+public class H : Grid<H.MyCT>.GPD
+{
+        public class MyCT : GC
+        {
+                // When no explicit default constructor is present GMCS fails to compile the file.
+                // When it is present the execution crashes on mono.
+                public MyCT () {}
+        }
+}
+
+public class TheTest
+{
+        public static void Main (string[] args)
+        {
+                new H();
+        }
+}
\ No newline at end of file