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

Feature Request: Support "internal" as visibility #42

Open
anotherthomas opened this issue Mar 20, 2024 · 3 comments
Open

Feature Request: Support "internal" as visibility #42

anotherthomas opened this issue Mar 20, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@anotherthomas
Copy link

anotherthomas commented Mar 20, 2024

Generating interfaces is useful for internally used classes too, which are not part of the interface of a compilation unit.
I'd prefer using the same accessibility for the interface as used for the class. Is there any interest in that?

@ChristianSauer
Copy link
Collaborator

What is your idea? Do you want to decorate the interface OR members of the interface?
I.e. internal IFoo or internal string Baz {get; set;}?
I think the first is possible if I can manage #29 - otherwise it gets confusing really fast.
The latter would also require an Attribute on the Class Member itself, since all interface Members must be public, even if the Interface itself declares them at a different visibillity.

@ChristianSauer ChristianSauer added the enhancement New feature or request label Mar 20, 2024
@anotherthomas
Copy link
Author

anotherthomas commented Mar 20, 2024

I'd start with the actual access modifier for a class, so have internal class SomethingNeededInTheAssemblyOnly: ISomethingNeededInTheAssemblyOnly result in a internal interface ISomethingNeededInTheAssemblyOnly.
That would enable the interface separation between "public API" of an assembly and "internal implementation details."

I don't think clean API design and "split the interface of a public class into public and internal methods" goes well together, so that would be out of scope.

@anotherthomas
Copy link
Author

I've put together a PR to show what I mean: #43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants