Skip to content

Determine visibility of generated interface based on variant types #43

@mknejp

Description

@mknejp

Currently all generated methods are public regardless of the visibility of the contained type.

Thus the following generates invalid code because the generated members have inconsistent accessibility:

internal class A { }

[Variant]
public class Variant
{
  static partial void VariantOf(A a);

  // generated code:
  // CS0051 and CS0057: Inconsistent accessibility
  public void Match(out A a) { ... }
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions