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

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/System.Private.CoreLib/src/System')
-rw-r--r--src/System.Private.CoreLib/src/System/Reflection/CustomAttributeNamedArgument.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/System.Private.CoreLib/src/System/Reflection/CustomAttributeNamedArgument.cs b/src/System.Private.CoreLib/src/System/Reflection/CustomAttributeNamedArgument.cs
index 8139d50cb..d3aaca10b 100644
--- a/src/System.Private.CoreLib/src/System/Reflection/CustomAttributeNamedArgument.cs
+++ b/src/System.Private.CoreLib/src/System/Reflection/CustomAttributeNamedArgument.cs
@@ -39,6 +39,13 @@ namespace System.Reflection
_lazyMemberInfo = memberInfo;
_attributeType = memberInfo.DeclaringType;
+#if MONO
+ // Mono runtime "create_cattr_named_arg" method passes value wrapped into CustomAttributeTypedArgument object
+ // but CoreFX expects just value.
+ if (value is CustomAttributeTypedArgument typedArument)
+ TypedValue = typedArument;
+ else
+#endif
TypedValue = new CustomAttributeTypedArgument(type, value);
IsField = field != null;
MemberName = memberInfo.Name;