提交 e5f08146 编写于 作者: D David Poeschl

Assert that we have an IsParams parameter symbol when generating explicit array

上级 b81e6717
......@@ -799,6 +799,8 @@ protected override SyntaxNode AddNameToArgument(SyntaxNode newArgument, string n
protected override SyntaxNode CreateExplicitParamsArrayFromIndividualArguments(SeparatedSyntaxList<SyntaxNode> newArguments, int indexInExistingList, IParameterSymbol parameterSymbol)
{
RoslynDebug.Assert(parameterSymbol.IsParams);
// These arguments are part of a params array, and should not have any modifiers, making it okay to just use their expressions.
var listOfArguments = SeparatedList(newArguments.Skip(indexInExistingList).Select(a => ((ArgumentSyntax)a).Expression), newArguments.GetSeparators().Skip(indexInExistingList));
var initializerExpression = InitializerExpression(SyntaxKind.ArrayInitializerExpression, listOfArguments);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册