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
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-09-03 21:16:00 +0300
committerGitHub <noreply@github.com>2021-09-03 21:16:00 +0300
commit0c979e6d769bda97bfba41c29324f727e72e27d8 (patch)
treeefa693b6711ccd7f5f5c26d8a089e34cbd8db36c
parent22074346900050843ace1d658cdb242f728a22fb (diff)
Ignore inherit param for ParameterInfo.GetCustomAttributes (#21201)mono-6.12.0.154
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. Co-authored-by: Bill Holmes <bill.holmes@unity3d.com>
-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)