Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine visibility of generated interface based on variant types #43

Open
mknejp opened this issue Nov 26, 2021 · 0 comments
Open

Determine visibility of generated interface based on variant types #43

mknejp opened this issue Nov 26, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@mknejp
Copy link
Owner

mknejp commented Nov 26, 2021

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) { ... }
}
@mknejp mknejp added the bug Something isn't working label Nov 26, 2021
@mknejp mknejp self-assigned this Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant