Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorBill Holmes <bill.holmes@unity3d.com>2021-10-21 23:44:36 +0300
committerGitHub <noreply@github.com>2021-10-21 23:44:36 +0300
commit2f8bc1b3d7025ce8486850604da060c7e3a8daf4 (patch)
tree6ac0fd27e2ae0dcd1352f7d63ad46d0138e2c62f /mcs
parentf747d09986808988a18d13903bdb11bae8610f43 (diff)
Ignore inherit param for ParameterInfo.GetCustomAttributes (#21200)
It is documented that the inherit flag is ignored. Attribute.GetCustomAttributes is to be used to search inheritance chain. This change is only for the Mono classlib implementation. CoreCLR already has this behavior.
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/corlib/System.Reflection/RuntimeParameterInfo.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/mcs/class/corlib/System.Reflection/RuntimeParameterInfo.cs b/mcs/class/corlib/System.Reflection/RuntimeParameterInfo.cs
index 0b49a1aff35..d57fbdecde9 100644
--- a/mcs/class/corlib/System.Reflection/RuntimeParameterInfo.cs
+++ b/mcs/class/corlib/System.Reflection/RuntimeParameterInfo.cs
@@ -192,14 +192,20 @@ namespace System.Reflection
override
object[] GetCustomAttributes (bool inherit)
{
- return MonoCustomAttrs.GetCustomAttributes (this, inherit);
+ // It is documented that the inherit flag is ignored.
+ // Attribute.GetCustomAttributes is to be used to search
+ // inheritance chain.
+ return MonoCustomAttrs.GetCustomAttributes (this, false);
}
public
override
object[] GetCustomAttributes (Type attributeType, bool inherit)
{
- return MonoCustomAttrs.GetCustomAttributes (this, attributeType, inherit);
+ // It is documented that the inherit flag is ignored.
+ // Attribute.GetCustomAttributes is to be used to search
+ // inheritance chain.
+ return MonoCustomAttrs.GetCustomAttributes (this, attributeType, false);
}
internal object GetDefaultValueImpl (ParameterInfo pinfo)