+2009-07-28 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * GenericTypeParameterBuilder.cs: SetBaseTypeConstraint with
+ null argument is the same as passing typeof (object).
+
2009-07-28 Rodrigo Kumpera <rkumpera@novell.com>
* DerivedTypes.cs (ArrayType): Special case vector arrays using zero
public void SetBaseTypeConstraint (Type baseTypeConstraint)
{
- this.base_type = baseTypeConstraint;
+ this.base_type = baseTypeConstraint ?? typeof (object);
}
[ComVisible (true)]
+2009-07-28 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * GenericTypeParameterBuilderTest.cs: Test for BaseType
+ and SetBaseTypeConstraint.
+
2009-07-28 Rodrigo Kumpera <rkumpera@novell.com>
* DerivedTypesTests.cs: Add test for the distinction between
Assert.IsTrue (res.IsPointer, "#2");
}
+ [Test]
+ public void SetBaseTypeConstraintWithNull ()
+ {
+ TypeBuilder tb = module.DefineType ("dd.test", TypeAttributes.Public);
+ var gparam = tb.DefineGenericParameters ("A", "B")[1];
+
+ Assert.IsNull (gparam.BaseType, "#1");
+ gparam.SetBaseTypeConstraint (null);
+ Assert.AreEqual (typeof (object), gparam.BaseType, "#2");
+ }
[Test]
public void GenericTypeMembers ()