Skip to content

Commit

Permalink
Update BuildApiTest.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Nov 7, 2024
1 parent 86028d5 commit a205e38
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ApiBuilderTests/BuildApiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,14 @@ static void WriteSignature(MethodDeclarationSyntax method, StreamWriter writer)
static string BuildKey(MethodDeclarationSyntax method)
{
var parameters = string.Join(',', method.ParameterList.Parameters.Select(_ => _.Type!.ToString()));
var returnType = method.ReturnType.ToString();
var identifier = method.Identifier.Text;
if (method.TypeParameterList is null)
{
return $"{method.ReturnType.ToString()}{method.Identifier.Text}({parameters})";
return $"{returnType}{identifier}({parameters})";
}

return $"{method.ReturnType.ToString()}{method.Identifier.Text}<{string.Join(',', method.TypeParameterList.Parameters.Select(_ => _.Identifier.Text))}>({parameters})";
return $"{returnType}{identifier}<{string.Join(',', method.TypeParameterList.Parameters.Select(_ => _.Identifier.Text))}>({parameters})";
}

static string BuildTypeArgs(MethodDeclarationSyntax method)
Expand Down

0 comments on commit a205e38

Please sign in to comment.