diff --git a/build/Rulesets/Roslyn_BuildRules.ruleset b/build/Rulesets/Roslyn_BuildRules.ruleset index cdd2d050c7ccdcdb63191cc6d937f0964d087f1b..c2da92b629f266430f0cb3cb2f6cdf54f10aa027 100644 --- a/build/Rulesets/Roslyn_BuildRules.ruleset +++ b/build/Rulesets/Roslyn_BuildRules.ruleset @@ -81,7 +81,7 @@ - + @@ -89,7 +89,7 @@ - + @@ -97,7 +97,7 @@ - + diff --git a/src/Compilers/CSharp/Portable/BoundTree/Expression.cs b/src/Compilers/CSharp/Portable/BoundTree/Expression.cs index 47f0d51a9218611026c7e21509e212e56df7bb33..deb9fe047a4c43ac0818b853403ca2b93e81cd4b 100644 --- a/src/Compilers/CSharp/Portable/BoundTree/Expression.cs +++ b/src/Compilers/CSharp/Portable/BoundTree/Expression.cs @@ -1,13 +1,13 @@ // 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.Concurrent; +using System; 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; namespace Microsoft.CodeAnalysis.CSharp { @@ -63,8 +63,8 @@ internal partial class BoundCall : IInvocationExpression (this.Method.IsVirtual || this.Method.IsAbstract || this.Method.IsOverride) && !this.ReceiverOpt.SuppressVirtualCalls; - ImmutableArray IHasArgumentsExpression.ArgumentsInEvaluationOrder - => DeriveArgumentsInEvaluationOrder(this.Arguments, this.ArgumentNamesOpt, this.ArgsToParamsOpt, this.ArgumentRefKindsOpt, this.Method.Parameters, this.Syntax); + ImmutableArray IHasArgumentsExpression.ArgumentsInEvaluationOrder + => DeriveArguments(this.Arguments, this.ArgumentNamesOpt, this.ArgsToParamsOpt, this.ArgumentRefKindsOpt, this.Method.Parameters, this.Syntax); protected override OperationKind ExpressionKind => OperationKind.InvocationExpression; @@ -78,83 +78,56 @@ public override void Accept(OperationVisitor visitor) return visitor.VisitInvocationExpression(this, argument); } - internal static ImmutableArray DeriveArgumentsInEvaluationOrder(ImmutableArray boundArguments, ImmutableArray argumentNames, ImmutableArray argumentsToParameters, ImmutableArray argumentRefKinds, ImmutableArray parameters, SyntaxNode invocationSyntax) + internal static ImmutableArray DeriveArguments(ImmutableArray boundArguments, ImmutableArray argumentNamesOpt, ImmutableArray argumentsToParametersOpt, ImmutableArray argumentRefKindsOpt, ImmutableArray parameters, SyntaxNode invocationSyntax) { - PooledHashSet matchedParameters = PooledHashSet.GetInstance(); - ArrayBuilder evaluationOrderArguments = ArrayBuilder.GetInstance(parameters.Length); + ArrayBuilder sourceOrderArguments = ArrayBuilder.GetInstance(boundArguments.Length); for (int argumentIndex = 0; argumentIndex < boundArguments.Length; argumentIndex++) { - int parameterIndex = argumentsToParameters.IsDefault ? argumentIndex : argumentsToParameters[argumentIndex]; - IArgument argument = DeriveArgument(parameterIndex, argumentIndex, boundArguments, argumentNames, argumentRefKinds, parameters, invocationSyntax); - evaluationOrderArguments.Add(argument); - matchedParameters.Add(parameterIndex); - // If the current argument matches a params parameter and is unnamed, following explicit arguments are treated as part of the params arrray. - if ((uint)parameterIndex < parameters.Length && parameters[parameterIndex].IsParams && (argumentNames.IsDefaultOrEmpty || argumentNames[argumentIndex] == null)) + IArgument argument = DeriveArgument(argumentsToParametersOpt.IsDefault ? argumentIndex : argumentsToParametersOpt[argumentIndex], argumentIndex, boundArguments, argumentNamesOpt, argumentRefKindsOpt, parameters, invocationSyntax); + sourceOrderArguments.Add(argument); + if (argument.ArgumentKind == ArgumentKind.ParamArray) { break; } } - // Include implicit arguments after the explicit arguments. - foreach (Symbols.ParameterSymbol parameter in parameters) - { - if (!matchedParameters.Contains(parameter.Ordinal)) - { - evaluationOrderArguments.Add(DeriveArgument(parameter.Ordinal, -1, boundArguments, argumentNames, argumentRefKinds, parameters, invocationSyntax)); - } - } - matchedParameters.Free(); - return evaluationOrderArguments.ToImmutableAndFree(); - } + return sourceOrderArguments.ToImmutableAndFree(); + } private static readonly ConditionalWeakTable s_argumentMappings = new ConditionalWeakTable(); - private static readonly ConditionalWeakTable> s_omittedArgumentMappings = new ConditionalWeakTable>(); - private static IArgument DeriveArgument(int parameterIndex, int argumentIndex, ImmutableArray boundArguments, ImmutableArray argumentNames, ImmutableArray argumentRefKinds, ImmutableArray parameters, SyntaxNode invocationSyntax) + private static IArgument DeriveArgument(int parameterIndex, int argumentIndex, ImmutableArray boundArguments, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, ImmutableArray parameters, SyntaxNode invocationSyntax) { if ((uint)argumentIndex >= (uint)boundArguments.Length) { - ConcurrentDictionary omittedArguments = s_omittedArgumentMappings.GetValue(invocationSyntax, syntax => new ConcurrentDictionary()); - - return omittedArguments.GetOrAdd( - parameters[parameterIndex], - (parameter) => + // Check for an omitted argument that becomes an empty params array. + if (parameters.Length > 0) + { + Symbols.ParameterSymbol lastParameter = parameters[parameters.Length - 1]; + if (lastParameter.IsParams) { - // No argument has been supplied for the parameter at `parameterIndex`: - // 1. `argumentIndex == -1' when the arguments are specified out of parameter order, and no argument is provided for the parameter corresponding to `parameters[parameterIndex]`. - // 2. `argumentIndex >= boundArguments.Length` when the arguments are specified in parameter order, and no argument is provided at `parameterIndex`. - - // Check for a parameter with a default value. - if (parameter.HasExplicitDefaultValue) - { - return new Argument(ArgumentKind.DefaultValue, parameter, new LiteralExpression(parameter.ExplicitDefaultConstantValue, parameter.Type, invocationSyntax)); - } - - // Check for an omitted argument that becomes an empty params array. - if (parameter.IsParams) - { - return new Argument(ArgumentKind.ParamArray, parameter, CreateParamArray(parameter, boundArguments, argumentIndex, invocationSyntax)); - } + return new Argument(ArgumentKind.ParamArray, lastParameter, CreateParamArray(lastParameter, boundArguments, argumentIndex, invocationSyntax)); + } + } - // There is no supplied argument and there is no params parameter. Any action is suspect at this point. - return new Argument(ArgumentKind.DefaultValue, parameter, new InvalidExpression(invocationSyntax)); - }); + // There is no supplied argument and there is no params parameter. Any action is suspect at this point. + return new SimpleArgument(null, new InvalidExpression(invocationSyntax, ImmutableArray.Empty)); } return s_argumentMappings.GetValue( boundArguments[argumentIndex], (argument) => { - string name = !argumentNames.IsDefaultOrEmpty ? argumentNames[argumentIndex] : null; - Symbols.ParameterSymbol parameter = (uint)parameterIndex < (uint)parameters.Length ? parameters[parameterIndex] : null; + string nameOpt = !argumentNamesOpt.IsDefaultOrEmpty ? argumentNamesOpt[argumentIndex] : null; + Symbols.ParameterSymbol parameterOpt = (uint)parameterIndex < (uint)parameters.Length ? parameters[parameterIndex] : null; - if ((object)name == null) + if ((object)nameOpt == null) { - RefKind refMode = argumentRefKinds.IsDefaultOrEmpty ? RefKind.None : argumentRefKinds[argumentIndex]; + RefKind refMode = argumentRefKindsOpt.IsDefaultOrEmpty ? RefKind.None : argumentRefKindsOpt[argumentIndex]; if (refMode != RefKind.None) { - return new Argument(ArgumentKind.Explicit, parameter, argument); + return new Argument(ArgumentKind.Explicit, parameterOpt, argument); } if (argumentIndex >= parameters.Length - 1 && @@ -162,36 +135,19 @@ private static IArgument DeriveArgument(int parameterIndex, int argumentIndex, I parameters[parameters.Length - 1].IsParams && // An argument that is an array of the appropriate type is not a params argument. (boundArguments.Length > argumentIndex + 1 || - argument.Type.TypeKind != TypeKind.Array || - !argument.Type.Equals(parameters[parameters.Length - 1].Type, TypeCompareKind.IgnoreCustomModifiersAndArraySizesAndLowerBounds))) + ((object)argument.Type != null && // If argument type is null, we are in an error scenario and cannot tell if it is a param array, or not. + (argument.Type.TypeKind != TypeKind.Array || + !argument.Type.Equals(parameters[parameters.Length - 1].Type, TypeCompareKind.IgnoreCustomModifiersAndArraySizesAndLowerBounds))))) { return new Argument(ArgumentKind.ParamArray, parameters[parameters.Length - 1], CreateParamArray(parameters[parameters.Length - 1], boundArguments, argumentIndex, invocationSyntax)); } else { - return new Argument(ArgumentKind.Explicit, parameter, argument); + return new SimpleArgument(parameterOpt, argument); } } - // A named argument which is also the only argument for a params parameter - // is a IArgument of ArgumentKind.ParamArray. e.g. - // - // static void M1(string[] args) - // { - // M2(array: 1, str: ""); - // } - // static void M2(string str, params int[] array) { } - - if (parameter?.IsParams == true && - // An argument that is an array of the appropriate type is not a params argument. - (argument.Type.TypeKind != TypeKind.Array || - !argument.Type.Equals(parameter.Type, TypeCompareKind.IgnoreCustomModifiersAndArraySizesAndLowerBounds))) - { - Debug.Assert(parameterIndex == parameters.Length - 1); - return new Argument(ArgumentKind.ParamArray, parameter, CreateParamArray(parameter, argument)); - } - - return new Argument(ArgumentKind.Explicit, parameter, argument); + return new Argument(ArgumentKind.Explicit, parameterOpt, argument); }); } @@ -200,23 +156,15 @@ private static IOperation CreateParamArray(IParameterSymbol parameter, Immutable if (parameter.Type.TypeKind == TypeKind.Array) { IArrayTypeSymbol arrayType = (IArrayTypeSymbol)parameter.Type; - ImmutableArray paramArrayArguments; - - // If there are no matching arguments, then the argument index is negative. - if (firstArgumentElementIndex >= 0) + ArrayBuilder builder = ArrayBuilder.GetInstance(boundArguments.Length - firstArgumentElementIndex); + for (int index = firstArgumentElementIndex; index < boundArguments.Length; index++) { - ArrayBuilder builder = ArrayBuilder.GetInstance(boundArguments.Length - firstArgumentElementIndex); - for (int index = firstArgumentElementIndex; index < boundArguments.Length; index++) - { - builder.Add(boundArguments[index]); - } - paramArrayArguments = builder.ToImmutableAndFree(); - } - else - { - paramArrayArguments = ImmutableArray.Empty; + builder.Add(boundArguments[index]); } + var paramArrayArguments = builder.ToImmutableAndFree(); + + // Use the invocation syntax node if there is no actual syntax available for the argument (because the paramarray is empty.) return new ArrayCreationExpression(arrayType, paramArrayArguments, paramArrayArguments.Length > 0 ? paramArrayArguments[0].Syntax : invocationSyntax); } @@ -224,34 +172,43 @@ private static IOperation CreateParamArray(IParameterSymbol parameter, Immutable return new InvalidExpression(invocationSyntax, ImmutableArray.Empty); } - private static IOperation CreateParamArray(IParameterSymbol parameter, BoundExpression boundArgument) + internal static IArgument ArgumentMatchingParameter(ImmutableArray arguments, ImmutableArray argumentsToParametersOpt, ImmutableArray argumentNamesOpt, ImmutableArray argumentRefKindsOpt, ISymbol targetMethod, ImmutableArray parameters, IParameterSymbol parameter, SyntaxNode invocationSyntax) { - var Syntax = boundArgument.Syntax; - if (parameter.Type.TypeKind == TypeKind.Array) + int argumentIndex = ArgumentIndexMatchingParameter(argumentsToParametersOpt, targetMethod, parameter); + if (argumentIndex >= 0) { - IArrayTypeSymbol arrayType = (IArrayTypeSymbol)parameter.Type; - ImmutableArray paramArrayArguments = ImmutableArray.Create(boundArgument); + return DeriveArgument(parameter.Ordinal, argumentIndex, arguments, argumentNamesOpt, argumentRefKindsOpt, parameters, invocationSyntax); + } - Debug.Assert(boundArgument.Syntax != null); - return new ArrayCreationExpression(arrayType, paramArrayArguments, Syntax); + return null; + } + + private static int ArgumentIndexMatchingParameter(ImmutableArray argumentsToParametersOpt, ISymbol targetMethod, IParameterSymbol parameter) + { + if (parameter.ContainingSymbol == targetMethod) + { + int parameterIndex = parameter.Ordinal; + if (!argumentsToParametersOpt.IsDefaultOrEmpty) + { + return argumentsToParametersOpt.IndexOf(parameterIndex); + } + + return parameterIndex; } - return new InvalidExpression(Syntax); + return -1; } - private class Argument : IArgument + private abstract class ArgumentBase : IArgument { - public Argument(ArgumentKind kind, IParameterSymbol parameter, IOperation value) + public ArgumentBase(IParameterSymbol parameter, IOperation value) { Debug.Assert(value != null); - this.ArgumentKind = kind; this.Value = value; this.Parameter = parameter; } - public ArgumentKind ArgumentKind { get; } - public IParameterSymbol Parameter { get; } public IOperation Value { get; } @@ -270,6 +227,8 @@ public Argument(ArgumentKind kind, IParameterSymbol parameter, IOperation value) public Optional ConstantValue => default(Optional); + public abstract ArgumentKind ArgumentKind { get; } + void IOperation.Accept(OperationVisitor visitor) { visitor.VisitArgument(this); @@ -280,6 +239,26 @@ void IOperation.Accept(OperationVisitor visitor) return visitor.VisitArgument(this, argument); } } + + private sealed class SimpleArgument : ArgumentBase + { + public SimpleArgument(IParameterSymbol parameter, IOperation value) + : base(parameter, value) + { } + + public override ArgumentKind ArgumentKind => ArgumentKind.Explicit; + } + + private sealed class Argument : ArgumentBase + { + public Argument(ArgumentKind kind, IParameterSymbol parameter, IOperation value) + : base(parameter, value) + { + this.ArgumentKind = kind; + } + + public override ArgumentKind ArgumentKind { get; } + } } internal partial class BoundLocal : ILocalReferenceExpression @@ -349,8 +328,7 @@ internal partial class BoundIndexerAccess : IIndexedPropertyReferenceExpression ISymbol IMemberReferenceExpression.Member => this.Indexer; - ImmutableArray IHasArgumentsExpression.ArgumentsInEvaluationOrder - => BoundCall.DeriveArgumentsInEvaluationOrder(this.Arguments, this.ArgumentNamesOpt, this.ArgsToParamsOpt, this.ArgumentRefKindsOpt, this.Indexer.Parameters, this.Syntax); + ImmutableArray IHasArgumentsExpression.ArgumentsInEvaluationOrder => BoundCall.DeriveArguments(this.Arguments, this.ArgumentNamesOpt, this.ArgsToParamsOpt, this.ArgumentRefKindsOpt, this.Indexer.Parameters, this.Syntax); protected override OperationKind ExpressionKind => OperationKind.IndexedPropertyReferenceExpression; @@ -506,8 +484,7 @@ internal partial class BoundObjectCreationExpression : IObjectCreationExpression IMethodSymbol IObjectCreationExpression.Constructor => this.Constructor; - ImmutableArray IHasArgumentsExpression.ArgumentsInEvaluationOrder - => BoundCall.DeriveArgumentsInEvaluationOrder(this.Arguments, this.ArgumentNamesOpt, this.ArgsToParamsOpt, this.ArgumentRefKindsOpt, this.Constructor.Parameters, this.Syntax); + ImmutableArray IHasArgumentsExpression.ArgumentsInEvaluationOrder => BoundCall.DeriveArguments(this.Arguments, this.ArgumentNamesOpt, this.ArgsToParamsOpt, this.ArgumentRefKindsOpt, this.Constructor.Parameters, this.Syntax); ImmutableArray IObjectCreationExpression.MemberInitializers { @@ -1909,7 +1886,7 @@ public override void Accept(OperationVisitor visitor) return visitor.VisitNoneOperation(this, argument); } } - + internal partial class BoundSourceDocumentIndex { protected override OperationKind ExpressionKind => OperationKind.None; diff --git a/src/Compilers/CSharp/Test/Semantic/Diagnostics/OperationAnalyzerTests.cs b/src/Compilers/CSharp/Test/Semantic/Diagnostics/OperationAnalyzerTests.cs index 2a0fba4e289076db013185637da80ea5fd91527c..68664fd6013fe5df44a38899db9167abc2f6b9e5 100644 --- a/src/Compilers/CSharp/Test/Semantic/Diagnostics/OperationAnalyzerTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Diagnostics/OperationAnalyzerTests.cs @@ -280,7 +280,7 @@ public void M1(int x, int y) Diagnostic(SwitchTestAnalyzer.NoDefaultSwitchDescriptor.Id, "y").WithLocation(40, 17)); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void InvocationCSharp() { const string source = @" @@ -753,7 +753,7 @@ interface IDerived : IMiddle, IBase2 ); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void ValueContextsCSharp() { const string source = @" @@ -1167,7 +1167,7 @@ private void Mumbler(object sender, System.EventArgs args) ); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void ParamsArraysCSharp() { const string source = @" @@ -1627,7 +1627,7 @@ static void Main() } [WorkItem(8520, "https://github.com/dotnet/roslyn/issues/8520")] - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void NullOperationSyntaxCSharp() { const string source = @" @@ -1724,9 +1724,8 @@ public void Increment(string f) Diagnostic(InvalidOperatorExpressionTestAnalyzer.InvalidUnaryDescriptor.Id, "-f").WithLocation(11, 16), Diagnostic(InvalidOperatorExpressionTestAnalyzer.InvalidIncrementDescriptor.Id, "f++").WithLocation(16, 9)); } - - [WorkItem(9114, "https://github.com/dotnet/roslyn/issues/9114")] - [Fact] + + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549"), WorkItem(9114, "https://github.com/dotnet/roslyn/issues/9114")] public void InvalidArgumentCSharp() { const string source = @" @@ -1815,7 +1814,7 @@ public void M0(C p) } [WorkItem(9116, "https://github.com/dotnet/roslyn/issues/9116")] - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void LiteralCSharp() { const string source = @" diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests.cs index ce4186a7c8882fb8eccf5d7003937c6903e743a6..7af58ddc4a2a4980b0d0550138298efe84b34454 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests.cs @@ -45,15 +45,15 @@ static void Test2(int y, params int[] x) compilation.VerifyOperationTree(nodes[0], expectedOperationTree: @"IInvocationExpression (static void Cls.Test1(params System.Int32[] x)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Test1(null)') - Arguments(1): IArgument (Matching Parameter: x) (OperationKind.Argument) (Syntax: 'null') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'null') IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Int32[], Constant: null) (Syntax: 'null') ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null')"); compilation.VerifyOperationTree(nodes[1], expectedOperationTree: @"IInvocationExpression (static void Cls.Test2(System.Int32 y, params System.Int32[] x)) (OperationKind.InvocationExpression, Type: System.Void, IsInvalid) (Syntax: 'Test2(new o ... ct(), null)') - Arguments(2): IArgument (Matching Parameter: y) (OperationKind.Argument) (Syntax: 'new object()') + Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: y) (OperationKind.Argument) (Syntax: 'new object()') IObjectCreationExpression (Constructor: System.Object..ctor()) (OperationKind.ObjectCreationExpression, Type: System.Object) (Syntax: 'new object()') - IArgument (Matching Parameter: x) (OperationKind.Argument) (Syntax: 'null') + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'null') ILiteralExpression (Text: null) (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'null')"); } diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IArgument.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IArgument.cs index b7f4e67d142bbac4b667513ce69155ff508dfc29..9e5b9f6a13c0b30733ca3d4cb4e0f4320a80dc62 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IArgument.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IArgument.cs @@ -1,9 +1,7 @@ // 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 Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.CodeAnalysis.CSharp.Test.Utilities; using Microsoft.CodeAnalysis.Test.Utilities; -using Roslyn.Test.Utilities; using Xunit; namespace Microsoft.CodeAnalysis.CSharp.UnitTests @@ -26,9 +24,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.Explicit 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.Explicit 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; @@ -36,7 +34,7 @@ static void M1() VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void PositionalArgumentWithDefaultValue() { string source = @" @@ -52,15 +50,15 @@ 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.Explicit 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)') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: y) (OperationKind.Argument) (Syntax: 'M2(1)') ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Double, Constant: 0) (Syntax: 'M2(1)') "; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); - } + } [Fact] public void NamedArgumentListedInParameterOrder() @@ -78,9 +76,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.Explicit 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.Explicit 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 +103,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.Explicit 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.Explicit 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; @@ -115,7 +113,7 @@ static void M1() VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void NamedArgumentInParameterOrderWithDefaultValue() { string source = @" @@ -131,11 +129,11 @@ 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(y: 0, z: 2)') - Arguments(3): IArgument (ArgumentKind.Explicit Matching Parameter: y) (OperationKind.Argument) (Syntax: '0') + Arguments(3): IArgument (ArgumentKind.Explicit, Matching Parameter: y) (OperationKind.Argument) (Syntax: '0') ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: '0') - IArgument (ArgumentKind.Explicit Matching Parameter: z) (OperationKind.Argument) (Syntax: '2') + IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: '2') ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - IArgument (ArgumentKind.DefaultValue Matching Parameter: x) (OperationKind.Argument) (Syntax: 'M2(y: 0, z: 2)') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'M2(y: 0, z: 2)') ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: 'M2(y: 0, z: 2)') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -143,7 +141,7 @@ static void M1() VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void NamedArgumentOutOfParameterOrderWithDefaultValue() { string source = @" @@ -159,11 +157,11 @@ 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(z: 2, x: 9)') - Arguments(3): IArgument (ArgumentKind.Explicit Matching Parameter: z) (OperationKind.Argument) (Syntax: '2') + Arguments(3): IArgument (ArgumentKind.Explicit, Matching Parameter: z) (OperationKind.Argument) (Syntax: '2') ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') - IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: '9') + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: '9') ILiteralExpression (Text: 9) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 9) (Syntax: '9') - IArgument (ArgumentKind.DefaultValue Matching Parameter: y) (OperationKind.Argument) (Syntax: 'M2(z: 2, x: 9)') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: y) (OperationKind.Argument) (Syntax: 'M2(z: 2, x: 9)') ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'M2(z: 2, x: 9)') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -171,7 +169,7 @@ static void M1() VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void NamedAndPositionalArgumentsWithDefaultValue() { string source = @" @@ -188,11 +186,11 @@ static void M1() string expectedOperationTree = @" IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'M2(9, z: 10);') IInvocationExpression (static void P.M2([System.Int32 x = 1], [System.Int32 y = 2], [System.Int32 z = 3])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(9, z: 10)') - Arguments(3): IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: '9') + Arguments(3): IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: '9') ILiteralExpression (Text: 9) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 9) (Syntax: '9') - IArgument (ArgumentKind.Explicit 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(9, z: 10)') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: y) (OperationKind.Argument) (Syntax: 'M2(9, z: 10)') ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: 'M2(9, z: 10)') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -219,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(ref a, out b)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') - Arguments(2): IArgument (ArgumentKind.Explicit 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.Explicit 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; @@ -248,9 +246,9 @@ void M1() string expectedOperationTree = @" IInvocationExpression ( void P.M2(ref System.Int32 x, out System.Int32 y)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(x: ref a, y: out b)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') - Arguments(2): IArgument (ArgumentKind.Explicit 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.Explicit 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; @@ -258,9 +256,7 @@ void M1() VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } - - - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void NamedRefAndOutArgumentsOutOfParameterOrder() { string source = @" @@ -276,20 +272,13 @@ void M1() void M2(ref int x, out int y) { y = 10; } } "; - 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.Explicit Matching Parameter: y) (OperationKind.Argument) (Syntax: 'b') - ILocalReferenceExpression: b (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'b') - IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: 'a') - ILocalReferenceExpression: a (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'a') -"; + string expectedOperationTree = @""; var expectedDiagnostics = DiagnosticDescription.None; VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void DefaultValueOfNewStruct() { string source = @" @@ -297,19 +286,66 @@ class P { void M1() { - M2(); + /**/M2()/**/; } void M2(S sobj = new S()) { } } -/**/struct S { }/**/ +struct S { } +"; + string expectedOperationTree = @""; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] + public void DefaultValueOfDefaultStruct() + { + string source = @" +class P +{ + void M1() + { + /**/M2()/**/; + } + + void M2(S sobj = default(S)) { } +} + +struct S { } +"; + string expectedOperationTree = @""; + var expectedDiagnostics = DiagnosticDescription.None; + + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + } + + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] + public void DefaultValueOfConstant() + { + string source = @" +class P +{ + const double Pi = 3.14; + void M1() + { + /**/M2()/**/; + } + + void M2(double s = Pi) { } +} "; string expectedOperationTree = @" +IInvocationExpression ( void P.M2([System.Double s = 3.14])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2()') + Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') + Arguments(1): IArgument (ArgumentKind.DefaultValue, Matching Parameter: s) (OperationKind.Argument) (Syntax: 'M2()') + ILiteralExpression (Text: 3.14) (OperationKind.LiteralExpression, Type: System.Double, Constant: 3.14) (Syntax: 'M2()') "; var expectedDiagnostics = DiagnosticDescription.None; - VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); + VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } [Fact] @@ -332,11 +368,11 @@ public static void E1(this P p, int x = 0, int y = 0) "; string expectedOperationTree = @" IInvocationExpression (static void Extensions.E1(this P p, [System.Int32 x = 0], [System.Int32 y = 0])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'this.E1(1, 2)') - Arguments(3): IArgument (ArgumentKind.Explicit Matching Parameter: p) (OperationKind.Argument) (Syntax: 'this') + Arguments(3): IArgument (ArgumentKind.Explicit, Matching Parameter: p) (OperationKind.Argument) (Syntax: 'this') IInstanceReferenceExpression (InstanceReferenceKind.Explicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'this') - IArgument (ArgumentKind.Explicit 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') - IArgument (ArgumentKind.Explicit 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') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -365,11 +401,11 @@ public static void E1(this P p, int x = 0, int y = 0) string expectedOperationTree = @" IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'this.E1(y: 1, x: 2);') IInvocationExpression (static void Extensions.E1(this P p, [System.Int32 x = 0], [System.Int32 y = 0])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'this.E1(y: 1, x: 2)') - Arguments(3): IArgument (ArgumentKind.Explicit Matching Parameter: p) (OperationKind.Argument) (Syntax: 'this') + Arguments(3): IArgument (ArgumentKind.Explicit, Matching Parameter: p) (OperationKind.Argument) (Syntax: 'this') IInstanceReferenceExpression (InstanceReferenceKind.Explicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'this') - IArgument (ArgumentKind.Explicit Matching Parameter: y) (OperationKind.Argument) (Syntax: '1') + IArgument (ArgumentKind.Explicit, Matching Parameter: y) (OperationKind.Argument) (Syntax: '1') ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: '2') + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: '2') ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -377,7 +413,7 @@ public static void E1(this P p, int x = 0, int y = 0) VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void NamedArgumentWithDefaultValueForExtensionMethod() { string source = @" @@ -397,11 +433,11 @@ public static void E1(this P p, int x = 0, int y = 0) "; string expectedOperationTree = @" IInvocationExpression (static void Extensions.E1(this P p, [System.Int32 x = 0], [System.Int32 y = 0])) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'this.E1(y: 1)') - Arguments(3): IArgument (ArgumentKind.Explicit Matching Parameter: p) (OperationKind.Argument) (Syntax: 'this') + Arguments(3): IArgument (ArgumentKind.Explicit, Matching Parameter: p) (OperationKind.Argument) (Syntax: 'this') IInstanceReferenceExpression (InstanceReferenceKind.Explicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'this') - IArgument (ArgumentKind.Explicit Matching Parameter: y) (OperationKind.Argument) (Syntax: '1') + IArgument (ArgumentKind.Explicit, Matching Parameter: y) (OperationKind.Argument) (Syntax: '1') ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - IArgument (ArgumentKind.DefaultValue Matching Parameter: x) (OperationKind.Argument) (Syntax: 'this.E1(y: 1)') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'this.E1(y: 1)') ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: 'this.E1(y: 1)') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -427,9 +463,9 @@ void M1() string expectedOperationTree = @" IInvocationExpression ( void P.M2(System.Int32 x, params System.Double[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(1, a)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') - Arguments(2): IArgument (ArgumentKind.Explicit 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.Explicit Matching Parameter: array) (OperationKind.Argument) (Syntax: 'a') + IArgument (ArgumentKind.Explicit, Matching Parameter: array) (OperationKind.Argument) (Syntax: 'a') ILocalReferenceExpression: a (OperationKind.LocalReferenceExpression, Type: System.Double[]) (Syntax: 'a') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -454,12 +490,12 @@ void M1() string expectedOperationTree = @" IInvocationExpression ( void P.M2(System.Int32 x, params System.Double[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(1, 0.1, 0.2)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') - Arguments(2): IArgument (ArgumentKind.Explicit 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: '0.1') + IArgument (ArgumentKind.ParamArray, Matching Parameter: array) (OperationKind.Argument) (Syntax: '0.1') IArrayCreationExpression (Element Type: System.Double) (OperationKind.ArrayCreationExpression, Type: System.Double[]) (Syntax: '0.1') Dimension Sizes(1): ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: null, Constant: 2) (Syntax: '0.1') - Initializer: IArrayInitializer (OperationKind.ArrayInitializer) (Syntax: '0.1') + Initializer: IArrayInitializer (2 elements) (OperationKind.ArrayInitializer) (Syntax: '0.1') Element Values(2): ILiteralExpression (Text: 0.1) (OperationKind.LiteralExpression, Type: System.Double, Constant: 0.1) (Syntax: '0.1') ILiteralExpression (Text: 0.2) (OperationKind.LiteralExpression, Type: System.Double, Constant: 0.2) (Syntax: '0.2') "; @@ -468,7 +504,7 @@ Element Values(2): ILiteralExpression (Text: 0.1) (OperationKind.LiteralExpressi VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void ParamsArrayArgumentInExpandedFormWithNoArgument() { string source = @" @@ -485,9 +521,9 @@ void M1() string expectedOperationTree = @" IInvocationExpression ( void P.M2(System.Int32 x, params System.Double[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(1)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') - Arguments(2): IArgument (ArgumentKind.Explicit 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)') + IArgument (ArgumentKind.ParamArray, Matching Parameter: array) (OperationKind.Argument) (Syntax: 'M2(1)') IArrayCreationExpression (Element Type: System.Double) (OperationKind.ArrayCreationExpression, Type: System.Double[]) (Syntax: 'M2(1)') Dimension Sizes(1): ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: null, Constant: 0) (Syntax: 'M2(1)') Initializer: IArrayInitializer (OperationKind.ArrayInitializer) (Syntax: 'M2(1)') @@ -497,7 +533,7 @@ Dimension Sizes(1): ILiteralExpression (Text: 0) (OperationKind.LiteralExpressio VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void DefaultValueAndParamsArrayArgumentInExpandedFormWithNoArgument() { string source = @" @@ -515,9 +551,9 @@ void M1() string expectedOperationTree = @" IInvocationExpression ( void P.M2([System.Int32 x = 0], params System.Double[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') - Arguments(2): IArgument (ArgumentKind.DefaultValue Matching Parameter: x) (OperationKind.Argument) (Syntax: 'M2()') + Arguments(2): IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'M2()') ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: 'M2()') - IArgument (ArgumentKind.ParamArray Matching Parameter: array) (OperationKind.Argument) (Syntax: 'M2()') + IArgument (ArgumentKind.ParamArray, Matching Parameter: array) (OperationKind.Argument) (Syntax: 'M2()') IArrayCreationExpression (Element Type: System.Double) (OperationKind.ArrayCreationExpression, Type: System.Double[]) (Syntax: 'M2()') Dimension Sizes(1): ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: null, Constant: 0) (Syntax: 'M2()') Initializer: IArrayInitializer (OperationKind.ArrayInitializer) (Syntax: 'M2()') @@ -527,7 +563,7 @@ Dimension Sizes(1): ILiteralExpression (Text: 0) (OperationKind.LiteralExpressio VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void DefaultValueAndNamedParamsArrayArgumentInNormalForm() { string source = @" @@ -545,9 +581,9 @@ void M1() string expectedOperationTree = @" IInvocationExpression ( void P.M2([System.Int32 x = 0], params System.Double[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(array: a)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') - Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: array) (OperationKind.Argument) (Syntax: 'a') + Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: array) (OperationKind.Argument) (Syntax: 'a') ILocalReferenceExpression: a (OperationKind.LocalReferenceExpression, Type: System.Double[]) (Syntax: 'a') - IArgument (ArgumentKind.DefaultValue Matching Parameter: x) (OperationKind.Argument) (Syntax: 'M2(array: a)') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'M2(array: a)') ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: 'M2(array: a)') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -555,7 +591,7 @@ void M1() VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void DefaultValueAndNamedParamsArrayArgumentInExpandedForm() { string source = @" @@ -572,13 +608,13 @@ void M1() string expectedOperationTree = @" IInvocationExpression ( void P.M2([System.Int32 x = 0], params System.Double[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(array: 1)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') - Arguments(2): IArgument (ArgumentKind.ParamArray Matching Parameter: array) (OperationKind.Argument) (Syntax: '1') + Arguments(2): IArgument (ArgumentKind.ParamArray, Matching Parameter: array) (OperationKind.Argument) (Syntax: '1') IArrayCreationExpression (Element Type: System.Double) (OperationKind.ArrayCreationExpression, Type: System.Double[]) (Syntax: '1') Dimension Sizes(1): ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: null, Constant: 1) (Syntax: '1') Initializer: IArrayInitializer (OperationKind.ArrayInitializer) (Syntax: '1') Element Values(1): IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Double, Constant: 1) (Syntax: '1') ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - IArgument (ArgumentKind.DefaultValue Matching Parameter: x) (OperationKind.Argument) (Syntax: 'M2(array: 1)') + IArgument (ArgumentKind.DefaultValue, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'M2(array: 1)') ILiteralExpression (Text: 0) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 0) (Syntax: 'M2(array: 1)') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -604,9 +640,9 @@ void M1() string expectedOperationTree = @" IInvocationExpression ( void P.M2([System.Int32 x = 0], params System.Double[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(1, array: a)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') - Arguments(2): IArgument (ArgumentKind.Explicit 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.Explicit Matching Parameter: array) (OperationKind.Argument) (Syntax: 'a') + IArgument (ArgumentKind.Explicit, Matching Parameter: array) (OperationKind.Argument) (Syntax: 'a') ILocalReferenceExpression: a (OperationKind.LocalReferenceExpression, Type: System.Double[]) (Syntax: 'a') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -614,7 +650,7 @@ void M1() VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void PositionalArgumentAndNamedParamsArrayArgumentInExpandedForm() { string source = @" @@ -631,9 +667,9 @@ void M1() string expectedOperationTree = @" IInvocationExpression ( void P.M2([System.Int32 x = 0], params System.Double[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(1, array: 1)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') - Arguments(2): IArgument (ArgumentKind.Explicit 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: '1') + IArgument (ArgumentKind.ParamArray, Matching Parameter: array) (OperationKind.Argument) (Syntax: '1') IArrayCreationExpression (Element Type: System.Double) (OperationKind.ArrayCreationExpression, Type: System.Double[]) (Syntax: '1') Dimension Sizes(1): ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: null, Constant: 1) (Syntax: '1') Initializer: IArrayInitializer (OperationKind.ArrayInitializer) (Syntax: '1') @@ -664,9 +700,9 @@ void M1() IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'M2(array: a, x: 1);') IInvocationExpression ( void P.M2([System.Int32 x = 0], params System.Double[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(array: a, x: 1)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') - Arguments(2): IArgument (ArgumentKind.Explicit Matching Parameter: array) (OperationKind.Argument) (Syntax: 'a') + Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: array) (OperationKind.Argument) (Syntax: 'a') ILocalReferenceExpression: a (OperationKind.LocalReferenceExpression, Type: System.Double[]) (Syntax: 'a') - IArgument (ArgumentKind.Explicit 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; @@ -674,7 +710,7 @@ void M1() VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } - [Fact] + [Fact(Skip = "https://github.com/dotnet/roslyn/issues/18549")] public void NamedArgumentAndNamedParamsArrayArgumentInExpandedFormOutOfParameterOrder() { string source = @" @@ -691,13 +727,13 @@ void M1() string expectedOperationTree = @" IInvocationExpression ( void P.M2([System.Int32 x = 0], params System.Double[] array)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'M2(array: 1, x: 10)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'M2') - Arguments(2): IArgument (ArgumentKind.ParamArray Matching Parameter: array) (OperationKind.Argument) (Syntax: '1') + Arguments(2): IArgument (ArgumentKind.ParamArray, Matching Parameter: array) (OperationKind.Argument) (Syntax: '1') IArrayCreationExpression (Element Type: System.Double) (OperationKind.ArrayCreationExpression, Type: System.Double[]) (Syntax: '1') Dimension Sizes(1): ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: null, Constant: 1) (Syntax: '1') Initializer: IArrayInitializer (OperationKind.ArrayInitializer) (Syntax: '1') Element Values(1): IConversionExpression (ConversionKind.CSharp, Implicit) (OperationKind.ConversionExpression, Type: System.Double, Constant: 1) (Syntax: '1') ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') - IArgument (ArgumentKind.Explicit Matching Parameter: x) (OperationKind.Argument) (Syntax: '10') + IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: '10') ILiteralExpression (Text: 10) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 10) (Syntax: '10') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -705,4 +741,4 @@ Element Values(1): IConversionExpression (ConversionKind.CSharp, Implicit) (Oper VerifyOperationTreeAndDiagnosticsForTest(source, expectedOperationTree, expectedDiagnostics); } } -} +} \ No newline at end of file diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IIfStatement.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IIfStatement.cs index 05758b26ada3b554649630278983a4d86391b092..92accf3ac99602ca424b7b54ad8bac033ef1046e 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IIfStatement.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IIfStatement.cs @@ -164,12 +164,12 @@ private void M() Right: ILiteralExpression (Text: 20) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 20) (Syntax: '20') IfTrue: IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.WriteLine(m);') IInvocationExpression (static void System.Console.WriteLine(System.Int32 value)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.WriteLine(m)') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: 'm') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: 'm') ILocalReferenceExpression: m (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'm') IfFalse: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.WriteLine(n);') IInvocationExpression (static void System.Console.WriteLine(System.Int32 value)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.WriteLine(n)') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: 'n') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: 'n') ILocalReferenceExpression: n (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'n') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -212,12 +212,12 @@ private void M() IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.WriteLine(m);') IInvocationExpression (static void System.Console.WriteLine(System.Int32 value)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.WriteLine(m)') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: 'm') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: 'm') ILocalReferenceExpression: m (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'm') IfFalse: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.WriteLine(n);') IInvocationExpression (static void System.Console.WriteLine(System.Int32 value)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.WriteLine(n)') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: 'n') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: 'n') ILocalReferenceExpression: n (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'n') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -256,7 +256,7 @@ private void M() IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.Wri ... than m."");') IInvocationExpression (static void System.Console.WriteLine(System.String value)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.Wri ... r than m."")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '""Nothing is ... er than m.""') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '""Nothing is ... er than m.""') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: ""Nothing is larger than m."") (Syntax: '""Nothing is ... er than m.""') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -299,7 +299,7 @@ private void M() IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.Wri ... ""Result1"");') IInvocationExpression (static void System.Console.WriteLine(System.String value)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.Wri ... (""Result1"")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '""Result1""') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '""Result1""') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: ""Result1"") (Syntax: '""Result1""') IfFalse: IIfStatement (OperationKind.IfStatement) (Syntax: 'if (m > 10) ... }') Condition: IBinaryOperatorExpression (BinaryOperationKind.IntegerGreaterThan) (OperationKind.BinaryOperatorExpression, Type: System.Boolean) (Syntax: 'm > 10') @@ -308,12 +308,12 @@ private void M() IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.Wri ... ""Result2"");') IInvocationExpression (static void System.Console.WriteLine(System.String value)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.Wri ... (""Result2"")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '""Result2""') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '""Result2""') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: ""Result2"") (Syntax: '""Result2""') IfFalse: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.Wri ... ""Result3"");') IInvocationExpression (static void System.Console.WriteLine(System.String value)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.Wri ... (""Result3"")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '""Result3""') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '""Result3""') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: ""Result3"") (Syntax: '""Result3""') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -341,17 +341,17 @@ private void M() string expectedOperationTree = @" IIfStatement (OperationKind.IfStatement) (Syntax: 'if (int.Try ... s ={ s}"");') Condition: IInvocationExpression (static System.Boolean System.Int32.TryParse(System.String s, out System.Int32 result)) (OperationKind.InvocationExpression, Type: System.Boolean) (Syntax: 'int.TryPars ... out var i)') - Arguments(2): IArgument (Matching Parameter: s) (OperationKind.Argument) (Syntax: 's') + Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: s) (OperationKind.Argument) (Syntax: 's') ILocalReferenceExpression: s (OperationKind.LocalReferenceExpression, Type: System.String) (Syntax: 's') - IArgument (Matching Parameter: result) (OperationKind.Argument) (Syntax: 'var i') + IArgument (ArgumentKind.Explicit, Matching Parameter: result) (OperationKind.Argument) (Syntax: 'var i') ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'var i') IfTrue: IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'System.Cons ... s ={ s}"");') IInvocationExpression (static void System.Console.WriteLine(System.String value)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'System.Cons ... , s ={ s}"")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '$""i ={ i}, s ={ s}""') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '$""i ={ i}, s ={ s}""') IOperation: (OperationKind.None) (Syntax: '$""i ={ i}, s ={ s}""') IfFalse: IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'System.Cons ... s ={ s}"");') IInvocationExpression (static void System.Console.WriteLine(System.String value)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'System.Cons ... , s ={ s}"")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '$""i ={ i}, s ={ s}""') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '$""i ={ i}, s ={ s}""') IOperation: (OperationKind.None) (Syntax: '$""i ={ i}, s ={ s}""') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -390,7 +390,7 @@ private int A() Condition: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') IfTrue: IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'System.Cons ... eLine(A());') IInvocationExpression (static void System.Console.WriteLine(System.Int32 value)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'System.Cons ... teLine(A())') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: 'A()') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: 'A()') IInvocationExpression ( System.Int32 P.A()) (OperationKind.InvocationExpression, Type: System.Int32) (Syntax: 'A()') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'A') "; @@ -430,11 +430,11 @@ private void A(bool flag) IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'A(int.TryPa ... ut var i));') IInvocationExpression ( void P.A(System.Boolean flag)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'A(int.TryPa ... out var i))') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: P) (Syntax: 'A') - Arguments(1): IArgument (Matching Parameter: flag) (OperationKind.Argument) (Syntax: 'int.TryPars ... out var i)') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: flag) (OperationKind.Argument) (Syntax: 'int.TryPars ... out var i)') IInvocationExpression (static System.Boolean System.Int32.TryParse(System.String s, out System.Int32 result)) (OperationKind.InvocationExpression, Type: System.Boolean) (Syntax: 'int.TryPars ... out var i)') - Arguments(2): IArgument (Matching Parameter: s) (OperationKind.Argument) (Syntax: 's') + Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: s) (OperationKind.Argument) (Syntax: 's') ILocalReferenceExpression: s (OperationKind.LocalReferenceExpression, Type: System.String) (Syntax: 's') - IArgument (Matching Parameter: result) (OperationKind.Argument) (Syntax: 'var i') + IArgument (ArgumentKind.Explicit, Matching Parameter: result) (OperationKind.Argument) (Syntax: 'var i') ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'var i') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -471,9 +471,9 @@ private static void A(bool flag, int number) Locals: Local_1: System.Int32 i IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'A(o is int i, 1);') IInvocationExpression (static void Program.A(System.Boolean flag, System.Int32 number)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'A(o is int i, 1)') - Arguments(2): IArgument (Matching Parameter: flag) (OperationKind.Argument) (Syntax: 'o is int i') + Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: flag) (OperationKind.Argument) (Syntax: 'o is int i') IOperation: (OperationKind.None) (Syntax: 'o is int i') - IArgument (Matching Parameter: number) (OperationKind.Argument) (Syntax: '1') + IArgument (ArgumentKind.Explicit, Matching Parameter: number) (OperationKind.Argument) (Syntax: '1') ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -506,7 +506,7 @@ private void M() IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.WriteLine(str);') IInvocationExpression (static void System.Console.WriteLine(System.String value)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.WriteLine(str)') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: 'str') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: 'str') ILocalReferenceExpression: str (OperationKind.LocalReferenceExpression, Type: System.String) (Syntax: 'str') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -539,7 +539,7 @@ private static void A(object o) Condition: ILiteralExpression (OperationKind.LiteralExpression, Type: System.Boolean, Constant: True) (Syntax: 'true') IfTrue: IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'A(25);') IInvocationExpression (static void Program.A(System.Object o)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'A(25)') - Arguments(1): IArgument (Matching Parameter: o) (OperationKind.Argument) (Syntax: '25') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: o) (OperationKind.Argument) (Syntax: '25') IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: '25') ILiteralExpression (Text: 25) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 25) (Syntax: '25') "; @@ -579,9 +579,9 @@ private static void A(bool flag, int number) Locals: Local_1: System.Int32 i IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'A(o is int i, 1);') IInvocationExpression (static void Program.A(System.Boolean flag, System.Int32 number)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'A(o is int i, 1)') - Arguments(2): IArgument (Matching Parameter: flag) (OperationKind.Argument) (Syntax: 'o is int i') + Arguments(2): IArgument (ArgumentKind.Explicit, Matching Parameter: flag) (OperationKind.Argument) (Syntax: 'o is int i') IOperation: (OperationKind.None) (Syntax: 'o is int i') - IArgument (Matching Parameter: number) (OperationKind.Argument) (Syntax: '1') + IArgument (ArgumentKind.Explicit, Matching Parameter: number) (OperationKind.Argument) (Syntax: '1') ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1') "; var expectedDiagnostics = DiagnosticDescription.None; @@ -615,7 +615,7 @@ private void M() IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.WriteLine(str);') IInvocationExpression (static void System.Console.WriteLine(System.String value)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.WriteLine(str)') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: 'str') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: 'str') ILocalReferenceExpression: str (OperationKind.LocalReferenceExpression, Type: System.String) (Syntax: 'str') IfFalse: IExpressionStatement (OperationKind.ExpressionStatement, IsInvalid) (Syntax: '') IInvalidExpression (OperationKind.InvalidExpression, Type: ?, IsInvalid) (Syntax: '') @@ -800,7 +800,7 @@ class C Right: IInvocationExpression (virtual System.Boolean System.ValueType.Equals(System.Object obj)) (OperationKind.InvocationExpression, Type: System.Boolean) (Syntax: '((T)d).Equals(x)') Instance Receiver: IConversionExpression (ConversionKind.CSharp, Explicit) (OperationKind.ConversionExpression, Type: T) (Syntax: '(T)d') IParameterReferenceExpression: d (OperationKind.ParameterReferenceExpression, Type: dynamic) (Syntax: 'd') - Arguments(1): IArgument (Matching Parameter: obj) (OperationKind.Argument) (Syntax: 'x') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: obj) (OperationKind.Argument) (Syntax: 'x') IConversionExpression (ConversionKind.Cast, Implicit) (OperationKind.ConversionExpression, Type: System.Object) (Syntax: 'x') IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: T) (Syntax: 'x') IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }') diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ISymbolInitializer.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ISymbolInitializer.cs index 3ac58a0601b8a8855f481eca2c83ad4c8f05822f..d91860e957f1abb1693e653d84c8dccd916e0758 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ISymbolInitializer.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_ISymbolInitializer.cs @@ -303,7 +303,7 @@ class C string expectedOperationTree = @" IFieldInitializer (Field: System.Action C.e) (OperationKind.FieldInitializerAtDeclaration) (Syntax: '= MakeAction(1)') IInvocationExpression (static System.Action C.MakeAction(System.Int32 x)) (OperationKind.InvocationExpression, Type: System.Action) (Syntax: 'MakeAction(1)') - Arguments(1): IArgument (Matching Parameter: x) (OperationKind.Argument) (Syntax: '1') + Arguments(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; @@ -325,7 +325,7 @@ class C string expectedOperationTree = @" IFieldInitializer (Field: System.Action C.f) (OperationKind.FieldInitializerAtDeclaration) (Syntax: '= MakeAction(2)') IInvocationExpression (static System.Action C.MakeAction(System.Int32 x)) (OperationKind.InvocationExpression, Type: System.Action) (Syntax: 'MakeAction(2)') - Arguments(1): IArgument (Matching Parameter: x) (OperationKind.Argument) (Syntax: '2') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: '2') ILiteralExpression (Text: 2) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 2) (Syntax: '2') "; var expectedDiagnostics = DiagnosticDescription.None; diff --git a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_InvalidExpression.cs b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_InvalidExpression.cs index e69e112f2261aa0b7a73ba8554e93fbc66d0e0fa..ba0700435537d017ac76f96ad9208c8473d27c7b 100644 --- a/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_InvalidExpression.cs +++ b/src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_InvalidExpression.cs @@ -60,7 +60,7 @@ void F(int x) string expectedOperationTree = @" IInvocationExpression ( void Program.F(System.Int32 x)) (OperationKind.InvocationExpression, Type: System.Void, IsInvalid) (Syntax: 'F(string.Empty)') Instance Receiver: IInstanceReferenceExpression (InstanceReferenceKind.Implicit) (OperationKind.InstanceReferenceExpression, Type: Program) (Syntax: 'F') - Arguments(1): IArgument (Matching Parameter: x) (OperationKind.Argument) (Syntax: 'string.Empty') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'string.Empty') IFieldReferenceExpression: System.String System.String.Empty (Static) (OperationKind.FieldReferenceExpression, Type: System.String) (Syntax: 'string.Empty') "; var expectedDiagnostics = new DiagnosticDescription[] { diff --git a/src/Compilers/Test/Utilities/VisualBasic/SemanticModelTestBase.vb b/src/Compilers/Test/Utilities/VisualBasic/SemanticModelTestBase.vb index 54ab5076c43b40372e7ecd643b43439736c5be1d..0ec9775d001319cc057a34dc88b66e73c8c41d44 100644 --- a/src/Compilers/Test/Utilities/VisualBasic/SemanticModelTestBase.vb +++ b/src/Compilers/Test/Utilities/VisualBasic/SemanticModelTestBase.vb @@ -169,7 +169,7 @@ Public MustInherit Class SemanticModelTestBase : Inherits BasicTestBase Friend Function GetOperationTreeForTest(Of TSyntaxNode As SyntaxNode)(testSrc As String, Optional compilationOptions As VisualBasicCompilationOptions = Nothing, Optional parseOptions As VisualBasicParseOptions = Nothing, Optional which As Integer = 0) As String Dim fileName = "a.vb" Dim syntaxTree = Parse(testSrc, fileName, parseOptions) - Dim compilation = CreateCompilationWithMscorlib45AndVBRuntime({syntaxTree}, references:={SystemRef, SystemCoreRef}, options:=If(compilationOptions, TestOptions.ReleaseDll)) + Dim compilation = CreateCompilationWithMscorlib45AndVBRuntime({syntaxTree}, references:=DefaultVbReferences, options:=If(compilationOptions, TestOptions.ReleaseDll)) Return GetOperationTreeForTest(Of TSyntaxNode)(compilation, fileName, which) End Function @@ -196,7 +196,7 @@ Public MustInherit Class SemanticModelTestBase : Inherits BasicTestBase Friend Sub VerifyOperationTreeAndDiagnosticsForTest(Of TSyntaxNode As SyntaxNode)(testSrc As String, expectedOperationTree As String, expectedDiagnostics As String, Optional compilationOptions As VisualBasicCompilationOptions = Nothing, Optional parseOptions As VisualBasicParseOptions = Nothing, Optional which As Integer = 0) Dim fileName = "a.vb" Dim syntaxTree = Parse(testSrc, fileName, parseOptions) - Dim compilation = CreateCompilationWithMscorlib45AndVBRuntime({syntaxTree}, references:={SystemRef, SystemCoreRef}, options:=If(compilationOptions, TestOptions.ReleaseDll)) + Dim compilation = CreateCompilationWithMscorlib45AndVBRuntime({syntaxTree}, references:=DefaultVbReferences, options:=If(compilationOptions, TestOptions.ReleaseDll)) VerifyOperationTreeAndDiagnosticsForTest(Of TSyntaxNode)(compilation, fileName, expectedOperationTree, expectedDiagnostics, which) End Sub diff --git a/src/Compilers/VisualBasic/Test/Semantic/BasicCompilerSemanticTest.vbproj b/src/Compilers/VisualBasic/Test/Semantic/BasicCompilerSemanticTest.vbproj index 05aff21af5de16edd7752b60912c0fd6fdd89890..4a44eebd9c10481d48e793a6ea547d5958baaed4 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/BasicCompilerSemanticTest.vbproj +++ b/src/Compilers/VisualBasic/Test/Semantic/BasicCompilerSemanticTest.vbproj @@ -96,9 +96,9 @@ + - diff --git a/src/Compilers/VisualBasic/Test/Semantic/Diagnostics/OperationAnalyzerTests.vb b/src/Compilers/VisualBasic/Test/Semantic/Diagnostics/OperationAnalyzerTests.vb index 20c42bb51110ae940ace3633233e1ae6d77cbe1d..055d69d51c90e125b386df312782cd6f5499b5cf 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/Diagnostics/OperationAnalyzerTests.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/Diagnostics/OperationAnalyzerTests.vb @@ -306,13 +306,17 @@ End Class Dim comp = CompilationUtils.CreateCompilationWithMscorlibAndVBRuntime(source, parseOptions:=TestOptions.RegularWithIOperationFeature) comp.VerifyDiagnostics() comp.VerifyAnalyzerDiagnostics({New InvocationTestAnalyzer}, Nothing, Nothing, False, - Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "2").WithLocation(11, 21), - Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "1").WithLocation(12, 15), - Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "2").WithLocation(12, 21), - Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "4").WithLocation(12, 33), - Diagnostic(InvocationTestAnalyzer.BigParamArrayArgumentsDescriptor.Id, "M0(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)").WithLocation(14, 9), - Diagnostic(InvocationTestAnalyzer.BigParamArrayArgumentsDescriptor.Id, "M0(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)").WithLocation(15, 9), - Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "3").WithLocation(17, 21)) + Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3(Nothing,)").WithArguments("b").WithLocation(25, 9), + Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3(,0)").WithArguments("a").WithLocation(26, 9), + Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3(,)").WithArguments("a").WithLocation(27, 9), + Diagnostic(InvocationTestAnalyzer.UseDefaultArgumentDescriptor.Id, "M3(,)").WithArguments("b").WithLocation(27, 9), + Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "2").WithLocation(11, 21), + Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "4").WithLocation(12, 33), + Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "2").WithLocation(12, 21), + Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "1").WithLocation(12, 15), + Diagnostic(InvocationTestAnalyzer.BigParamArrayArgumentsDescriptor.Id, "M0(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12)").WithLocation(14, 9), + Diagnostic(InvocationTestAnalyzer.BigParamArrayArgumentsDescriptor.Id, "M0(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13)").WithLocation(15, 9), + Diagnostic(InvocationTestAnalyzer.OutOfNumericalOrderArgumentsDescriptor.Id, "3").WithLocation(17, 21)) End Sub @@ -1216,12 +1220,8 @@ End Class comp.VerifyDiagnostics() comp.VerifyAnalyzerDiagnostics({New ParamsArrayTestAnalyzer}, Nothing, Nothing, False, Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "M0(1, 2, 3, 4, 5)").WithLocation(9, 9), - Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "M0(1, 2, 3, 4, 5)").WithLocation(9, 9), - Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "M0(1, 2, 3, 4, 5, 6)").WithLocation(10, 9), Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "M0(1, 2, 3, 4, 5, 6)").WithLocation(10, 9), Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "New Integer() { 2, 3, 4, 5 }").WithLocation(12, 15), - Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "New Integer() { 2, 3, 4, 5 }").WithLocation(12, 15), - Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "New Integer() { 2, 3, 4, 5, 6 }").WithLocation(13, 15), Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "New Integer() { 2, 3, 4, 5, 6 }").WithLocation(13, 15), Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "D").WithLocation(14, 30), Diagnostic(ParamsArrayTestAnalyzer.LongParamsDescriptor.Id, "New Integer() { 2, 3, 4, 5 }").WithLocation(15, 26)) @@ -1781,10 +1781,7 @@ End Class comp.VerifyAnalyzerDiagnostics({New NullOperationSyntaxTestAnalyzer}, Nothing, Nothing, False, Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "M0()").WithLocation(6, 9), Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "M0(1)").WithLocation(7, 9), - Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "M0(1, 2)").WithLocation(8, 9), - Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "New Integer() { }").WithLocation(9, 12), - Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "New Integer() { 1 }").WithLocation(10, 12), - Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "New Integer() { 1, 2 }").WithLocation(11, 12)) + Diagnostic(NullOperationSyntaxTestAnalyzer.ParamsArrayOperationDescriptor.Id, "M0(1, 2)").WithLocation(8, 9)) End Sub diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests.vb index fa830b1732f3f5843e9a69cc458e10a731cafd77..fbe0968242744a6b66d3782e34c4ab1ccfd27a36 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests.vb @@ -238,7 +238,7 @@ IIfStatement (OperationKind.IfStatement) (Syntax: 'If x <> 0 T ... End If') IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'If x <> 0 T ... End If') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'System.Console.Write(x)') IInvocationExpression (static Sub System.Console.Write(value As System.Int32)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'System.Console.Write(x)') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: 'x') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: 'x') IParameterReferenceExpression: x (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'x') ]]>.Value @@ -275,7 +275,7 @@ IForLoopStatement (LoopKind.For) (OperationKind.LoopStatement) (Syntax: 'For i = Body: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'For i = 0 T ... Next') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'System.Console.Write(i)') IInvocationExpression (static Sub System.Console.Write(value As System.Int32)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'System.Console.Write(i)') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: 'i') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: 'i') ILocalReferenceExpression: i (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'i') ]]>.Value @@ -331,7 +331,7 @@ BC30581: 'AddressOf' expression cannot be converted to 'Integer' because 'Intege comp.VerifyOperationTree(nodes(0), expectedOperationTree:= "IInvocationExpression (static Sub Module1.Test1(ParamArray x As System.Int32())) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Test1(Nothing)') - Arguments(1): IArgument (Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Nothing') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: x) (OperationKind.Argument) (Syntax: 'Nothing') IConversionExpression (ConversionKind.Basic, Implicit) (OperationKind.ConversionExpression, Type: System.Int32(), Constant: null) (Syntax: 'Nothing') ILiteralExpression (OperationKind.LiteralExpression, Type: null, Constant: null) (Syntax: 'Nothing')") diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IArgument.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IArgument.vb index b159e7f119adf43ae306008d867de3667fbeb3a7..26e1e0ee0145963005efecfdc3aab0acf202c6f4 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IArgument.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IArgument.vb @@ -1,14 +1,13 @@ ' Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. Imports Microsoft.CodeAnalysis.VisualBasic.Syntax -Imports Roslyn.Test.Utilities Namespace Microsoft.CodeAnalysis.VisualBasic.UnitTests.Semantics Partial Public Class IOperationTests Inherits SemanticModelTestBase - + Public Sub PositionalArgument() Dim source = .Value Dim expectedOperationTree = .Value @@ -34,7 +33,7 @@ IInvocationExpression ( Sub Program.M2(a As System.Int32, b As System.Double)) ( VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub - + Public Sub PositionalArgumentWithDefaultValue() Dim source = .Value Dim expectedOperationTree = .Value @@ -60,7 +59,7 @@ IInvocationExpression ( Sub Program.M2(a As System.Int32, [b As System.Double = VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub - + Public Sub NamedArgumentListedInParameterOrder() Dim source = .Value Dim expectedOperationTree = .Value @@ -86,7 +85,7 @@ IInvocationExpression ( Sub Program.M2(a As System.Int32, [b As System.Double = VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub - + Public Sub NamedArgumentListedOutOfParameterOrder() Dim source = .Value Dim expectedOperationTree = .Value @@ -112,7 +111,7 @@ IInvocationExpression ( Sub Program.M2(a As System.Int32, [b As System.Double = VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub - + Public Sub NamedArgumentInParameterOrderWithDefaultValue() Dim source = .Value Dim expectedOperationTree = .Value @@ -140,7 +139,7 @@ IInvocationExpression ( Sub Program.M2([a As System.Int32 = 0], [b As System.Dou VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub - + Public Sub NamedArgumentInParameterOrderWithDefaultValueUsingOmittedSyntax() Dim source = .Value Dim expectedOperationTree = .Value @@ -168,7 +167,7 @@ IInvocationExpression ( Sub Program.M2([a As System.Int32 = 0], [b As System.Dou VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub - + Public Sub NamedArgumentOutOfParameterOrderWithDefaultValue() Dim source = .Value Dim expectedOperationTree = .Value @@ -196,7 +195,7 @@ IInvocationExpression ( Sub Program.M2([a As System.Int32 = 0], [b As System.Dou VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub - + Public Sub NamedAndPositionalArgumentsWithDefaultValue() Dim source = .Value Dim expectedOperationTree = .Value @@ -224,7 +223,7 @@ IInvocationExpression ( Sub Program.M2([a As System.Int32 = 0], [b As System.Dou VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub - + Public Sub PositionalByRefNonModifiableArgument() Dim source = .Value Dim expectedOperationTree = .Value @@ -249,7 +248,7 @@ IInvocationExpression ( Sub Program.M2([ByRef a As System.Int32 = 0])) (Operatio End Sub - + Public Sub PositionalByRefModifiableArgument() Dim source = .Value Dim expectedOperationTree = .Value @@ -274,7 +273,7 @@ IInvocationExpression ( Sub Program.M2([ByRef a As System.Int32 = 0])) (Operatio VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub - + Public Sub NamedByRefModifiableArgumentsOutOfParameterOrder() Dim source = .Value Dim expectedOperationTree = .Value @@ -302,7 +301,7 @@ IInvocationExpression ( Sub Program.M2([ByRef a As System.Int32 = 0], [ByRef b A VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub - + Public Sub DefaultValueForByRefParameter() Dim source = .Value Dim expectedOperationTree = .Value @@ -327,7 +326,7 @@ IInvocationExpression ( Sub Program.M2([ByRef a As System.Int32 = 0])) (Operatio VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub - + Public Sub PositionalByRefNonModifiableArgumentWithConversion() Dim source = .Value Dim expectedOperationTree = .Value @@ -352,7 +351,7 @@ IInvocationExpression ( Sub Program.M2([ByRef a As System.Int32 = 0])) (Operatio VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) End Sub - + Public Sub PositionalByRefModifiableArgumentWithConversion() Dim source = .Value Dim expectedOperationTree = + Public Sub PositionalArgumentForExtensionMethod() + Dim source = + Public Sub E1(a As P, Optional b As Integer = 0, Optional c As Integer = 0) + End Sub +End Module]]>.Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub NamedArgumentOutOfParameterOrderForExtensionMethod() + Dim source = + Public Sub E1(a As P, Optional b As Integer = 0, Optional c As Integer = 0) + End Sub +End Module]]>.Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + + + Public Sub ParamsArrayArgumentInNormalForm() + Dim source = .Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub ParamsArrayArgumentInExpandedForm() + Dim source = .Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub + + + Public Sub ParamsArrayArgumentInExpandedFormWithNoArgument() + Dim source = .Value + + Dim expectedOperationTree = .Value + + Dim expectedDiagnostics = String.Empty + + VerifyOperationTreeAndDiagnosticsForTest(Of InvocationExpressionSyntax)(source, expectedOperationTree, expectedDiagnostics) + End Sub End Class End Namespace - diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IIfStatement.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IIfStatement.vb index 441a651d10a92c10353115ddf5f0f88e20ce48f5..1816ebf7fde926a4def64bb000de9705c6c2d358 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IIfStatement.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IIfStatement.vb @@ -300,12 +300,12 @@ IIfStatement (OperationKind.IfStatement) (Syntax: 'If (m > 10) ... End If') IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'If (n > 20) ... End If') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.Wri ... "Result 1")') IInvocationExpression (static Sub System.Console.WriteLine(value As System.String)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.Wri ... "Result 1")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result 1"') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result 1"') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "Result 1") (Syntax: '"Result 1"') IfFalse: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Else ... "Result 2")') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.Wri ... "Result 2")') IInvocationExpression (static Sub System.Console.WriteLine(value As System.String)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.Wri ... "Result 2")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result 2"') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result 2"') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "Result 2") (Syntax: '"Result 2"') ]]>.Value @@ -348,12 +348,12 @@ IIfStatement (OperationKind.IfStatement) (Syntax: 'If (m > 10) ... End If') IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'If (n > 20) ... End If') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.Wri ... "Result 1")') IInvocationExpression (static Sub System.Console.WriteLine(value As System.String)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.Wri ... "Result 1")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result 1"') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result 1"') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "Result 1") (Syntax: '"Result 1"') IfFalse: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Else ... "Result 2")') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.Wri ... "Result 2")') IInvocationExpression (static Sub System.Console.WriteLine(value As System.String)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.Wri ... "Result 2")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result 2"') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result 2"') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "Result 2") (Syntax: '"Result 2"') ]]>.Value @@ -391,7 +391,7 @@ IIfStatement (OperationKind.IfStatement) (Syntax: 'If (m >= n ... End If') IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'If (m >= n ... End If') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.Wri ... r than m.")') IInvocationExpression (static Sub System.Console.WriteLine(value As System.String)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.Wri ... r than m.")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Nothing Is ... er than m."') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Nothing Is ... er than m."') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "Nothing Is larger than m.") (Syntax: '"Nothing Is ... er than m."') ]]>.Value @@ -427,7 +427,7 @@ IIfStatement (OperationKind.IfStatement) (Syntax: 'If (m > 20) ... End If') IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'If (m > 20) ... End If') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.Wri ... ("Result1")') IInvocationExpression (static Sub System.Console.WriteLine(value As System.String)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.Wri ... ("Result1")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result1"') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result1"') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "Result1") (Syntax: '"Result1"') IfFalse: IIfStatement (OperationKind.IfStatement) (Syntax: 'ElseIf (n > ... ("Result2")') Condition: IParenthesizedExpression (OperationKind.ParenthesizedExpression, Type: System.Boolean) (Syntax: '(n > 10)') @@ -437,12 +437,12 @@ IIfStatement (OperationKind.IfStatement) (Syntax: 'If (m > 20) ... End If') IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'ElseIf (n > ... ("Result2")') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.Wri ... ("Result2")') IInvocationExpression (static Sub System.Console.WriteLine(value As System.String)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.Wri ... ("Result2")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result2"') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result2"') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "Result2") (Syntax: '"Result2"') IfFalse: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Else ... ("Result3")') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.Wri ... ("Result3")') IInvocationExpression (static Sub System.Console.WriteLine(value As System.String)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.Wri ... ("Result3")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result3"') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result3"') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "Result3") (Syntax: '"Result3"') ]]>.Value @@ -471,7 +471,7 @@ IIfStatement (OperationKind.IfStatement) (Syntax: 'If (m > 20) ... ("Result3")') IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'If (m > 20) ... ("Result3")') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'System.Cons ... ("Result1")') IInvocationExpression (static Sub System.Console.WriteLine(value As System.String)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'System.Cons ... ("Result1")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result1"') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result1"') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "Result1") (Syntax: '"Result1"') IfFalse: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Else If (n ... ("Result3")') IIfStatement (OperationKind.IfStatement) (Syntax: 'If (n > 10) ... ("Result3")') @@ -482,12 +482,12 @@ IIfStatement (OperationKind.IfStatement) (Syntax: 'If (m > 20) ... ("Result3")') IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'If (n > 10) ... ("Result3")') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'System.Cons ... ("Result2")') IInvocationExpression (static Sub System.Console.WriteLine(value As System.String)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'System.Cons ... ("Result2")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result2"') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result2"') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "Result2") (Syntax: '"Result2"') IfFalse: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'Else System ... ("Result3")') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'System.Cons ... ("Result3")') IInvocationExpression (static Sub System.Console.WriteLine(value As System.String)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'System.Cons ... ("Result3")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result3"') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result3"') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "Result3") (Syntax: '"Result3"') ]]>.Value @@ -522,7 +522,7 @@ IIfStatement (OperationKind.IfStatement) (Syntax: 'If (m > 20) ... Else') IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'If (m > 20) ... Else') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.Wri ... ("Result1")') IInvocationExpression (static Sub System.Console.WriteLine(value As System.String)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.Wri ... ("Result1")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result1"') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result1"') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "Result1") (Syntax: '"Result1"') IfFalse: IBlockStatement (0 statements) (OperationKind.BlockStatement) (Syntax: 'Else') ]]>.Value @@ -557,7 +557,7 @@ IIfStatement (OperationKind.IfStatement, IsInvalid) (Syntax: 'If () Then' ... En IfTrue: IBlockStatement (1 statements) (OperationKind.BlockStatement) (Syntax: 'If () Then' ... End If') IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'Console.Wri ... ("Result1")') IInvocationExpression (static Sub System.Console.WriteLine(value As System.String)) (OperationKind.InvocationExpression, Type: System.Void) (Syntax: 'Console.Wri ... ("Result1")') - Arguments(1): IArgument (Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result1"') + Arguments(1): IArgument (ArgumentKind.Explicit, Matching Parameter: value) (OperationKind.Argument) (Syntax: '"Result1"') ILiteralExpression (OperationKind.LiteralExpression, Type: System.String, Constant: "Result1") (Syntax: '"Result1"') ]]>.Value diff --git a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_InvalidExpression.vb b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_InvalidExpression.vb index ec950991540ed0f5542ae34d7a5f1c06e7bb2d5e..a6472a759f740fd38eef5637525e4464a7d8a490 100644 --- a/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_InvalidExpression.vb +++ b/src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_InvalidExpression.vb @@ -51,7 +51,7 @@ End Class]]>.Value Dim expectedOperationTree = .Value diff --git a/src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs b/src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs index b28a14daab6da2d59d138c2b8f321e22806aef4a..f72cd798d57904905842a74babbcba2bc0fb48c2 100644 --- a/src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs +++ b/src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs @@ -542,7 +542,7 @@ private void VisitArguments(IHasArgumentsExpression operation) public override void VisitArgument(IArgument operation) { LogString($"{nameof(IArgument)} ("); - LogString($"{nameof(ArgumentKind)}.{operation.ArgumentKind} "); + LogString($"{nameof(ArgumentKind)}.{operation.ArgumentKind}, "); LogSymbol(operation.Parameter, header: "Matching Parameter", logDisplayString: false); LogString(")"); LogCommonPropertiesAndNewLine(operation);