Browse Source

2008-08-31 Zoltan Varga <[email protected]>

	* TypeBuilderTest.cs: Add a test for IsAssignableFrom and generic instances
	of dynamic types.

svn path=/trunk/mcs/; revision=111982
Zoltan Varga 17 years ago
parent
commit
7f1ea4fafd

+ 5 - 0
mcs/class/corlib/Test/System.Reflection.Emit/ChangeLog

@@ -1,3 +1,8 @@
+2008-08-31  Zoltan Varga  <[email protected]>
+
+	* TypeBuilderTest.cs: Add a test for IsAssignableFrom and generic instances
+	of dynamic types.
+
 2008-08-14  Raja R Harinath  <[email protected]>
 
 	* TypeBuilderTest.cs (DefineCtorUsingDefineMethod): Use a

+ 13 - 0
mcs/class/corlib/Test/System.Reflection.Emit/TypeBuilderTest.cs

@@ -9083,6 +9083,19 @@ namespace MonoTests.System.Reflection.Emit
 				tb3.FullName + "[]")), "#R2");
 			Assert.IsFalse (typeof (Baz []).IsAssignableFrom (module.GetType (
 				tb3.FullName + "[]")), "#R3");
+
+#if NET_2_0
+			TypeBuilder tb4 = module.DefineType (genTypeName (),
+				TypeAttributes.Public, null,
+				new Type [] { typeof (IWater) });
+			tb4.DefineGenericParameters ("T");
+
+			Type inst = tb4.MakeGenericType (typeof (int));
+			Type emitted_type4 = tb4.CreateType ();
+			Assert.IsFalse (typeof (IComparable).IsAssignableFrom (inst));
+			// This returns True if CreateType () is called _before_ MakeGenericType...
+			//Assert.IsFalse (typeof (IWater).IsAssignableFrom (inst));
+#endif
 		}
 
 		[Test]