// Tests for byref types
Type paramType = typeof (TypeTest).GetMethod ("ByrefMethod", BindingFlags.Instance|BindingFlags.NonPublic).GetParameters () [0].ParameterType;
- Assert.IsTrue (!paramType.IsSubclassOf (typeof (ValueType)), "#02");
- //Assert.IsTrue (paramType.IsSubclassOf (typeof (Object)), "#03");
- Assert.IsTrue (!paramType.IsSubclassOf (paramType), "#04");
+ Assert.IsFalse (paramType.IsSubclassOf (typeof(ValueType)), "#02");
+ Assert.IsNull (paramType.BaseType, "#02-b");
+ Assert.IsTrue (paramType.IsSubclassOf (typeof (Object)), "#03");
+ Assert.IsFalse (paramType.IsSubclassOf (paramType), "#04");
}
[Test]
obj = GetType ().GetMember ("DummyMember", memtype,
BindingFlags.Public | BindingFlags.Instance);
Assert.AreEqual (testtype.GetHashCode (), obj.GetType ().GetHashCode (),
- "Expected " + testtype.FullName);
+ "Expected #" + i + " " + testtype.FullName);
}
}
ICALL_EXPORT MonoReflectionType*
ves_icall_get_type_parent (MonoReflectionType *type)
{
+ if (type->type->byref)
+ return NULL;
+
MonoClass *class = mono_class_from_mono_type (type->type);
return class->parent ? mono_type_get_object (mono_object_domain (type), &class->parent->byval_arg): NULL;
}