提交 c0ea881d 编写于 作者: C CyrusNajmabadi

Don't crash in NavigateTo with methods that have __arglist parameters.

上级 2d22d1aa
......@@ -1095,5 +1095,23 @@ public void ToError()
VerifyNavigateToResultItem(item, "ToError", "ToError()", MatchKind.Regular, NavigateToItemKind.Method);
});
}
[WorkItem(18843, "https://github.com/dotnet/roslyn/issues/18843")]
[WpfFact, Trait(Traits.Feature, Traits.Features.NavigateTo)]
public async Task Test__arglist()
{
await TestAsync(
@"class C
{
public void ToError(__arglist)
{
}
}", async w =>
{
SetupVerifiableGlyph(StandardGlyphGroup.GlyphGroupMethod, StandardGlyphItem.GlyphItemPublic);
var item = (await _aggregator.GetItemsAsync("ToError")).Single();
VerifyNavigateToResultItem(item, "ToError", "[|ToError|](__arglist)", MatchKind.Exact, NavigateToItemKind.Method);
});
}
}
}
\ No newline at end of file
......@@ -1014,7 +1014,14 @@ private void AppendParameters(SeparatedSyntaxList<ParameterSyntax> parameters, S
builder.Append(' ');
}
AppendTokens(parameter.Type, builder);
if (parameter.Type != null)
{
AppendTokens(parameter.Type, builder);
}
else
{
builder.Append(parameter.Identifier.Text);
}
first = false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册