From 808562196d8c4fb0cbba7f7a6836a30870b9702a Mon Sep 17 00:00:00 2001 From: AlekseyTs Date: Fri, 23 Feb 2024 15:58:48 -0800 Subject: [PATCH] Rename BoundNode flag for clarity (#72235) --- .../Portable/Binder/Binder_Attributes.cs | 6 ++--- .../Portable/Binder/Binder_Conversions.cs | 4 ++-- .../Portable/Binder/Binder_Invocation.cs | 12 +++++----- .../Portable/BoundTree/BoundArrayCreation.cs | 6 ++--- .../BoundTree/BoundCollectionExpression.cs | 6 ++--- .../Portable/BoundTree/BoundExpression.cs | 6 ++--- .../CSharp/Portable/BoundTree/BoundNode.cs | 22 +++++++++---------- .../NullableWalker.DebugVerifier.cs | 8 +++---- .../Portable/FlowAnalysis/NullableWalker.cs | 6 ++--- .../LocalRewriter/LocalRewriter_Call.cs | 14 ++++++------ ...ocalRewriter_CompoundAssignmentOperator.cs | 2 +- ...ObjectOrCollectionInitializerExpression.cs | 8 +++---- .../CSharpOperationFactory_Methods.cs | 4 ++-- .../Test/Semantic/Semantics/UnsafeTests.cs | 4 ++-- 14 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Attributes.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Attributes.cs index 267c5d7e9c05f..fb59362df2573 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Attributes.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Attributes.cs @@ -348,7 +348,7 @@ ImmutableArray makeSourceIndices() return default; } - Debug.Assert(arguments.Count(a => a.IsParamsCollection) == (boundAttribute.ConstructorExpanded ? 1 : 0)); + Debug.Assert(arguments.Count(a => a.IsParamsArrayOrCollection) == (boundAttribute.ConstructorExpanded ? 1 : 0)); // make source indices if we have anything that doesn't map 1:1 from arguments to parameters: // 1. implicit default arguments @@ -380,12 +380,12 @@ ImmutableArray makeSourceIndices() constructorArgumentSourceIndices.Count = lengthAfterRewriting; for (int argIndex = 0; argIndex < lengthAfterRewriting; argIndex++) { - Debug.Assert(!arguments[argIndex].IsParamsCollection || arguments[argIndex] is BoundArrayCreation); + Debug.Assert(!arguments[argIndex].IsParamsArrayOrCollection || arguments[argIndex] is BoundArrayCreation); int paramIndex = argsToParamsOpt.IsDefault ? argIndex : argsToParamsOpt[argIndex]; constructorArgumentSourceIndices[paramIndex] = defaultArguments[argIndex] || - (arguments[argIndex].IsParamsCollection && arguments[argIndex] is BoundArrayCreation { Bounds: [BoundLiteral { ConstantValueOpt.Value: 0 }] }) ? + (arguments[argIndex].IsParamsArrayOrCollection && arguments[argIndex] is BoundArrayCreation { Bounds: [BoundLiteral { ConstantValueOpt.Value: 0 }] }) ? -1 : argIndex; } return constructorArgumentSourceIndices.ToImmutableAndFree(); diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Conversions.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Conversions.cs index 7d13e4ab9ee9d..c7ccacf33fefd 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Conversions.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Conversions.cs @@ -708,7 +708,7 @@ private BoundCollectionExpression ConvertCollectionExpression( node, builder.ToImmutableAndFree(), targetType) - { WasCompilerGenerated = node.IsParamsCollection, IsParamsCollection = node.IsParamsCollection }; + { WasCompilerGenerated = node.IsParamsArrayOrCollection, IsParamsArrayOrCollection = node.IsParamsArrayOrCollection }; BoundNode bindSpreadElement(BoundCollectionExpressionSpreadElement element, TypeSymbol elementType, Conversion elementConversion, BindingDiagnosticBag diagnostics) { @@ -1327,7 +1327,7 @@ private BoundCollectionExpression BindCollectionExpressionForErrorRecovery( elements: builder.ToImmutableAndFree(), targetType, hasErrors: true) - { WasCompilerGenerated = node.IsParamsCollection, IsParamsCollection = node.IsParamsCollection }; + { WasCompilerGenerated = node.IsParamsArrayOrCollection, IsParamsArrayOrCollection = node.IsParamsArrayOrCollection }; } private void GenerateImplicitConversionErrorForCollectionExpression( diff --git a/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs b/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs index bc2f4886d1afa..3cb6be52074ea 100644 --- a/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs +++ b/src/Compilers/CSharp/Portable/Binder/Binder_Invocation.cs @@ -1505,7 +1505,7 @@ internal void BindDefaultArgumentsAndParamsCollection( int paramsIndex = parameters.Length - 1; var paramsArgsBuilder = expanded ? ArrayBuilder.GetInstance() : null; - Debug.Assert(!argumentsBuilder.Any(a => a.IsParamsCollection)); + Debug.Assert(!argumentsBuilder.Any(a => a.IsParamsArrayOrCollection)); var visitedParameters = BitVector.Create(parameters.Length); for (var i = 0; i < argumentsBuilder.Count; i++) @@ -1583,7 +1583,7 @@ internal void BindDefaultArgumentsAndParamsCollection( ImmutableArray.Create(arraySize), new BoundArrayInitialization(node, isInferred: false, collectionArgs) { WasCompilerGenerated = true }, collectionType) - { WasCompilerGenerated = true, IsParamsCollection = true }; + { WasCompilerGenerated = true, IsParamsArrayOrCollection = true }; } else { @@ -1592,7 +1592,7 @@ internal void BindDefaultArgumentsAndParamsCollection( MessageID.IDS_ParamsCollections.CheckFeatureAvailability(diagnostics, node); } - var unconvertedCollection = new BoundUnconvertedCollectionExpression(node, ImmutableArray.CastUp(collectionArgs)) { WasCompilerGenerated = true, IsParamsCollection = true }; + var unconvertedCollection = new BoundUnconvertedCollectionExpression(node, ImmutableArray.CastUp(collectionArgs)) { WasCompilerGenerated = true, IsParamsArrayOrCollection = true }; CompoundUseSiteInfo useSiteInfo = GetNewCompoundUseSiteInfo(diagnostics); Conversion conversion = Conversions.ClassifyImplicitConversionFromExpression(unconvertedCollection, collectionType, ref useSiteInfo); diagnostics.Add(node, useSiteInfo); @@ -1626,7 +1626,7 @@ internal void BindDefaultArgumentsAndParamsCollection( if (!paramsType.IsSZArray()) { var discardedUseSiteInfo = CompoundUseSiteInfo.Discarded; - emptyCollection ??= new BoundUnconvertedCollectionExpression(node, ImmutableArray.CastUp(ImmutableArray.Empty)) { WasCompilerGenerated = true, IsParamsCollection = true }; + emptyCollection ??= new BoundUnconvertedCollectionExpression(node, ImmutableArray.CastUp(ImmutableArray.Empty)) { WasCompilerGenerated = true, IsParamsArrayOrCollection = true }; Conversion nextConversion = Conversions.ClassifyImplicitConversionFromExpression(emptyCollection, paramsType, ref discardedUseSiteInfo); if (nextConversion.Exists && @@ -1671,10 +1671,10 @@ internal void BindDefaultArgumentsAndParamsCollection( conversionGroupOpt: null, constantValueOpt: null, type: collectionType) - { WasCompilerGenerated = true, IsParamsCollection = true }; + { WasCompilerGenerated = true, IsParamsArrayOrCollection = true }; } - Debug.Assert(collection.IsParamsCollection); + Debug.Assert(collection.IsParamsArrayOrCollection); if (collectionArgsLength != 0) { diff --git a/src/Compilers/CSharp/Portable/BoundTree/BoundArrayCreation.cs b/src/Compilers/CSharp/Portable/BoundTree/BoundArrayCreation.cs index 7b164becd05f3..a473bca5d7019 100644 --- a/src/Compilers/CSharp/Portable/BoundTree/BoundArrayCreation.cs +++ b/src/Compilers/CSharp/Portable/BoundTree/BoundArrayCreation.cs @@ -6,15 +6,15 @@ namespace Microsoft.CodeAnalysis.CSharp { internal partial class BoundArrayCreation { - public new bool IsParamsCollection + public new bool IsParamsArrayOrCollection { get { - return base.IsParamsCollection; + return base.IsParamsArrayOrCollection; } init { - base.IsParamsCollection = value; + base.IsParamsArrayOrCollection = value; } } } diff --git a/src/Compilers/CSharp/Portable/BoundTree/BoundCollectionExpression.cs b/src/Compilers/CSharp/Portable/BoundTree/BoundCollectionExpression.cs index 1933178f21b3f..1f433ff9832d4 100644 --- a/src/Compilers/CSharp/Portable/BoundTree/BoundCollectionExpression.cs +++ b/src/Compilers/CSharp/Portable/BoundTree/BoundCollectionExpression.cs @@ -31,15 +31,15 @@ internal bool HasSpreadElements(out int numberIncludingLastSpread, out bool hasK return numberIncludingLastSpread > 0; } - public new bool IsParamsCollection + public new bool IsParamsArrayOrCollection { get { - return base.IsParamsCollection; + return base.IsParamsArrayOrCollection; } init { - base.IsParamsCollection = value; + base.IsParamsArrayOrCollection = value; } } } diff --git a/src/Compilers/CSharp/Portable/BoundTree/BoundExpression.cs b/src/Compilers/CSharp/Portable/BoundTree/BoundExpression.cs index 6c27f1ede5e68..9efa7afb4e031 100644 --- a/src/Compilers/CSharp/Portable/BoundTree/BoundExpression.cs +++ b/src/Compilers/CSharp/Portable/BoundTree/BoundExpression.cs @@ -496,15 +496,15 @@ internal bool ConversionHasSideEffects() return true; } - public new bool IsParamsCollection + public new bool IsParamsArrayOrCollection { get { - return base.IsParamsCollection; + return base.IsParamsArrayOrCollection; } init { - base.IsParamsCollection = value; + base.IsParamsArrayOrCollection = value; } } } diff --git a/src/Compilers/CSharp/Portable/BoundTree/BoundNode.cs b/src/Compilers/CSharp/Portable/BoundTree/BoundNode.cs index 9cf20f43ff492..c5d6d5771976d 100644 --- a/src/Compilers/CSharp/Portable/BoundTree/BoundNode.cs +++ b/src/Compilers/CSharp/Portable/BoundTree/BoundNode.cs @@ -53,9 +53,9 @@ private enum BoundNodeAttributes : short /// WasConverted = 1 << 8, - ParamsCollection = 1 << 9, + ParamsArrayOrCollection = 1 << 9, - AttributesPreservedInClone = HasErrors | CompilerGenerated | IsSuppressed | WasConverted | ParamsCollection, + AttributesPreservedInClone = HasErrors | CompilerGenerated | IsSuppressed | WasConverted | ParamsArrayOrCollection, } protected new BoundNode MemberwiseClone() @@ -152,9 +152,9 @@ protected void CopyAttributes(BoundNode original) Debug.Assert(original is BoundExpression || !original.IsSuppressed); this.IsSuppressed = original.IsSuppressed; - if (original.IsParamsCollection) + if (original.IsParamsArrayOrCollection) { - this.IsParamsCollection = true; + this.IsParamsArrayOrCollection = true; } #if DEBUG @@ -327,28 +327,28 @@ protected set } #endif - public bool IsParamsCollection + public bool IsParamsArrayOrCollection { get { - return (_attributes & BoundNodeAttributes.ParamsCollection) != 0; + return (_attributes & BoundNodeAttributes.ParamsArrayOrCollection) != 0; } protected set { - Debug.Assert((_attributes & BoundNodeAttributes.ParamsCollection) == 0, $"{nameof(BoundNodeAttributes.ParamsCollection)} flag should not be set twice or reset"); - Debug.Assert(value || !IsParamsCollection); + Debug.Assert((_attributes & BoundNodeAttributes.ParamsArrayOrCollection) == 0, $"{nameof(BoundNodeAttributes.ParamsArrayOrCollection)} flag should not be set twice or reset"); + Debug.Assert(value || !IsParamsArrayOrCollection); Debug.Assert(!value || this is BoundArrayCreation { Bounds: [BoundLiteral { WasCompilerGenerated: true }], InitializerOpt: BoundArrayInitialization { WasCompilerGenerated: true }, WasCompilerGenerated: true } or BoundUnconvertedCollectionExpression { WasCompilerGenerated: true } or - BoundCollectionExpression { WasCompilerGenerated: true, UnconvertedCollectionExpression.IsParamsCollection: true } or - BoundConversion { Operand: BoundCollectionExpression { IsParamsCollection: true } }); + BoundCollectionExpression { WasCompilerGenerated: true, UnconvertedCollectionExpression.IsParamsArrayOrCollection: true } or + BoundConversion { Operand: BoundCollectionExpression { IsParamsArrayOrCollection: true } }); Debug.Assert(!value || this is not BoundUnconvertedCollectionExpression collection || ImmutableArray.CastUp(collection.Elements.CastArray()) == collection.Elements); if (value) { - _attributes |= BoundNodeAttributes.ParamsCollection; + _attributes |= BoundNodeAttributes.ParamsArrayOrCollection; } } } diff --git a/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.DebugVerifier.cs b/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.DebugVerifier.cs index 64301c13faf7b..9fad0aeeb0729 100644 --- a/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.DebugVerifier.cs +++ b/src/Compilers/CSharp/Portable/FlowAnalysis/NullableWalker.DebugVerifier.cs @@ -64,7 +64,7 @@ public static void Verify(ImmutableDictionary VisitArguments( } else { - Debug.Assert(!arguments.Any(a => a.IsParamsCollection)); + Debug.Assert(!arguments.Any(a => a.IsParamsArrayOrCollection)); } (ImmutableArray argumentsNoConversions, ImmutableArray conversions) = RemoveArgumentConversions(arguments, refKindsOpt); @@ -6817,12 +6817,12 @@ static void expandParamsCollection(ref ImmutableArray arguments // At the moment, there is only one test that gets here like that - Microsoft.CodeAnalysis.CSharp.UnitTests.AttributeTests.TestBadParamsCtor. // And we get here for the erroneous attribute application, constructor is inaccessible. // Perhaps that shouldn't cancel the default values / params array processing? - Debug.Assert(arguments.Count(a => a.IsParamsCollection) <= 1); + Debug.Assert(arguments.Count(a => a.IsParamsArrayOrCollection) <= 1); for (int a = 0; a < arguments.Length; ++a) { BoundExpression argument = arguments[a]; - if (argument.IsParamsCollection) + if (argument.IsParamsArrayOrCollection) { Debug.Assert(parametersOpt.IsDefault || arguments.Length == parametersOpt.Length); ImmutableArray elements; diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs index b866af4bc72ae..0cd77cbac5024 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_Call.cs @@ -992,7 +992,7 @@ private ImmutableArray MakeArguments( BoundExpression? optimized; Debug.Assert(expanded ? rewrittenArguments.Length == parameters.Length : rewrittenArguments.Length >= parameters.Length); - Debug.Assert(rewrittenArguments.Count(a => a.IsParamsCollection) <= (expanded ? 1 : 0)); + Debug.Assert(rewrittenArguments.Count(a => a.IsParamsArrayOrCollection) <= (expanded ? 1 : 0)); if (CanSkipRewriting(rewrittenArguments, methodOrIndexer, argsToParamsOpt, invokedAsExtensionMethod, false, out var isComReceiver)) { @@ -1104,7 +1104,7 @@ private ImmutableArray MakeArguments( private bool TryOptimizeParamsArray(BoundExpression possibleParamsArray, [NotNullWhen(true)] out BoundExpression? optimized) { - if (possibleParamsArray.IsParamsCollection && !_inExpressionLambda && ((BoundArrayCreation)possibleParamsArray).Bounds is [BoundLiteral { ConstantValueOpt.Value: 0 }]) + if (possibleParamsArray.IsParamsArrayOrCollection && !_inExpressionLambda && ((BoundArrayCreation)possibleParamsArray).Bounds is [BoundLiteral { ConstantValueOpt.Value: 0 }]) { optimized = CreateArrayEmptyCallIfAvailable(possibleParamsArray.Syntax, ((ArrayTypeSymbol)possibleParamsArray.Type!).ElementType); if (optimized is { }) @@ -1230,7 +1230,7 @@ private static ImmutableArray GetRefKindsOrNull(ArrayBuilder r private delegate BoundExpression ParamsArrayElementRewriter(BoundExpression element, ref TArg arg); private static BoundExpression RewriteParamsArray(BoundExpression paramsArray, ParamsArrayElementRewriter elementRewriter, ref TArg arg) { - Debug.Assert(paramsArray.IsParamsCollection); + Debug.Assert(paramsArray.IsParamsArrayOrCollection); if (paramsArray is BoundArrayCreation { Bounds: [BoundLiteral] bounds, InitializerOpt: BoundArrayInitialization { Initializers: var elements } initialization } creation) { @@ -1287,7 +1287,7 @@ private void BuildStoresToTemps( Debug.Assert(refKinds.Count == arguments.Length); Debug.Assert(storesToTemps.Count == 0); Debug.Assert(rewrittenArguments.Length == parameters.Length); - Debug.Assert(rewrittenArguments.Count(a => a.IsParamsCollection) <= (expanded ? 1 : 0)); + Debug.Assert(rewrittenArguments.Count(a => a.IsParamsArrayOrCollection) <= (expanded ? 1 : 0)); for (int a = 0; a < rewrittenArguments.Length; ++a) { @@ -1298,7 +1298,7 @@ private void BuildStoresToTemps( Debug.Assert(arguments[p] == null); - if (argument.IsParamsCollection) + if (argument.IsParamsArrayOrCollection) { Debug.Assert(expanded); Debug.Assert(p == parameters.Length - 1); @@ -1321,7 +1321,7 @@ private void BuildStoresToTemps( arg.rewriter.StoreArgumentToTempIfNecessary(arg.forceLambdaSpilling, arg.storesToTemps, element, RefKind.None, RefKind.None), ref arg); - Debug.Assert(arguments[p].IsParamsCollection); + Debug.Assert(arguments[p].IsParamsArrayOrCollection); } continue; @@ -1482,7 +1482,7 @@ private static int MergeArgumentsAndSideEffects( { var argument = arguments[a]; - if (argument.IsParamsCollection) + if (argument.IsParamsArrayOrCollection) { (ArrayBuilder tempStores, int tempsRemainedInUse, int firstUnclaimedStore) arg = (tempStores, tempsRemainedInUse, firstUnclaimedStore); arguments[a] = RewriteParamsArray( diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_CompoundAssignmentOperator.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_CompoundAssignmentOperator.cs index b6770f5665ba1..787e7b7138a45 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_CompoundAssignmentOperator.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_CompoundAssignmentOperator.cs @@ -343,7 +343,7 @@ private BoundIndexerAccess TransformIndexerAccessContinued( refKinds, storesToTemps); - if (expanded && actualArguments[actualArguments.Length - 1] is { IsParamsCollection: true } array) + if (expanded && actualArguments[actualArguments.Length - 1] is { IsParamsArrayOrCollection: true } array) { Debug.Assert(array is BoundArrayCreation); diff --git a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_ObjectOrCollectionInitializerExpression.cs b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_ObjectOrCollectionInitializerExpression.cs index 0ac55635f88e6..738b911e6d217 100644 --- a/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_ObjectOrCollectionInitializerExpression.cs +++ b/src/Compilers/CSharp/Portable/Lowering/LocalRewriter/LocalRewriter_ObjectOrCollectionInitializerExpression.cs @@ -295,7 +295,7 @@ private void AddObjectInitializer( if (!memberInit.Arguments.IsDefaultOrEmpty) { - Debug.Assert(memberInit.Arguments.Count(a => a.IsParamsCollection) <= (memberInit.Expanded ? 1 : 0)); + Debug.Assert(memberInit.Arguments.Count(a => a.IsParamsArrayOrCollection) <= (memberInit.Expanded ? 1 : 0)); var args = EvaluateSideEffectingArgumentsToTemps( memberInit.Arguments, @@ -398,7 +398,7 @@ private void AddObjectInitializer( if (rewrittenArrayAccess is BoundArrayAccess arrayAccess) { - Debug.Assert(!arrayAccess.Indices.Any(a => a.IsParamsCollection)); + Debug.Assert(!arrayAccess.Indices.Any(a => a.IsParamsArrayOrCollection)); var indices = EvaluateSideEffectingArgumentsToTemps( arrayAccess.Indices, @@ -530,7 +530,7 @@ void addIndexes(ArrayBuilder result, BoundAssignmentOperator as { foreach (var argument in initializerMember.Arguments) { - if (argument is BoundArrayCreation { IsParamsCollection: true, InitializerOpt: var initializers }) + if (argument is BoundArrayCreation { IsParamsArrayOrCollection: true, InitializerOpt: var initializers }) { Debug.Assert(initializers is not null); foreach (var element in initializers.Initializers) @@ -588,7 +588,7 @@ private ImmutableArray EvaluateSideEffectingArgumentsToTemps( BoundExpression replacement; - if (arg.IsParamsCollection) + if (arg.IsParamsArrayOrCollection) { // Capturing the array instead is going to lead to an observable behavior difference. Not just an IL difference, // see Microsoft.CodeAnalysis.CSharp.UnitTests.CodeGen.ObjectAndCollectionInitializerTests.DictionaryInitializerTestSideeffects001param for example. diff --git a/src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory_Methods.cs b/src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory_Methods.cs index 59940d21106d3..64de33612c82f 100644 --- a/src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory_Methods.cs +++ b/src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory_Methods.cs @@ -36,7 +36,7 @@ private IInstanceReferenceOperation CreateImplicitReceiver(SyntaxNode syntax, Ty internal IArgumentOperation CreateArgumentOperation(ArgumentKind kind, IParameterSymbol? parameter, BoundExpression expression) { // put argument syntax to argument operation - IOperation value = Create(expression is BoundConversion { IsParamsCollection: true } conversion ? conversion.Operand : expression); + IOperation value = Create(expression is BoundConversion { IsParamsArrayOrCollection: true } conversion ? conversion.Operand : expression); (SyntaxNode syntax, bool isImplicit) = expression.Syntax is { Parent: ArgumentSyntax or AttributeArgumentSyntax } ? (expression.Syntax.Parent, expression.WasCompilerGenerated) : (value.Syntax, true); return new ArgumentOperation( kind, @@ -343,7 +343,7 @@ private static ArgumentKind GetArgumentKind(BoundExpression argument, ref BitVec { argumentKind = ArgumentKind.DefaultValue; } - else if (argument.IsParamsCollection) + else if (argument.IsParamsArrayOrCollection) { argumentKind = argument.Type?.IsSZArray() == true ? ArgumentKind.ParamArray : ArgumentKind.ParamCollection; } diff --git a/src/Compilers/CSharp/Test/Semantic/Semantics/UnsafeTests.cs b/src/Compilers/CSharp/Test/Semantic/Semantics/UnsafeTests.cs index b461872a45c38..12753c86accd8 100644 --- a/src/Compilers/CSharp/Test/Semantic/Semantics/UnsafeTests.cs +++ b/src/Compilers/CSharp/Test/Semantic/Semantics/UnsafeTests.cs @@ -2949,7 +2949,7 @@ public static void Process(BoundBlock block, Binder binder, ArrayBuilder public override BoundNode Visit(BoundNode node) { var expr = node as BoundExpression; - if (expr != null && !expr.IsParamsCollection) + if (expr != null && !expr.IsParamsArrayOrCollection) { var text = node.Syntax.ToString(); if (!string.IsNullOrEmpty(text)) @@ -2979,7 +2979,7 @@ protected override bool ConvertInsufficientExecutionStackExceptionToCancelledByS public override BoundNode VisitArrayCreation(BoundArrayCreation node) { - if (node.IsParamsCollection) + if (node.IsParamsArrayOrCollection) { this.VisitList(node.InitializerOpt.Initializers); return null;