dotvariant
dotvariant copied to clipboard
Determine visibility of generated extension methods based on variant types
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) { ... }
}
This issue appears to be solved
Unfortunately not, adding the following to the test project still fails with hard errors in the generated code.
namespace Foo
{
internal class A { }
[dotVariant.Variant]
public partial class Variant
{
static partial void VariantOf(A a);
}
}