src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
165Locations.Length: 1,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
162if (nodes.Length > 0)
Binder\Binder_Expressions.cs (63)
332var boundArgs = ArrayBuilder<BoundExpression>.GetInstance(sourceTuple.Arguments.Length);
1070NamedTypeSymbol.VerifyTupleTypePresent(elements.Length, node, this.Compilation, diagnostics);
2759if (originalUserDefinedConversions.Length > 1)
2765Debug.Assert(originalUserDefinedConversions.Length == 0,
2794targetElementTypesWithAnnotations.Length == tuple.Arguments.Length)
2803Error(diagnostics, ErrorCode.ERR_ConversionNotTupleCompatible, syntax, tuple.Arguments.Length, targetType);
2858for (int i = 0; i < targetElementTypesWithAnnotations.Length; i++)
3402Debug.Assert(!expanded || result.ParameterFromArgument(arg) != parameters.Length - 1);
3476if (expanded && paramNum == parameters.Length - 1)
3497Debug.Assert(argsToParamsOpt.IsDefault || argsToParamsOpt.Length == arguments.Count);
3568int paramsIndex = parameters.Length - 1;
3604int paramsIndex = parameters.Length - 1;
3624Debug.Assert(collectionArgs.Length != 0);
3630Debug.Assert(collectionArgs.Length == 1 || firstParamsArgument + collectionArgs.Length == arguments.Count);
3633if (!argsToParamsOpt.IsDefault && collectionArgs.Length > 1)
3635argsToParamsBuilder = ArrayBuilder<int>.GetInstance(argsToParamsOpt.Length);
3639for (var i = firstParamsArgument + collectionArgs.Length - 1; i != firstParamsArgument; i--)
3701if (memberAnalysisResult.Kind == MemberResolutionKind.ApplicableInExpandedForm && correspondingParameter.Ordinal == parameters.Length - 1)
3748parameters.Length));
3754if (memberAnalysisResult.ArgsToParamsOpt.IsDefault && arguments.Count == parameters.Length)
3762var handlerArgumentIndexesBuilder = ArrayBuilder<int>.GetInstance(handlerParameterIndexes.Length, fillWithValue: BoundInterpolatedStringArgumentPlaceholder.UnspecifiedParameter);
3763for (int handlerParameterIndex = 0; handlerParameterIndex < handlerParameterIndexes.Length; handlerParameterIndex++)
3790var argumentPlaceholdersBuilder = ArrayBuilder<BoundInterpolatedStringArgumentPlaceholder>.GetInstance(handlerArgumentIndexes.Length);
3791var argumentRefKindsBuilder = ArrayBuilder<RefKind>.GetInstance(handlerArgumentIndexes.Length);
3796for (int i = 0; i < handlerArgumentIndexes.Length; i++)
3817(memberAnalysisResult.Kind == MemberResolutionKind.ApplicableInExpandedForm && originalParameterIndex + 1 == parameters.Length))
4229Debug.Assert(boundInitExprIndex >= 0 && boundInitExprIndex < boundInitExpr.Length);
4254Debug.Assert(boundInitExprIndex >= 0 && boundInitExprIndex < boundInitExpr.Length);
4377int numSizes = sizes.Length;
4635else if (boundInitExprOpt.Length != constantSizeOpt)
4646ConstantValue.Create(boundInitExprOpt.Length),
6396boundElementInitializerExpressions.Length == 1 &&
6557for (int i = 0; i < constructors.Length; i++)
6656if (finalApplicableCandidates.Length == 1)
7129if (!succeededConsideringAccessibility && allInstanceConstructors.Length > candidateConstructors.Length)
7557for (int i = 0; i < typeArgumentsWithAnnotations.Length; ++i)
7934Debug.Assert(rightArity == (typeArgumentsWithAnnotations.IsDefault ? 0 : typeArgumentsWithAnnotations.Length));
8127if (symbols.Length > 0 && symbols[0].Kind == SymbolKind.Method)
8147methods.Length == 1 ? methods[0] : null,
8156var symbolOpt = symbols.Length == 1 ? symbols[0] : null;
8473arity = typeArgumentsWithAnnotations.Length;
9247else if (convertedIndex is BoundObjectCreationExpression { Constructor: MethodSymbol constructor, Arguments: { Length: 2 } arguments, ArgsToParamsOpt: { IsDefaultOrEmpty: true }, InitializerExpressionOpt: null } &&
9763if (finalApplicableCandidates.Length == 1)
9827PropertySymbol property = (candidates.Length == 1) ? candidates[0] : CreateErrorPropertySymbol(candidates);
10394if (methods.Length == 0)
10411if (methods.Length == 0)
10483var methods = ArrayBuilder<MethodSymbol>.GetInstance(capacity: node.Methods.Length);
10580int n = node.TypeArgumentsOpt.IsDefaultOrEmpty ? 0 : node.TypeArgumentsOpt.Length;
10628var methods = ArrayBuilder<MethodSymbol>.GetInstance(capacity: node.Methods.Length);
10644int arity = typeArguments.IsDefaultOrEmpty ? 0 : typeArguments.Length;
10813Debug.Assert(parameterRefKinds.IsDefault || parameterRefKinds.Length == parameterTypes.Length);
10814Debug.Assert(parameterDefaultValues.IsDefault || parameterDefaultValues.Length == parameterTypes.Length);
10816Debug.Assert(!hasParams || parameterTypes.Length != 0);
10842WellKnownTypes.GetWellKnownActionDelegate(invokeArgumentCount: parameterTypes.Length) :
10843WellKnownTypes.GetWellKnownFunctionDelegate(invokeArgumentCount: parameterTypes.Length);
10850if (typeArguments.Length == 0)
10862var fieldsBuilder = ArrayBuilder<AnonymousTypeField>.GetInstance(parameterTypes.Length + 1);
10864for (int i = 0; i < parameterTypes.Length; i++)
10874isParams: hasParams && i == parameterTypes.Length - 1,
Binder\Binder_Query.cs (7)
314int n = result.Arguments.Length;
470arguments = arguments.SetItem(arguments.Length - 1, MakeQueryClause(join.Into, arguments[arguments.Length - 1], g));
539arguments = arguments.SetItem(arguments.Length - 1, MakeQueryClause(join.Into, arguments[arguments.Length - 1], g));
633arguments.SetItem(arguments.Length - 2, MakeQueryClause(from, arguments[arguments.Length - 2], x2, invocation, castInvocation)));
FlowAnalysis\NullableWalker.cs (64)
954var builder = ArrayBuilder<Symbol>.GetInstance(members.Length + baseRequiredMembers.Count);
2868for (int i = 0; i < methodParameters.Length; i++)
2873var parameterType = i >= signatureParameters.Length ? parameter.TypeWithAnnotations : signatureParameters[i].TypeWithAnnotations;
3755var resultBuilder = ArrayBuilder<VisitResult>.GetInstance(node.Elements.Length);
4449var builder = ArrayBuilder<VisitResult>.GetInstance(argumentResults.Length);
4456builder.AddRange(argumentResults, 1, argumentResults.Length - 1);
4562for (int i = 0; i < arguments.Length; i++)
4589if (currentDeclarationIndex >= node.Declarations.Length)
4628var expressions = ArrayBuilder<BoundExpression>.GetInstance(initialization.Initializers.Length);
4859if (node.Indices.Length == 1 &&
6373|| parameterCount != arguments.Length
6388Debug.Assert(arguments.Length == 2);
6399Debug.Assert(arguments.Length == 1);
6573if (compareExchangeInfo.Arguments.Length != 3)
6582Debug.Assert(argsToParamsOpt is { IsDefault: true } or { Length: 3 });
6839Debug.Assert(refKindsOpt.IsDefaultOrEmpty || refKindsOpt.Length == arguments.Length);
6840Debug.Assert(argsToParamsOpt.IsDefault || argsToParamsOpt.Length == arguments.Length);
6910var conversionResultsBuilder = ArrayBuilder<VisitResult>.GetInstance(results.Length);
6916for (int i = 0; i < results.Length; i++)
6919var argument = i < arguments.Length ? arguments[i] : argumentNoConversion;
6953conversions.IsDefault || i >= conversions.Length ? Conversion.Identity : conversions[i],
6991for (int i = 0; i < arguments.Length; i++)
7013for (int i = 0; i < arguments.Length; i++)
7064for (int a = 0; a < arguments.Length; ++a)
7069Debug.Assert(parametersOpt.IsDefault || arguments.Length == parametersOpt.Length);
7081if (elements.Length == 0)
7097Debug.Assert(defaultArguments.IsNull || elements.Length == 1);
7098Debug.Assert(elements.Length == 1 || a == arguments.Length - 1);
7099var argumentsBuilder = ArrayBuilder<BoundExpression>.GetInstance(arguments.Length + elements.Length - 1);
7102argumentsBuilder.AddRange(arguments, a + 1, arguments.Length - (a + 1));
7103Debug.Assert(argumentsBuilder.Count == arguments.Length + elements.Length - 1);
7107var argsToParamsBuilder = ArrayBuilder<int>.GetInstance(argsToParamsOpt.Length + elements.Length - 1);
7109argsToParamsBuilder.AddMany(arguments.Length - 1, elements.Length);
7110argsToParamsBuilder.AddRange(argsToParamsOpt, a + 1, argsToParamsOpt.Length - (a + 1));
7116var refKindsBuilder = ArrayBuilder<RefKind>.GetInstance(refKindsOpt.Length + elements.Length - 1);
7118refKindsBuilder.AddMany(RefKind.None, elements.Length);
7119refKindsBuilder.AddRange(refKindsOpt, a + 1, refKindsOpt.Length - (a + 1));
7285int n = arguments.Length;
7799int n = arguments.Length;
7862if (expanded && parameter.Ordinal == parametersOpt.Length - 1)
7898arguments.Length,
7994int n = argumentResults.Length;
8022Debug.Assert(collectionExpressionVisitResults.Length == collection.Elements.Length);
8529Debug.Assert(values.Length == types.Length);
8530Debug.Assert(values.Length == (useRestField ? Math.Min(tupleType.TupleElements.Length, NamedTypeSymbol.ValueTupleRestPosition) : tupleType.TupleElements.Length));
8535int n = values.Length;
8546values.Length == NamedTypeSymbol.ValueTupleRestPosition &&
8606int n = valueElements.Length;
10259Debug.Assert(parameters.Length - offset == n);
10308Debug.Assert(rightParts.Length == n);
10412var builder = ArrayBuilder<DeconstructionVariable>.GetInstance(arguments.Length);
12067if (node.Locals.Length > 0)
Utilities\ValueSetFactory.NumericValueSet.cs (20)
39Debug.Assert(intervals.Length == 0 || tc.Related(GreaterThanOrEqual, intervals[0].first, tc.MinValue));
40for (int i = 0, n = intervals.Length; i < n; i++)
54public bool IsEmpty => _intervals.Length == 0;
68return _tc.ToConstantValue(this._intervals[this._intervals.Length - 1].last);
78return _intervals.Length > 0 && _tc.Related(relation, _intervals[0].first, value);
81return _intervals.Length > 0 && _tc.Related(relation, _intervals[_intervals.Length - 1].last, value);
83return anyIntervalContains(0, _intervals.Length - 1, value);
111if (_intervals.Length == 0)
118return _tc.Related(relation, _intervals[_intervals.Length - 1].last, value);
123return _intervals.Length == 1 && _tc.Related(Equal, _intervals[0].first, value) && _tc.Related(Equal, _intervals[0].last, value);
133if (_intervals.Length == 0)
145int lastIndex = _intervals.Length - 1;
172while (l < left.Length && r < right.Length)
249while (l < left.Length && r < right.Length)
271while (l < left.Length)
278while (r < right.Length)
326return Hash.Combine(Hash.CombineValues(_intervals), _intervals.Length);
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (6)
144var qualifiedNamespaceName = CreateNamespaceAsQualifiedName(newNamespaceParts, aliasQualifier, newNamespaceParts.Length - 1);
161var memberAccessNamespaceName = CreateNamespaceAsMemberAccess(newNamespaceParts, aliasQualifier, newNamespaceParts.Length - 1);
192newNode = CreateNamespaceAsQualifiedName(newNamespaceParts, aliasQualifier, newNamespaceParts.Length - 1);
257CreateNamespaceAsQualifiedName(targetNamespaceParts, aliasQualifier: null, targetNamespaceParts.Length - 1)
317name: CreateNamespaceAsQualifiedName(targetNamespaceParts, aliasQualifier: null, targetNamespaceParts.Length - 1)
365if (namespaceDecls.Length != 1)
src\Analyzers\CSharp\Analyzers\UseCollectionInitializer\CSharpUseCollectionInitializerAnalyzer.cs (1)
66Parameters.Length: 1,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1027if (symbols.Length == 0)
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
165Locations.Length: 1,
Lowering\LocalRewriter\LocalRewriter_LateBindingHelpers.vb (19)
71Dim bounds As BoundExpression = New BoundLiteral(node, ConstantValue.Create(flags.Length), intType)
101regularArgNum = rewrittenArguments.Length - namedArgNum
111Dim bounds As BoundExpression = New BoundLiteral(node, ConstantValue.Create(rewrittenArguments.Length), intType)
124For i As Integer = 0 To rewrittenArguments.Length - 1
195regularArgNum = rewrittenArguments.Length - namedArgNum
200Dim bounds As BoundExpression = New BoundLiteral(node, ConstantValue.Create(rewrittenArguments.Length + 1), intType)
213For i As Integer = 0 To rewrittenArguments.Length - 1
238Dim valueElementAssignment = LateAssignToArrayElement(node, arrayTempRef, rewrittenArguments.Length, rewrittenValue, intType)
276Dim bounds As BoundExpression = New BoundLiteral(node, ConstantValue.Create(rewrittenArguments.Length), intType)
325Dim bounds As BoundExpression = New BoundLiteral(node, ConstantValue.Create(initializer.Initializers.Length), intType)
667(assignmentArguments.Length = argExpressions.Length),
670Debug.Assert(argNames.IsDefaultOrEmpty OrElse argNames.Length = argExpressions.Length,
727regularArgNum = assignmentArguments.Length - namedArgNum
740For i As Integer = 0 To assignmentArguments.Length - 1
758copyBackBuilder = ArrayBuilder(Of BoundExpression).GetInstance(assignmentArguments.Length)
759copyBackFlagValues = (New Boolean(assignmentArguments.Length - 1) {})
949Dim bounds As BoundExpression = New BoundLiteral(node, ConstantValue.Create(types.Length), intType)
Semantics\OverloadResolution.vb (48)
359Debug.Assert(parameters.Length = method.ParameterCount)
366Return _parameters.Length
830While i < allResults.Length
1096Dim candidates = ArrayBuilder(Of Candidate).GetInstance(properties.Length - 1)
1098For i As Integer = 0 To properties.Length - 1 Step 1
1167Debug.Assert(argumentNames.IsDefault OrElse argumentNames.Length = arguments.Length)
1202ApplyTieBreakingRulesSkippedByCombineCandidates(candidates, applicableCandidates, applicableNarrowingCandidates, arguments.Length, argumentNames, useSiteInfo)
1439Debug.Assert(argumentNames.IsDefault OrElse argumentNames.Length > 0)
2154For k = 0 To arguments.Length - 1 Step 1
2294For i = 0 To arguments.Length - 1 Step 1
2598For k = 0 To arguments.Length - 1 Step 1
2627Return k >= arguments.Length
2757For j As Integer = 0 To arguments.Length - 1
3039Debug.Assert(argumentNames.IsDefault OrElse (argumentNames.Length > 0 AndAlso argumentNames.Length = arguments.Length))
3048argsToParams = ArrayBuilder(Of Integer).GetInstance(arguments.Length, -1)
3068For i As Integer = 0 To arguments.Length - 1 Step 1
3128For i As Integer = positionalArguments To arguments.Length - 1 Step 1
3224Debug.Assert(argumentNames.IsDefault OrElse (argumentNames.Length > 0 AndAlso argumentNames.Length = arguments.Length))
3344conversionKinds = New KeyValuePair(Of ConversionKind, MethodSymbol)(arguments.Length - 1) {}
3408conversionKinds = New KeyValuePair(Of ConversionKind, MethodSymbol)(arguments.Length - 1) {}
3492conversionKinds = New KeyValuePair(Of ConversionKind, MethodSymbol)(arguments.Length - 1) {}
3519conversionBackKinds = New KeyValuePair(Of ConversionKind, MethodSymbol)(arguments.Length - 1) {}
3863Debug.Assert(argumentNames.IsDefault OrElse (argumentNames.Length > 0 AndAlso argumentNames.Length = arguments.Length))
4080If typeArguments.Length > 0 AndAlso candidate.Arity <> typeArguments.Length Then
4102If arguments.Length <> maxCount Then
4105ElseIf arguments.Length < requiredCount OrElse
4106(Not hasParamArray AndAlso arguments.Length > maxCount) Then
4130If Not hasParamArray OrElse (arguments.Length = maxCount AndAlso Not forceExpandedForm) Then
4189If typeArguments.Length > 0 Then
4218candidateAnalysis.ExpandedParamArrayArgumentsUsed = Math.Max(arguments.Length - candidate.Candidate.ParameterCount + 1, 0)
4254If typeArguments.Length = 0 AndAlso newCandidate.Candidate.Arity > 0 Then
4270CombineCandidates(results, newCandidate, arguments.Length, argumentNames, someCandidatesHaveOverloadResolutionPriority, useSiteInfo)
4291Debug.Assert(argumentNames.IsDefault OrElse argumentNames.Length > 0)
4653For i = 0 To arguments.Length - 1 Step 1
4833For i = 0 To arguments.Length - 1 Step 1
4954For i = 0 To leftTypeArguments.Length - 1
5299For i As Integer = 0 To typeArguments.Length - 1 Step 1
5332candidate.NotInferredTypeArguments = BitVector.Create(typeArguments.Length)
5334For i As Integer = 0 To typeArguments.Length - 1 Step 1
5359If typeArguments.Length > 0 Then
Semantics\TypeInference\TypeArgumentInference.vb (24)
454For i As Integer = 0 To Math.Min(lambdaParameters.Length, delegateParameters.Length) - 1 Step 1
1047AddTypeToGraph(node.ParameterType, node, isOutgoingEdge, BitVector.Create(_typeParameterNodes.Length))
1053If ordinal < _typeParameterNodes.Length AndAlso
1129If parameterType.IsTupleOrCompatibleWithTupleOfCardinality(tupleArguments.Length) Then
1131For i As Integer = 0 To tupleArguments.Length - 1
1153AddTypeToGraph(parameterType, argNode, isOutgoingEdge:=True, haveSeenTypeParameters:=BitVector.Create(_typeParameterNodes.Length))
1161Dim haveSeenTypeParameters = BitVector.Create(_typeParameterNodes.Length)
1187AddTypeToGraph(parameterType, argNode, isOutgoingEdge:=True, haveSeenTypeParameters:=BitVector.Create(_typeParameterNodes.Length))
1209Dim haveSeenTypeParameters = BitVector.Create(_typeParameterNodes.Length)
1211For i As Integer = 0 To Math.Min(delegateParameters.Length, lambdaParameters.Length) - 1 Step 1
1400If parameterElementTypes.Length <> argumentElementTypes.Length Then
1404For typeArgumentIndex As Integer = 0 To parameterElementTypes.Length - 1
1688If parameterParams.Length <> argumentParams.Length AndAlso argumentParams.Length <> 0 Then
1696For i As Integer = 0 To argumentParams.Length - 1
2076If lambdaParams.Length > delegateParams.Length Then
2080For i As Integer = 0 To lambdaParams.Length - 1 Step 1
2252Dim typeArguments = ArrayBuilder(Of TypeWithModifiers).GetInstance(_typeParameterNodes.Length)
2254For i As Integer = 0 To _typeParameterNodes.Length - 1 Step 1
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\SyntaxFacts\ISyntaxFactsExtensions.cs (1)
162if (nodes.Length > 0)