}
}
+ [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
try {
mb.AddDeclarativeSecurity (action, set);
Fail ();
- }
- catch (ArgumentException) {
+ } catch (ArgumentOutOfRangeException) {
}
}
}