提交 47b42a3e 编写于 作者: M Manish Vasani

Add arglist test and revert changes to BoundByRefArgumentWithCopyBack as it is...

Add arglist test and revert changes to BoundByRefArgumentWithCopyBack as it is never exposed in the operation tree
上级 1152ab73
......@@ -1584,6 +1584,8 @@ internal partial class BoundArgListOperator
{
protected override OperationKind ExpressionKind => OperationKind.None;
protected override ImmutableArray<IOperation> Children => Arguments.As<IOperation>();
public override void Accept(OperationVisitor visitor)
{
visitor.VisitNoneOperation(this);
......
......@@ -706,5 +706,32 @@ public I F(object x)
VerifyOperationTreeAndDiagnosticsForTest<ObjectCreationExpressionSyntax>(compilation1, expectedOperationTree, expectedDiagnostics);
}
[Fact, WorkItem(8884, "https://github.com/dotnet/roslyn/issues/8884")]
public void ParameterReference_ArgListOperator()
{
string source = @"
using System;
class C
{
static void Method(int x, bool y)
{
M(1, /*<bind>*/__arglist(x, y)/*</bind>*/);
}
static void M(int x, __arglist)
{
}
}
";
string expectedOperationTree = @"
IOperation: (OperationKind.None) (Syntax: '__arglist(x, y)')
Children(2): IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x')
IParameterReferenceExpression: y (OperationKind.ParameterReferenceExpression, Type: System.Boolean) (Syntax: 'y')
";
var expectedDiagnostics = DiagnosticDescription.None;
VerifyOperationTreeAndDiagnosticsForTest<InvocationExpressionSyntax>(source, expectedOperationTree, expectedDiagnostics);
}
}
}
\ No newline at end of file
......@@ -2426,12 +2426,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Return OperationKind.None
End Function
Protected Overrides ReadOnly Property Children As ImmutableArray(Of IOperation)
Get
Return ImmutableArray.Create(Of IOperation)(Me.OriginalArgument)
End Get
End Property
Public Overrides Sub Accept(visitor As OperationVisitor)
visitor.VisitNoneOperation(Me)
End Sub
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册