提交 984372db 编写于 作者: G Gen Lu

Change ArgumentKind enum

Combine Positional and Named to Explicit
上级 aec80d76
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Concurrent;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.Semantics;
using Roslyn.Utilities;
using Microsoft.CodeAnalysis.CSharp.Symbols;
using Microsoft.CodeAnalysis.Collections;
using System.Collections.Concurrent;
namespace Microsoft.CodeAnalysis.CSharp
{
......@@ -155,7 +154,7 @@ private static IArgument DeriveArgument(int parameterIndex, int argumentIndex, I
if (refMode != RefKind.None)
{
return new Argument(ArgumentKind.Positional, parameter, argument);
return new Argument(ArgumentKind.Explicit, parameter, argument);
}
if (argumentIndex >= parameters.Length - 1 &&
......@@ -170,7 +169,7 @@ private static IArgument DeriveArgument(int parameterIndex, int argumentIndex, I
}
else
{
return new Argument(ArgumentKind.Positional, parameter, argument);
return new Argument(ArgumentKind.Explicit, parameter, argument);
}
}
......@@ -192,7 +191,7 @@ private static IArgument DeriveArgument(int parameterIndex, int argumentIndex, I
return new Argument(ArgumentKind.ParamArray, parameter, CreateParamArray(parameter, argument));
}
return new Argument(ArgumentKind.Named, parameter, argument);
return new Argument(ArgumentKind.Explicit, parameter, argument);
});
}
......
......@@ -26,9 +26,9 @@ static void M1()
";
string expectedOperationTree = @"
IInvocationExpression (static void P.M2(System.Int32 x, System.Double y)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(1, 2.0)')
Arguments(2): IArgument (ArgumentKind.Positional Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1')
IArgument (ArgumentKind.Positional Matching Parameter: y) (OperationKind.Argument) (Syntax: '2.0')
IArgument (ArgumentKind.Explicit Matching Parameter: y) (OperationKind.Argument) (Syntax: '2.0')
ILiteralExpression (OperationKind.LiteralExpression, Type: System.Double, Constant: 2) (Syntax: '2.0')
";
var expectedDiagnostics = DiagnosticDescription.None;
......@@ -52,7 +52,7 @@ static void M1()
";
string expectedOperationTree = @"
IInvocationExpression (static void P.M2(System.Int32 x, [System.Double y = 0])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(1)')
Arguments(2): IArgument (ArgumentKind.Positional Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1')
IArgument (ArgumentKind.DefaultValue Matching Parameter: y) (OperationKind.Argument) (Syntax: 'M2(1)')
ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Double, Constant: 0) (Syntax: 'M2(1)')
......@@ -78,9 +78,9 @@ static void M1()
";
string expectedOperationTree = @"
IInvocationExpression (static void P.M2(System.Int32 x, [System.Double y = 0])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(x: 1, y: 9.9)')
Arguments(2): IArgument (ArgumentKind.Named Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1')
IArgument (ArgumentKind.Named Matching Parameter: y) (OperationKind.Argument) (Syntax: '9.9')
IArgument (ArgumentKind.Explicit Matching Parameter: y) (OperationKind.Argument) (Syntax: '9.9')
ILiteralExpression (Text: 9.9) (OperationKind.LiteralExpression, Type: System.Double, Constant: 9.9) (Syntax: '9.9')
";
var expectedDiagnostics = DiagnosticDescription.None;
......@@ -105,9 +105,9 @@ static void M1()
";
string expectedOperationTree = @"
IInvocationExpression (static void P.M2(System.Int32 x, [System.Double y = 0])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(y: 9.9, x: 1)')
Arguments(2): IArgument (ArgumentKind.Named Matching Parameter: y) (OperationKind.Argument) (Syntax: '9.9')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: y) (OperationKind.Argument) (Syntax: '9.9')
ILiteralExpression (Text: 9.9) (OperationKind.LiteralExpression, Type: System.Double, Constant: 9.9) (Syntax: '9.9')
IArgument (ArgumentKind.Named Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1')
";
var expectedDiagnostics = DiagnosticDescription.None;
......@@ -131,7 +131,7 @@ static void M1()
";
string expectedOperationTree = @"
IInvocationExpression (static void P.M2([System.Int32 x = 1], [System.Double y = 0])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(y: 9.9)')
Arguments(2): IArgument (ArgumentKind.Named Matching Parameter: y) (OperationKind.Argument) (Syntax: '9.9')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: y) (OperationKind.Argument) (Syntax: '9.9')
ILiteralExpression (Text: 9.9) (OperationKind.LiteralExpression, Type: System.Double, Constant: 9.9) (Syntax: '9.9')
IArgument (ArgumentKind.DefaultValue Matching Parameter: x) (OperationKind.Argument) (Syntax: 'M2(y: 9.9)')
ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'M2(y: 9.9)')
......@@ -157,9 +157,9 @@ static void M1()
";
string expectedOperationTree = @"
IInvocationExpression (static void P.M2([System.Int32 x = 1], [System.Int32 y = 2], [System.Int32 z = 3])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(1, z: 10)')
Arguments(3): IArgument (ArgumentKind.Positional Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
Arguments(3): IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1')
IArgument (ArgumentKind.Named Matching Parameter: z) (OperationKind.Argument) (Syntax: '10')
IArgument (ArgumentKind.Explicit Matching Parameter: z) (OperationKind.Argument) (Syntax: '10')
ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10')
IArgument (ArgumentKind.DefaultValue Matching Parameter: y) (OperationKind.Argument) (Syntax: 'M2(1, z: 10)')
ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'M2(1, z: 10)')
......@@ -188,9 +188,9 @@ void M1()
string expectedOperationTree = @"
IInvocationExpression ( void P.M2(ref System.Int32 x, out System.Int32 y)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(ref a, out b)')
Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2')
Arguments(2): IArgument (ArgumentKind.Positional Matching Parameter: x) (OperationKind.Argument) (Syntax: 'a')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: 'a')
ILocalReferenceExpression: a (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'a')
IArgument (ArgumentKind.Positional Matching Parameter: y) (OperationKind.Argument) (Syntax: 'b')
IArgument (ArgumentKind.Explicit Matching Parameter: y) (OperationKind.Argument) (Syntax: 'b')
ILocalReferenceExpression: b (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'b')
";
var expectedDiagnostics = DiagnosticDescription.None;
......@@ -217,9 +217,9 @@ void M1()
string expectedOperationTree = @"
IInvocationExpression ( void P.M2(ref System.Int32 x, out System.Int32 y)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(y: out b, x: ref a)')
Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2')
Arguments(2): IArgument (ArgumentKind.Named Matching Parameter: y) (OperationKind.Argument) (Syntax: 'b')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: y) (OperationKind.Argument) (Syntax: 'b')
ILocalReferenceExpression: b (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'b')
IArgument (ArgumentKind.Named Matching Parameter: x) (OperationKind.Argument) (Syntax: 'a')
IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: 'a')
ILocalReferenceExpression: a (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'a')
";
var expectedDiagnostics = DiagnosticDescription.None;
......@@ -244,7 +244,7 @@ void M1()
string expectedOperationTree = @"
IInvocationExpression ( void P.M2(System.String str, params System.Int32[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(null)')
Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2')
Arguments(2): IArgument (ArgumentKind.Positional Matching Parameter: str) (OperationKind.Argument) (Syntax: 'null')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: str) (OperationKind.Argument) (Syntax: 'null')
IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null')
ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null')
IArgument (ArgumentKind.ParamArray Matching Parameter: array) (OperationKind.Argument) (Syntax: 'M2(null)')
......@@ -274,7 +274,7 @@ void M1()
string expectedOperationTree = @"
IInvocationExpression ( void P.M2(System.String str, params System.Int32[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(null, 1, 2)')
Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2')
Arguments(2): IArgument (ArgumentKind.Positional Matching Parameter: str) (OperationKind.Argument) (Syntax: 'null')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: str) (OperationKind.Argument) (Syntax: 'null')
IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null')
ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null')
IArgument (ArgumentKind.ParamArray Matching Parameter: array) (OperationKind.Argument) (Syntax: '1')
......@@ -306,10 +306,10 @@ void M1()
string expectedOperationTree = @"
IInvocationExpression ( void P.M2(System.String str, params System.Int32[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(null, new[] { 1, 2 })')
Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2')
Arguments(2): IArgument (ArgumentKind.Positional Matching Parameter: str) (OperationKind.Argument) (Syntax: 'null')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: str) (OperationKind.Argument) (Syntax: 'null')
IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null')
ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null')
IArgument (ArgumentKind.Positional Matching Parameter: array) (OperationKind.Argument) (Syntax: 'new[] { 1, 2 }')
IArgument (ArgumentKind.Explicit Matching Parameter: array) (OperationKind.Argument) (Syntax: 'new[] { 1, 2 }')
IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32[]) (Syntax: 'new[] { 1, 2 }')
Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'new[] { 1, 2 }')
Initializer: IArrayInitializer (OperationKind.ArrayInitializer) (Syntax: '{ 1, 2 }')
......@@ -343,7 +343,7 @@ void M1()
Dimension Sizes(1): ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: null, Constant: 1) (Syntax: '1')
Initializer: IArrayInitializer (OperationKind.ArrayInitializer) (Syntax: '1')
Element Values(1): ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1')
IArgument (ArgumentKind.Named Matching Parameter: str) (OperationKind.Argument) (Syntax: 'null')
IArgument (ArgumentKind.Explicit Matching Parameter: str) (OperationKind.Argument) (Syntax: 'null')
IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null')
ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null')
";
......@@ -369,13 +369,13 @@ void M1()
string expectedOperationTree = @"
IInvocationExpression ( void P.M2(System.String str, params System.Int32[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(array: n ... str: null)')
Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2')
Arguments(2): IArgument (ArgumentKind.Named Matching Parameter: array) (OperationKind.Argument) (Syntax: 'new[] { 1, 2 }')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: array) (OperationKind.Argument) (Syntax: 'new[] { 1, 2 }')
IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32[]) (Syntax: 'new[] { 1, 2 }')
Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'new[] { 1, 2 }')
Initializer: IArrayInitializer (OperationKind.ArrayInitializer) (Syntax: '{ 1, 2 }')
Element Values(2): ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1')
ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2')
IArgument (ArgumentKind.Named Matching Parameter: str) (OperationKind.Argument) (Syntax: 'null')
IArgument (ArgumentKind.Explicit Matching Parameter: str) (OperationKind.Argument) (Syntax: 'null')
IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.String, Constant: null) (Syntax: 'null')
ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null')
";
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
namespace Microsoft.CodeAnalysis.Semantics
{
/// <summary>
......@@ -12,21 +10,20 @@ public enum ArgumentKind
None = 0x0,
/// <summary>
/// Argument is specified positionally and matches the parameter of the same ordinality.
/// </summary>
Positional = 0x1,
/// <summary>
/// Argument is specified by name and matches the parameter of the same name.
/// Argument value is explicitly supplied.
/// </summary>
Named = 0x2,
Explicit = 0x1,
/// <summary>
/// Argument becomes an element of an array that matches a trailing C# params or VB ParamArray parameter.
/// Argument is a param array created by compilers for the matching C# params or VB ParamArray parameter.
/// Note, the value is a an array creation expression that encapsulates all the elements, if any.
/// </summary>
ParamArray = 0x3,
ParamArray = 0x2,
/// <summary>
/// Argument was omitted in source but has a default value supplied automatically.
/// Argument is a default value supplied automatically by the compilers.
/// </summary>
DefaultValue = 0x4
DefaultValue = 0x3
}
}
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.Collections.Immutable;
namespace Microsoft.CodeAnalysis.Semantics
{
/// <summary>
......
*REMOVED*Microsoft.CodeAnalysis.Semantics.ArgumentKind.DefaultValue = 4 -> Microsoft.CodeAnalysis.Semantics.ArgumentKind
*REMOVED*Microsoft.CodeAnalysis.Semantics.ArgumentKind.Named = 2 -> Microsoft.CodeAnalysis.Semantics.ArgumentKind
*REMOVED*Microsoft.CodeAnalysis.Semantics.ArgumentKind.ParamArray = 3 -> Microsoft.CodeAnalysis.Semantics.ArgumentKind
*REMOVED*Microsoft.CodeAnalysis.Semantics.ArgumentKind.Positional = 1 -> Microsoft.CodeAnalysis.Semantics.ArgumentKind
*REMOVED*Microsoft.CodeAnalysis.Semantics.IHasArgumentsExpression.ArgumentsInParameterOrder.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Semantics.IArgument>
*REMOVED*Microsoft.CodeAnalysis.Semantics.IHasArgumentsExpression.GetArgumentMatchingParameter(Microsoft.CodeAnalysis.IParameterSymbol parameter) -> Microsoft.CodeAnalysis.Semantics.IArgument
*REMOVED*Microsoft.CodeAnalysis.Semantics.IInvocationExpression.ArgumentsInSourceOrder.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Semantics.IArgument>
......@@ -8,6 +12,9 @@ Microsoft.CodeAnalysis.CommandLineReference.CommandLineReference(string referenc
Microsoft.CodeAnalysis.CommandLineSourceFile.CommandLineSourceFile(string path, bool isScript) -> void
Microsoft.CodeAnalysis.ParseOptions.Errors.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Diagnostic>
Microsoft.CodeAnalysis.ParseOptions.SpecifiedKind.get -> Microsoft.CodeAnalysis.SourceCodeKind
Microsoft.CodeAnalysis.Semantics.ArgumentKind.DefaultValue = 3 -> Microsoft.CodeAnalysis.Semantics.ArgumentKind
Microsoft.CodeAnalysis.Semantics.ArgumentKind.Explicit = 1 -> Microsoft.CodeAnalysis.Semantics.ArgumentKind
Microsoft.CodeAnalysis.Semantics.ArgumentKind.ParamArray = 2 -> Microsoft.CodeAnalysis.Semantics.ArgumentKind
Microsoft.CodeAnalysis.Semantics.IHasArgumentsExpression.ArgumentsInEvaluationOrder.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.Semantics.IArgument>
Microsoft.CodeAnalysis.Semantics.IInvalidExpression.Children.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>
Microsoft.CodeAnalysis.Semantics.IInvalidStatement.Children.get -> System.Collections.Immutable.ImmutableArray<Microsoft.CodeAnalysis.IOperation>
......
......@@ -355,14 +355,24 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
argument,
Function(argumentValue) New ByRefArgument(If(CUInt(index) < CUInt(parameters.Length), parameters(index), Nothing), DirectCast(argumentValue, BoundByRefArgumentWithCopyBack)))
Case Else
' Apparently the VB bound trees don't encode named arguments, which seems unnecesarily lossy.
Return s_argumentMappings.GetValue(
argument,
Function(argumentValue)
If index >= parameters.Length - 1 AndAlso parameters.Length > 0 AndAlso parameters(parameters.Length - 1).IsParamArray Then
Return New Argument(ArgumentKind.ParamArray, parameters(parameters.Length - 1), argumentValue)
Dim lastParameterIndex = parameters.Length - 1
If index >= lastParameterIndex AndAlso parameters.Length > 0 AndAlso parameters(lastParameterIndex).IsParamArray Then
' TODO: figure out if this is true:
' a compiler generated argument for a ParamArray parameter is created iff
' a list of arguments (including 0 argument) is provided for ParamArray parameter in source
Dim kind = If(argument.WasCompilerGenerated, ArgumentKind.ParamArray, ArgumentKind.Explicit)
Debug.Assert(argument.Type.TypeKind = TypeKind.Array)
Return New Argument(kind, parameters(lastParameterIndex), argumentValue)
Else
Return New Argument(ArgumentKind.Positional, If(CUInt(index) < CUInt(parameters.Length), parameters(index), Nothing), argumentValue)
' TODO: figure our if this is true:
' a compiler generated argument for an Optional parameter is created iff
' the argument is omitted from the source
Dim kind = If(argument.WasCompilerGenerated, ArgumentKind.DefaultValue, ArgumentKind.Explicit)
Dim parameter = If(CUInt(index) < CUInt(parameters.Length), parameters(index), Nothing)
Return New Argument(kind, parameter, argumentValue)
End If
End Function)
End Select
......@@ -476,8 +486,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic
Public Overrides ReadOnly Property ArgumentKind As ArgumentKind
Get
' Do the VB bound trees encode named arguments?
Return ArgumentKind.Positional
Return ArgumentKind.Explicit
End Get
End Property
......
......@@ -23,9 +23,9 @@ End Class]]>.Value
Dim expectedOperationTree = <![CDATA[
IInvocationExpression ( Sub P.M2(x As System.Int32, y As System.Double)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(1, 2.0)')
Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2')
Arguments(2): IArgument (ArgumentKind.Positional Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1')
IArgument (ArgumentKind.Positional Matching Parameter: y) (OperationKind.Argument) (Syntax: '2.0')
IArgument (ArgumentKind.Explicit Matching Parameter: y) (OperationKind.Argument) (Syntax: '2.0')
ILiteralExpression (OperationKind.LiteralExpression, Type: System.Double, Constant: 2) (Syntax: '2.0')
]]>.Value
......@@ -49,10 +49,10 @@ End Class]]>.Value
Dim expectedOperationTree = <![CDATA[
IInvocationExpression ( Sub P.M2(x As System.Int32, y As System.Double)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(y:=1, x:=2.0)')
Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2')
Arguments(2): IArgument (ArgumentKind.Positional Matching Parameter: x) (OperationKind.Argument) (Syntax: '2.0')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: '2.0')
IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Int32, Constant: 2) (Syntax: '2.0')
ILiteralExpression (OperationKind.LiteralExpression, Type: System.Double, Constant: 2) (Syntax: '2.0')
IArgument (ArgumentKind.Positional Matching Parameter: y) (OperationKind.Argument) (Syntax: '1')
IArgument (ArgumentKind.Explicit Matching Parameter: y) (OperationKind.Argument) (Syntax: '1')
IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Double, Constant: 1) (Syntax: '1')
ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1')
]]>.Value
......@@ -77,9 +77,9 @@ End Class]]>.Value
Dim expectedOperationTree = <![CDATA[
IInvocationExpression ( Sub P.M2([x As System.Int32 = 0], [y As System.Int32 = 0])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(y:=2)')
Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2')
Arguments(2): IArgument (ArgumentKind.Positional Matching Parameter: x) (OperationKind.Argument) (Syntax: 'M2')
Arguments(2): IArgument (ArgumentKind.DefaultValue Matching Parameter: x) (OperationKind.Argument) (Syntax: 'M2')
ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: 'M2')
IArgument (ArgumentKind.Positional Matching Parameter: y) (OperationKind.Argument) (Syntax: '2')
IArgument (ArgumentKind.Explicit Matching Parameter: y) (OperationKind.Argument) (Syntax: '2')
ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2')
]]>.Value
......@@ -103,9 +103,9 @@ End Class]]>.Value
Dim expectedOperationTree = <![CDATA[
IInvocationExpression ( Sub P.M2(x As System.Int32, [y As System.Double = 0])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(1)')
Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2')
Arguments(2): IArgument (ArgumentKind.Positional Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1')
IArgument (ArgumentKind.Positional Matching Parameter: y) (OperationKind.Argument) (Syntax: 'M2')
IArgument (ArgumentKind.DefaultValue Matching Parameter: y) (OperationKind.Argument) (Syntax: 'M2')
ILiteralExpression (OperationKind.LiteralExpression, Type: System.Double, Constant: 0) (Syntax: 'M2')
]]>.Value
......@@ -129,7 +129,7 @@ End Class]]>.Value
Dim expectedOperationTree = <![CDATA[
IInvocationExpression ( Sub P.M2(x As System.Int32, ParamArray array As System.Int32())) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(1, 2, 3)')
Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2')
Arguments(2): IArgument (ArgumentKind.Positional Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1')
IArgument (ArgumentKind.ParamArray Matching Parameter: array) (OperationKind.Argument) (Syntax: 'M2(1, 2, 3)')
IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'M2(1, 2, 3)')
......@@ -159,9 +159,9 @@ End Class]]>.Value
Dim expectedOperationTree = <![CDATA[
IInvocationExpression ( Sub P.M2(x As System.Int32, ParamArray array As System.Int32())) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(1, New I ... r() {2, 3})')
Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2')
Arguments(2): IArgument (ArgumentKind.Positional Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: '1')
ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1')
IArgument (ArgumentKind.ParamArray Matching Parameter: array) (OperationKind.Argument) (Syntax: 'New Integer() {2, 3}')
IArgument (ArgumentKind.Explicit Matching Parameter: array) (OperationKind.Argument) (Syntax: 'New Integer() {2, 3}')
IArrayCreationExpression (Element Type: System.Int32) (OperationKind.ArrayCreationExpression, Type: System.Int32()) (Syntax: 'New Integer() {2, 3}')
Dimension Sizes(1): ILiteralExpression (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'New Integer() {2, 3}')
Initializer: IArrayInitializer (OperationKind.ArrayInitializer) (Syntax: '{2, 3}')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册