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

Ensure that the hub client proxy generator correctly processes both explicit and inferred generic type arguments #55862

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,7 @@ private static bool IsExtensionClassSignatureValid(ClassDeclarationSyntax syntax
return true;
}

internal static bool IsSyntaxTargetForGeneration(SyntaxNode node) => node is MemberAccessExpressionSyntax
{
Name: GenericNameSyntax
{
Arity: 1
}
};
internal static bool IsSyntaxTargetForGeneration(SyntaxNode node) => node is MemberAccessExpressionSyntax{ Name: SimpleNameSyntax };

internal static MemberAccessExpressionSyntax? GetSemanticTargetForGeneration(GeneratorSyntaxContext context)
{
Expand Down Expand Up @@ -251,10 +245,11 @@ internal SourceGenerationSpec Parse(ImmutableArray<MethodDeclarationSyntax> meth
var argModel = _compilation.GetSemanticModel(argType.SyntaxTree);
symbol = (ITypeSymbol)argModel.GetSymbolInfo(argType).Symbol;
}
else if (memberAccess.Name is not GenericNameSyntax
&& memberAccess.Parent.ChildNodes().FirstOrDefault(x => x is ArgumentListSyntax) is
ArgumentListSyntax
{ Arguments: { Count: 1 } } als)
else if (memberAccess.Name is SimpleNameSyntax
&& memberAccess.Parent.ChildNodes().FirstOrDefault(x => x is ArgumentListSyntax) is
ArgumentListSyntax
{ Arguments: { Count: 1 } } als)

MattyLeslie marked this conversation as resolved.
Show resolved Hide resolved
{
// Method isn't using generic syntax so inspect first expression in arguments to deduce the type
var argModel = _compilation.GetSemanticModel(als.Arguments[0].Expression.SyntaxTree);
Expand Down
Loading