Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Attributes with null argument fails to parse #224

Closed
JPaja opened this issue Nov 27, 2021 · 1 comment
Closed

Fixed Attributes with null argument fails to parse #224

JPaja opened this issue Nov 27, 2021 · 1 comment
Labels
bug dotnet Issues related to AsmResolver.DotNet
Milestone

Comments

@JPaja
Copy link
Contributor

JPaja commented Nov 27, 2021

Describe the bug

Custom attribute fails to parse when fixed argument is null

[AttributeUsage(AttributeTargets.All, AllowMultiple = true)]
public class TestCase2Attribute : Attribute
{
    public TestCase2Attribute(Type type)
    {
        Type = type;
    }

    public Type Type { get; set; }

}


[TestCase2(null)]
public void FixedTypeArgumentNull()
{
}

To Reproduce

var fixedMethod =.... //get MethodDefinition of FixedTypeArgumentNull
var customAttribute = fixedMethod.CustomAttributes[0];
var fixedArg = customAttribute.Signature.FixedArguments[0];
var element = fixedArg.Element;

Expected behavior

element to be null

Platform

  • OS: [Windows 10]
  • AsmResolver Version: [e.g. 4.8-dev]
@JPaja JPaja added the bug label Nov 27, 2021
@Washi1337 Washi1337 added the dotnet Issues related to AsmResolver.DotNet label Nov 28, 2021
@Washi1337
Copy link
Owner

Seems like a detail ECMA-335 forgot to mention. Should be fixed now.

@Washi1337 Washi1337 added this to the 4.8.0 milestone Nov 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dotnet Issues related to AsmResolver.DotNet
Projects
None yet
Development

No branches or pull requests

2 participants