Skip to content

MsgPack003 is not reported on generic typed members #1853

Description

@treziac

Bug description

The Analyzer does not detect properly missing attributes on generic types.

Repro steps

public class Foo<T>
{
    public T Member { get; set; }
}

[MessagePack.MessagePackObject]
public class Bar
{
    [MessagePack.Key(0)]
    public Foo<int> MemberUserGeneric { get; set; }

    [MessagePack.Key(1)]
    public System.Collections.Generic.List<int> MemberKnownGeneric { get; set; }
}

static void Test()
{
    MessagePackSerializer.Serialize(new Bar());
}

Expected behavior

The analyzer should detect an error and propose according changes.

Actual behavior

Analyzer does not detect any issue nor propose code change, issue is generated at runtime only as FormatterNotRegisteredException

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions