提交 250908e4 编写于 作者: C CyrusNajmabadi

Merge remote-tracking branch 'upstream/master' into indexComputation2

......@@ -3884,22 +3884,11 @@ private static bool CanReuseParameter(CSharp.Syntax.ParameterSyntax parameter)
this.ParseAttributeDeclarations(attributes);
this.ParseParameterModifiers(modifiers);
var hasArgList = this.CurrentToken.Kind == SyntaxKind.ArgListKeyword;
TypeSyntax type = null;
if (!hasArgList)
{
type = this.ParseType(mode: ParseTypeMode.Parameter);
}
else if (this.IsPossibleType())
TypeSyntax type;
SyntaxToken name;
if (this.CurrentToken.Kind != SyntaxKind.ArgListKeyword)
{
type = this.ParseType(mode: ParseTypeMode.Parameter);
type = WithAdditionalDiagnostics(type, this.GetExpectedTokenError(SyntaxKind.CloseParenToken, SyntaxKind.IdentifierToken, 0, type.Width));
}
SyntaxToken name = null;
if (!hasArgList)
{
name = this.ParseIdentifierToken();
// When the user type "int foo[]", give them a useful error
......@@ -3911,19 +3900,11 @@ private static bool CanReuseParameter(CSharp.Syntax.ParameterSyntax parameter)
name = AddTrailingSkippedSyntax(name, SyntaxList.List(open, close));
}
}
else if (this.IsPossibleName())
{
// Current token is an identifier token, we expected a CloseParenToken.
// Get the expected token error for the missing token with correct diagnostic
// span and then parse the identifier token.
SyntaxDiagnosticInfo diag = this.GetExpectedTokenError(SyntaxKind.CloseParenToken, SyntaxKind.IdentifierToken);
name = this.ParseIdentifierToken();
name = WithAdditionalDiagnostics(name, diag);
}
else
{
// name is not optional on ParameterSyntax
// We store an __arglist parameter as a parameter with null type and whose
// .Identifier has the kind ArgListKeyword.
type = null;
name = this.EatToken(SyntaxKind.ArgListKeyword);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册