diff options
Diffstat (limited to 'src/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeGenericParameterTypeInfo.cs')
-rw-r--r-- | src/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeGenericParameterTypeInfo.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeGenericParameterTypeInfo.cs b/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeGenericParameterTypeInfo.cs index 678577135..f027f9caa 100644 --- a/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeGenericParameterTypeInfo.cs +++ b/src/System.Private.Reflection.Core/src/System/Reflection/Runtime/TypeInfos/NativeFormat/NativeFormatRuntimeGenericParameterTypeInfo.cs @@ -81,7 +81,11 @@ namespace System.Reflection.Runtime.TypeInfos.NativeFormat LowLevelList<QTypeDefRefOrSpec> constraints = new LowLevelList<QTypeDefRefOrSpec>(); foreach (Handle constraintHandle in _genericParameter.Constraints) { - constraints.Add(new QTypeDefRefOrSpec(reader, constraintHandle)); + // We're skipping custom modifiers here because Roslyn generates + // a modifier for the "unmanaged" constraint. This doesn't conform to the + // ECMA-335 spec, but we need to deal with it. The modifier is not visible + // to reflection. + constraints.Add(new QTypeDefRefOrSpec(reader, constraintHandle.SkipCustomModifiers(reader))); } return constraints.ToArray(); } |