+2005-12-10 Zoltan Varga <vargaz@gmail.com>
+
+ * MethodBuilderTest.cs: Add test for handling not accessible custom
+ attributes.
+
2005-10-27 Zoltan Varga <vargaz@gmail.com>
* FieldBuilderTest.cs MethodBuilderTest.cs ConstructorBuilderTest.cs:
}
}
+ [AttributeUsage (AttributeTargets.Parameter)]
+ class PrivateAttribute : Attribute {
+
+ public PrivateAttribute () {
+ }
+ }
+
[Test]
public void GetCustomAttributes () {
TypeBuilder tb = module.DefineType (genTypeName (), TypeAttributes.Public);
mb.SetCustomAttribute (new CustomAttributeBuilder (ctorInfo, new object [] { "FOO" }));
+ // Check that attributes not accessible are not returned
+ mb.SetCustomAttribute (new CustomAttributeBuilder (typeof (PrivateAttribute).GetConstructor (new Type [0]), new object [] { }));
+
Type t = tb.CreateType ();
// Try the created type