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

Only show public interfaces in generated syntax #7696

Merged
merged 4 commits into from
Nov 11, 2021
Merged

Conversation

dotMorten
Copy link
Contributor

@dotMorten dotMorten commented Nov 5, 2021

This addresses the issue with the generated syntax showing internal interfaces, as described in #3154
The changed method is only used to generate syntax, so should be safe. Since interfaces can only be public or internal, there's no need to check for any of the other accessibilities.

@KalleOlaviNiemitalo
Copy link

interfaces can only be public or internal

Not true

public class Outer
{
    private protected interface IPrivateProtected
    {
    }

    public class Inner : IPrivateProtected
    {
    }
}

@dotMorten
Copy link
Contributor Author

@KalleOlaviNiemitalo From what I can tell, the effect is the same though. We still don't want to doc that interface

@KalleOlaviNiemitalo
Copy link

You'd want to doc protected interfaces though. Does this PR handle those right?

@dotMorten
Copy link
Contributor Author

Does this PR handle those right?

It does now ;-)

@KalleOlaviNiemitalo
Copy link

How about this case:

internal class Outer
{
    public interface INested
    {
    }
}

public class Impl : Outer.INested
{
}

Here, I think you wouldn't want to mention Outer.INested in the docs, even though it is public itself.

@dotMorten
Copy link
Contributor Author

@KalleOlaviNiemitalo Ugh I'm starting to not like you very much :-) J/K

Fixed this case now.

@yufeih
Copy link
Contributor

yufeih commented Nov 10, 2021

Thanks @dotMorten for the fix and @KalleOlaviNiemitalo for the excellent code review!

@yufeih yufeih merged commit e641228 into dotnet:dev Nov 11, 2021
@dotMorten dotMorten deleted the patch-1 branch November 11, 2021 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants