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

Consider interface method accessibility when generating the invoker #9019

Merged
merged 1 commit into from
May 22, 2024

Conversation

alrz
Copy link
Member

@alrz alrz commented May 22, 2024

Fixes #8973 (partially)

Microsoft Reviewers: Open in CodeFlow

Comment on lines +41 to +42
//protected class P2;
//protected Task M2(P2 arg);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR does not fix codegen for protected members.

For those I think we should change the body to "throw unreachable" and skip the invoker completely..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense. Good idea

@@ -92,8 +92,8 @@ public GeneratedInvokableDescription Generate(InvokableMethodDescription invokab

static Accessibility GetAccessibility(IMethodSymbol methodSymbol)
{
Accessibility accessibility = methodSymbol.DeclaredAccessibility;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the type is internal and the method is public, what will the value of DeclaredAccessibilty be?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's gonna be public, which will be downgraded to internal after the loop below.

@ReubenBond ReubenBond merged commit 71ea69e into dotnet:main May 22, 2024
18 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Exclude inaccessible interface methods from codegen
2 participants