Skip to content

Commit

Permalink
Fix handling generic custom attributes (#78304)
Browse files Browse the repository at this point in the history
Fixes #78200.

Co-authored-by: Michal Strehovský <MichalStrehovsky@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and MichalStrehovsky committed Nov 15, 2022
1 parent 16c42a4 commit 5d71b4c
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -120,7 +120,7 @@ internal sealed override IList<CustomAttributeTypedArgument> GetConstructorArgum
{
Handle typeHandle = ctorTypeHandles[index];
Exception? exception = null;
RuntimeTypeInfo? argumentType = typeHandle.TryResolve(_reader, new TypeContext(null, null), ref exception);
RuntimeTypeInfo? argumentType = typeHandle.TryResolve(_reader, AttributeType.CastToRuntimeTypeInfo().TypeContext, ref exception);
if (argumentType == null)
{
if (throwIfMissingMetadata)
Expand Down Expand Up @@ -162,7 +162,7 @@ internal sealed override IList<CustomAttributeNamedArgument> GetNamedArguments(b
bool isField = (namedArgument.Flags == NamedArgumentMemberKind.Field);

Exception? exception = null;
RuntimeTypeInfo? argumentType = namedArgument.Type.TryResolve(_reader, new TypeContext(null, null), ref exception);
RuntimeTypeInfo? argumentType = namedArgument.Type.TryResolve(_reader, AttributeType.CastToRuntimeTypeInfo().TypeContext, ref exception);
if (argumentType == null)
{
if (throwIfMissingMetadata)
Expand Down

0 comments on commit 5d71b4c

Please sign in to comment.