Author: kumpera
Date: 2007-10-05 10:03:38 -0400 (Fri, 05 Oct 2007)
New Revision: 86983

Added:
   trunk/mono/mono/tests/generic_type_definition_encoding.2.cs
Modified:
   trunk/mono/mono/tests/ChangeLog
   trunk/mono/mono/tests/Makefile.am
Log:
2007-10-05 Rodrigo Kumpera  <[EMAIL PROTECTED]>

        * generic_type_definition_encoding.2.cs: added, this tests
         the regression fixed in r86912.

        * Makefile.am: added generic_type_definition.2.cs



Modified: trunk/mono/mono/tests/ChangeLog
===================================================================
--- trunk/mono/mono/tests/ChangeLog     2007-10-05 13:54:01 UTC (rev 86982)
+++ trunk/mono/mono/tests/ChangeLog     2007-10-05 14:03:38 UTC (rev 86983)
@@ -1,3 +1,10 @@
+2007-10-05 Rodrigo Kumpera  <[EMAIL PROTECTED]>
+
+       * generic_type_definition_encoding.2.cs: added, this tests
+        the regression fixed in r86912.
+
+       * Makefile.am: added generic_type_definition.2.cs
+
 2007-09-27 Rodrigo Kumpera  <[EMAIL PROTECTED]>
 
        * generic_type_definition.2.cs: added

Modified: trunk/mono/mono/tests/Makefile.am
===================================================================
--- trunk/mono/mono/tests/Makefile.am   2007-10-05 13:54:01 UTC (rev 86982)
+++ trunk/mono/mono/tests/Makefile.am   2007-10-05 14:03:38 UTC (rev 86983)
@@ -300,6 +300,7 @@
        dynamic-method-access.2.cs      \
        bug-82194.2.cs  \
        anonarray.2.cs  \
+       generic_type_definition_encoding.2.cs \
        generic_type_definition.2.cs
 
 TEST_IL2_SRC = find-method.2.il        \

Added: trunk/mono/mono/tests/generic_type_definition_encoding.2.cs
===================================================================
--- trunk/mono/mono/tests/generic_type_definition_encoding.2.cs 2007-10-05 
13:54:01 UTC (rev 86982)
+++ trunk/mono/mono/tests/generic_type_definition_encoding.2.cs 2007-10-05 
14:03:38 UTC (rev 86983)
@@ -0,0 +1,65 @@
+using System.Collections.Generic;
+using System;
+
+class C<X,Y>
+{
+       class Q<A,B>
+       {
+               public  Type[] apply (C<X,Y> t)
+               {
+                       return t.bar<A,B>();
+               }
+       }
+
+       public  Type[] foo<A,B> ()
+       {
+               Q<A,B> q = new Q<A,B>();
+               return q.apply(this);
+       }
+
+       public Type[] bar<A,B> ()
+       {
+               return new Type[] { typeof(X), typeof(Y), typeof(A), typeof(B) 
};
+       }
+}
+
+
+class TypeofTest {
+       public bool Bla() {
+               Type t = typeof (Dictionary<,>);
+               Type t2 = typeof (C<,>);
+               return t.IsGenericTypeDefinition && t2.IsGenericTypeDefinition;
+       }       
+}
+
+class TypeofTest2<X,Y> {
+       public bool Bla() {
+               Type t = typeof (Dictionary<,>);
+               Type t2= typeof (C<,>);
+               return t.IsGenericTypeDefinition && t2.IsGenericTypeDefinition;
+       }       
+}
+
+class Driver {
+       public static int Main () {
+               C<int,string> c = new C<int,string>();
+               Type[] types = c.foo<float,string> ();
+               foreach (Type t in types)
+                       Console.WriteLine (t);
+               if (types [0] != typeof (int))
+                       return 1;
+               if (types [1] != typeof (string))
+                       return 2;
+               if (types [2] != typeof (float))
+                       return 3;
+               if (types [3] != typeof (string))
+                       return 4;
+
+               if (!new TypeofTest().Bla())
+                       return 5;
+               if (!new TypeofTest2<int, double>().Bla())
+                       return 6;
+
+               return 0;
+       }
+}

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to