Skip to content

Commit

Permalink
Consider interface method accessibility when generating the invoker (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alrz committed May 22, 2024
1 parent 63236c3 commit 71ea69e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Orleans.CodeGenerator/InvokableGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ public GeneratedInvokableDescription Generate(InvokableMethodDescription invokab

static Accessibility GetAccessibility(IMethodSymbol methodSymbol)
{
Accessibility accessibility = methodSymbol.DeclaredAccessibility;
var t = methodSymbol.ContainingType;
Accessibility accessibility = t.DeclaredAccessibility;
while (t is not null)
{
if ((int)t.DeclaredAccessibility < (int)accessibility)
Expand Down
15 changes: 15 additions & 0 deletions test/DefaultCluster.Tests/CodeGenTests/IRuntimeCodeGenGrain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,21 @@ public Task M(string arg)

// End regression test for https://github.com/dotnet/orleans/issues/8991

public interface IGrainWithNonPublicMethods : IGrainWithGuidKey
{
internal class P1;
internal Task M1(P1 arg);

//protected class P2;
//protected Task M2(P2 arg);

internal protected class P3;
internal protected Task M3(P3 arg);

//private protected class P4;
//private protected Task M4(P4 arg);
}

public interface IGrainWithGenericMethods : IGrainWithGuidKey
{
Task<Type[]> GetTypesExplicit<T, U, V>();
Expand Down

0 comments on commit 71ea69e

Please sign in to comment.