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

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions