You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Custom attribute arguments which are System.Types don't get fixed up by MemberCloner.
How To Reproduce
For the metadata cloning test suite:
[TestCase(typeof(TypeArguments))]
public class TypeArguments
{
}
var clonedType = CloneType(typeof(TypeArguments), out _);
Assert.Equal(
((TypeDefOrRefSignature)clonedType.CustomAttributes[0].Signature.FixedArguments[0].Element).Type,
clonedType
);
Expected Behavior
The type argument of TestCaseAttribute should be equal to the cloned type.
Actual Behavior
The type argument of TestCaseAttribute still refers to the original type.
Additional Context
One detail is that right now attribute arguments which are types never get resolved into TypeDefinitions and always stay TypeReferences. This makes a potential fix more complicated because MemberCloner depends on the identity of definition objects.
The text was updated successfully, but these errors were encountered:
Thanks for the report. I finally got around to addressing this issue. A potential fix has been pushed to #493. If you could verify that this indeed solves your issue that would be great :)
AsmResolver Version
5.4.0
.NET Version
No response
Operating System
Windows
Describe the Bug
Custom attribute arguments which are
System.Type
s don't get fixed up byMemberCloner
.How To Reproduce
For the metadata cloning test suite:
Expected Behavior
The type argument of
TestCaseAttribute
should be equal to the cloned type.Actual Behavior
The type argument of
TestCaseAttribute
still refers to the original type.Additional Context
One detail is that right now attribute arguments which are types never get resolved into
TypeDefinition
s and always stayTypeReference
s. This makes a potential fix more complicated becauseMemberCloner
depends on the identity of definition objects.The text was updated successfully, but these errors were encountered: