Signed-off-by: Gleb Golubitsky <sectoid@gnolltech.org>
{
if (position > 0) {
Type t = methodb.GetParameterType (position - 1);
- if (defaultValue != null && t != defaultValue.GetType ())
+ if (defaultValue != null && t != defaultValue.GetType ()) {
if(!t.IsEnum || t.UnderlyingSystemType != defaultValue.GetType ())
throw new ArgumentException ("Constant does not match the defined type.");
+ }
if (t.IsValueType && !t.IsPrimitive && !t.IsEnum && t != typeof (DateTime))
throw new ArgumentException ("" + t + " is not a supported constant type.");
}
/// A test fixture for System.Reflection.Emit.ParameterBuilder class
/// </summary>
[TestFixture]
- public class AssemblyBuilderAccessTest
+ public class ParameterBuilderTest
{
[Test]
/// <summary>