diff options
Diffstat (limited to 'src/System.Private.CoreLib/src/System')
-rw-r--r-- | src/System.Private.CoreLib/src/System/Reflection/CustomAttributeNamedArgument.cs | 7 |
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; |