Skip to content

Determine visibility of generated extension methods based on variant types #45

@mknejp

Description

@mknejp

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

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

namespace Foo
{
    internal class A { }

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

// generated code:
public static class VariantEx
{
  // CS0051 and CS0057: Inconsistent accessibility
  public static void Match(this Variant v, 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