Skip to content

MessagePack.Analyzers / MsgPack004 not working for records #1924

@N-Olbert

Description

@N-Olbert

Bug description

When a type is a record instead of a class or a struct, the analyzers seem not to work and raise no diagnostics.

Repro steps

    [MessagePackObject]
    public class Foo
    {
        public int Bar { get; init; }
    }
    
    [MessagePackObject]
    public struct FooStruct
    {
        public int Bar { get; init; }
    }

    [MessagePackObject]
    public record FooReord
    {
        public int Bar { get; init; }
    }

Expected behavior

MsgPack004 for FooRecord.Bar.

Actual behavior

No diagnostic for FooRecord.Bar.

image

  • Version used: 2.5.172
  • Runtime: .NET 8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions