Skip to content

Commit 5d71b4c

Browse files
Fix handling generic custom attributes (#78304)
Fixes #78200. Co-authored-by: Michal Strehovský <[email protected]>
1 parent 16c42a4 commit 5d71b4c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/coreclr/nativeaot/System.Private.CoreLib/src/System/Reflection/Runtime/CustomAttributes/NativeFormat/NativeFormatCustomAttributeData.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ internal sealed override IList<CustomAttributeTypedArgument> GetConstructorArgum
120120
{
121121
Handle typeHandle = ctorTypeHandles[index];
122122
Exception? exception = null;
123-
RuntimeTypeInfo? argumentType = typeHandle.TryResolve(_reader, new TypeContext(null, null), ref exception);
123+
RuntimeTypeInfo? argumentType = typeHandle.TryResolve(_reader, AttributeType.CastToRuntimeTypeInfo().TypeContext, ref exception);
124124
if (argumentType == null)
125125
{
126126
if (throwIfMissingMetadata)
@@ -162,7 +162,7 @@ internal sealed override IList<CustomAttributeNamedArgument> GetNamedArguments(b
162162
bool isField = (namedArgument.Flags == NamedArgumentMemberKind.Field);
163163

164164
Exception? exception = null;
165-
RuntimeTypeInfo? argumentType = namedArgument.Type.TryResolve(_reader, new TypeContext(null, null), ref exception);
165+
RuntimeTypeInfo? argumentType = namedArgument.Type.TryResolve(_reader, AttributeType.CastToRuntimeTypeInfo().TypeContext, ref exception);
166166
if (argumentType == null)
167167
{
168168
if (throwIfMissingMetadata)

0 commit comments

Comments
 (0)