Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix handling generic custom attributes
Fixes #78200.
  • Loading branch information
MichalStrehovsky authored and github-actions committed Nov 14, 2022
commit 3678f40de356b7c79355f1533408b89d24e8ba92
Original file line number Diff line number Diff line change
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