Nested `private` custom formatters result in CS0122: inaccessible from source generated resolver · Issue #1817 · MessagePack-CSharp/MessagePack-CSharp · GitHub
Skip to content

Nested private custom formatters result in CS0122: inaccessible from source generated resolver #1817

Description

@AArnott

Given code like this:

class A {
   private class JTokenFormatter : IMessagePackFormatter<JToken?> { /* ... */ }
}

The source generated resolver will try to access that formatter, and cannot due to visibility rules. The compilation breaks with a CS0122 error.

We should skip private formatters, and possibly report a warning diagnostic.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions