Implemented interface member:
7 writes to Count
Microsoft.CodeAnalysis (3)
CustomDebugInfoReader.cs (1)
266flagsBuilder.Count = flagCount;
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (1)
230Regions.Count = replaceWithCount - 1 + originalCount;
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithSimpleName.cs (1)
230localAliases.Count = localAliasCount;
Microsoft.CodeAnalysis.CSharp (4)
Binder\Binder_Attributes.cs (1)
375constructorArgumentSourceIndices.Count = lengthAfterRewriting;
Binder\Binder_Invocation.cs (1)
1062analyzedArguments.RefKinds.Count = analyzedArguments.Arguments.Count;
CodeGen\EmitExpression.cs (1)
2798_expressionTemps.Count = exprTempsBefore;
Lowering\LocalRewriter\LocalRewriter.cs (1)
687statements.Count = remaining; // trim any trailing nulls
1447 references to Count
Microsoft.CodeAnalysis (234)
ArrayBuilder.cs (25)
32var result = new T[_builder.Count]; 78if (Count == 0) 82else if (_builder.Capacity == Count) 185=> FindIndex(0, this.Count, match); 188=> FindIndex(startIndex, this.Count - startIndex, match); 205=> FindIndex(0, Count, match, arg); 208=> FindIndex(startIndex, Count - startIndex, match, arg); 276=> Count == 0 ? default : Last(); 293if (Count == 0) 307if (Count == 0) 312var tmp = ArrayBuilder<U>.GetInstance(Count); 329if (Count == 0) 333else if (_builder.Capacity == Count) 373if (this.Count != 0) 394Debug.Assert(builder.Count == 0); 450if (this.Count == 1) 458if (this.Count == 0) 465var accumulator = new Dictionary<K, ArrayBuilder<T>>(Count, comparer); 466for (var i = 0; i < Count; i++) 511Debug.Assert(start + length <= items.Count); 570Debug.Assert(limit <= Count); 593for (var i = 0; i < Count; i++) 608if (Count <= 1) 616for (int i = 1; i < Count; i++) 630var result = ArrayBuilder<S>.GetInstance(Count);
ArrayBuilder.Enumerator.cs (1)
34return _index < _builder.Count;
CodeGen\ILBuilder.cs (6)
266while (reachableBlocks.Count != 0) 989seqPoints[seqPoints.Count - 1] = seqPoint; 994if (seqPoints.Count > 0) 1019Debug.Assert(this.SeqPointsOpt.Count == 0); 1232int marker = _allocatedILMarkers.Count; 1250Debug.Assert(ilMarker >= 0 && ilMarker < _allocatedILMarkers.Count, "Wrong builder?");
CodeGen\ItemTokenMap.cs (1)
49token = (uint)_items.Count;
CodeGen\LocalScopeManager.cs (3)
129if (result.Count > 0 && result[result.Count - 1].Length != expectedRootScopeLength) 508while (result.Count <= slotIndex)
CodeGen\LocalSlotManager.cs (1)
231slot: _lazyAllLocals.Count,
CodeGen\SequencePointList.cs (2)
49if (seqPointBuilder.Count == 0) 55int totalPoints = seqPointBuilder.Count;
Collections\ArrayBuilderExtensions.cs (10)
72switch (items.Count) 90var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 112switch (items.Count) 130var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 152switch (items.Count) 170var builder = ArrayBuilder<TResult>.GetInstance(items.Count); 173builder.Add(map(item, builder.Count, arg)); 200builder.RemoveAt(builder.Count - 1); 206if (builder.Count > 0) 218return builder[builder.Count - 1];
Collections\ImmutableArrayExtensions.cs (2)
644var result = (builder.Count == array.Length) ? array : builder.ToImmutable(); 697if (comparer != null && builder.Count > 1)
Collections\OrderedSet.cs (1)
53return _list.Count;
Collections\OrderPreservingMultiDictionary.cs (1)
278internal int Count => (_value as ArrayBuilder<V>)?.Count ?? 1;
Collections\TemporaryArray`1.cs (1)
91public readonly int Count => _builder?.Count ?? _count;
Collections\TopologicalSort.cs (3)
48while (ready.Count != 0) 65bool hadCycle = predecessorCounts.Count != resultBuilder.Count; 84while (toCount.Count != 0)
CommandLine\AnalyzerConfigSet.cs (3)
153Debug.Assert(builder.Count == config.NamedSections.Length); 158Debug.Assert(allMatchers.Count == _analyzerConfigs.Length); 468for (int i = 0; i < analyzerConfigs.Count; i++)
CommandLine\CommandLineParser.cs (7)
216if (parts.Count == 0 || parts[0].Length == 0) 232if (parts.Count > 1 && parts[1].Length > 0) 249if (parts.Count > 2) 504var argsIndex = args.Count - 1; 652if (argsIndex < args.Count) 836int length = parts.Count; 1040for (var i = 0; i < builder.Count; i++)
CustomDebugInfoReader.cs (3)
255Debug.Assert(flagsBuilder.Count == 0); 264if (flagCount < flagsBuilder.Count) 450Debug.Assert(groupBuilder.Count == 0);
DiagnosticAnalyzer\AnalyzerDriver.cs (3)
1385while (kind >= actionsByKindBuilder.Count) 1776Debug.Assert(completedAnalyzers.Count < analysisScope.Analyzers.Length); 2862Debug.Assert(operationsToAnalyze.ToImmutableHashSet().Count == operationsToAnalyze.Count);
Emit\EditAndContinue\DeltaMetadataWriter.cs (2)
1206Debug.Assert(tokens.Distinct().Count() == tokens.Count); 1224Debug.Assert(debugTokens.Distinct().Count() == debugTokens.Count);
Emit\EditAndContinueMethodDebugInformation.cs (2)
233var closureId = new DebugId(closuresBuilder.Count, generation: 0); 247var lambdaId = new DebugId(lambdasBuilder.Count, generation: 0);
FileSystem\PathUtilities.cs (1)
815else if (resolvedParts.Count > 0)
InternalUtilities\EnumField.cs (1)
42int end = sortedFields.Count;
InternalUtilities\OneOrMany.cs (2)
119if (builder.Count == 0) 125return builder.Count == Count ? this : new OneOrMany<T>(builder.ToImmutableAndFree());
InternalUtilities\SetWithInsertionOrder.cs (1)
84public int Count => _elements?.Count ?? 0;
InternalUtilities\TextChangeRangeExtensions.cs (1)
384if (builder.Count > 0)
NativePdbWriter\PdbWriter.cs (3)
405for (int i = nestedNamesReversed.Count - 1; i >= 0; i--) 460while (scopeStack.Count > 0) 479for (int i = scopeStack.Count - 1; i >= 0; i--)
Operations\ControlFlowGraphBuilder.BasicBlockBuilder.cs (1)
44public bool HasStatements => _statements?.Count > 0;
Operations\ControlFlowGraphBuilder.cs (49)
162Debug.Assert(builder._evalStack.Count == 0); 174var builder = ArrayBuilder<BasicBlock>.GetInstance(blockBuilders.Count); 230MarkReachableBlocks(blocks, firstBlockOrdinal: 0, lastBlockOrdinal: blocks.Count - 1, 308while (toVisit.Count != 0); 522for (int i = region.Regions.Count - 1; i >= 0; i--) 550if (region.Regions?.Count == 1) 569for (int i = region.Regions.Count - 1; i >= 0; i--) 687int count = blocks.Count - 1; 760Debug.Assert(tryAndFinally.Regions!.Count == 2); 1130if ((fromPredecessor.Count - lastLeftRegionOnTheWayFromPredecessorToCurrentBlock + 1131fromCurrent.Count - lastLeftRegionOnTheWayFromCurrentToDestination) != 1132(fromPredecessor.Count - lastLeftRegionOnTheWayFromPredecessorToDestination)) 1154else if (builder.Count != 0) 1174while (mismatch < from.Count && mismatch < to.Count && from[mismatch] == to[mismatch]) 1236int stackDepth = _evalStack.Count; 1251Debug.Assert(_evalStack.Count == stackDepth); 1315block.Ordinal = _blocks.Count; 1329Debug.Assert(_evalStack.Count == _startSpillingAt); 1396Debug.Assert(_evalStack.Count == 0 || _evalStack.Peek().frameOpt != null); 1405Debug.Assert(_evalStack.Count == 0 || _evalStack.Peek().frameOpt != null); 1680Debug.Assert(_startSpillingAt == _evalStack.Count); 1726int stackDepth = _evalStack.Count; 1809Debug.Assert(_startSpillingAt <= _evalStack.Count); 1826for (int i = _startSpillingAt; i < _evalStack.Count; i++) 1864for (int j = currentFrameIndex + 1; j < _evalStack.Count; j++) 1922_startSpillingAt = _evalStack.Count; 1946Debug.Assert(_evalStack.Count != 0); 1949Debug.Assert(_startSpillingAt <= _evalStack.Count); 1956int stackDepth = _evalStack.Count; 1973Debug.Assert(_startSpillingAt <= _evalStack.Count); 2016int stackSizeBefore = _evalStack.Count; 2023Debug.Assert(stackSizeBefore == _evalStack.Count); 2059startingStackDepth: _evalStack.Count - (instancePushed ? 1 : 0), 2218while (stack.Count != 0); 2766Debug.Assert(_startSpillingAt == _evalStack.Count); 2814else if (stack.Count == 0 && ReferenceEquals(dest, top.dest)) 2827while (stack.Count != 0); 2967Debug.Assert(_startSpillingAt >= _evalStack.Count - 1); 3454Debug.Assert(_currentConditionalAccessTracker.Operations.Count == 0); 3504Debug.Assert(!_currentConditionalAccessTracker.IsDefault && _currentConditionalAccessTracker.Operations.Count > 0); 3990if (resourceQueueOpt == null || resourceQueueOpt.Count == 0) 6212for (int i = 0; i < initializerBuilder.Count; i++) 6538int maxStackDepth = _evalStack.Count - 2; 6614int appendCallsLength = appendCalls.Count; 6775Debug.Assert(_evalStack.Count > _currentInterpolatedStringHandlerCreationContext.MaximumStackDepth); 6778|| targetStackDepth >= _evalStack.Count) 7210if (children.Count != 0 && children.Last().Kind == OperationKind.ObjectOrCollectionInitializer) 7227for (int i = children.Count - 1; i >= 0; i--)
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (16)
53public bool HasRegions => Regions?.Count > 0; 55public bool HasLocalFunctions => LocalFunctions?.Count > 0; 57public bool HasCaptureIds => CaptureIds?.Count > 0; 146Debug.Assert(Regions.Count <= 2); 147Debug.Assert(lastKind == (Regions.Count < 2 ? ControlFlowRegionKind.Filter : ControlFlowRegionKind.Catch)); 151if (Regions.Count == 1) 162Debug.Assert(Regions.Count <= 2); 163if (Regions.Count == 1) 188if (Regions.Count == 1) 210if (Regions.Count == 1) 220int replaceWithCount = replaceWith.Count; 229int originalCount = Regions.Count; 232for (int i = originalCount - 1, j = Regions.Count - 1; i > insertAt; i--, j--) 269Debug.Assert(Regions.Count == 1 && Regions.First().LastBlock == block); 307int localFunctionsBefore = localFunctions.Count; 321var builder = ArrayBuilder<ControlFlowRegion>.GetInstance(Regions.Count);
PEWriter\MetadataWriter.cs (1)
3866consolidatedTypeArguments.Count,
PEWriter\MetadataWriter.PortablePdb.cs (1)
545int lastNonZero = builder.Count - 1;
PEWriter\TypeNameSerializer.cs (1)
290for (int i = namesReversed.Count - 1; i >= 0; i--)
ReferenceManager\CommonReferenceManager.Binding.cs (15)
154Debug.Assert(referenceBindings.Count == allAssemblies.Length); 166var boundInputs = new BoundInputAssembly[referenceBindings.Count]; 167for (int i = 0; i < referenceBindings.Count; i++) 218Debug.Assert(referenceBindings.Count == explicitAssemblies.Length); 244while (referenceBindingsToProcess.Count > 0) 283int index = explicitAssemblyCount - 1 + metadataReferencesBuilder.Count; 309if (implicitAssemblies.Count == 0) 324var implicitAssembliesMap = new MultiDictionary<string, (AssemblyData DefinitionData, int DefinitionIndex)>(implicitAssemblies.Count, AssemblyIdentityComparer.SimpleNameComparer); 326for (int i = 0; i < implicitAssemblies.Count; i++) 333for (int bindingsIndex = 0; bindingsIndex < referenceBindings.Count; bindingsIndex++) 381Debug.Assert(result.Count == 0); 419Debug.Assert(result.Count == explicitModules.Length + totalReferencedAssemblyCount); 464var bindingsOfAssemblyBeingBuilt = ArrayBuilder<AssemblyReferenceBinding>.GetInstance(referenceBindingsOfAssemblyBeingBuilt.Length + implicitAssemblies.Count); 470for (int i = 0; i < implicitAssemblies.Count; i++) 1002if (corLibraryCandidates.Count == 1)
ReferenceManager\CommonReferenceManager.Resolution.cs (6)
291-assembliesBuilder.Count - 1, 339-assembliesBuilder.Count - 1, 416int count = (referenceMap[i].Kind == MetadataImageKind.Assembly) ? assembliesBuilder.Count : lazyModulesBuilder?.Count ?? 0; 639referenceMap[referenceIndex] = new ResolvedReference(assemblies.Count, MetadataImageKind.Assembly); 653referenceMap[referenceIndex] = new ResolvedReference(modules.Count, MetadataImageKind.Module);
ReferenceManager\CommonReferenceManager.State.cs (5)
496Debug.Assert(aliasesOfReferencedAssembliesBuilder.Count == assemblyIndex); 622Debug.Assert(bindingResult.Length == aliasesOfReferencedAssembliesBuilder.Count + 1); 633Debug.Assert(assemblyIndicesToProcess.Count == 0); 636while (assemblyIndicesToProcess.Count > 0) 664for (int i = 0; i < aliasesOfReferencedAssembliesBuilder.Count; i++)
ReferenceManager\MergedAliases.cs (2)
69if (aliases.Count == 0 ^ newAliases.IsEmpty) 100int originalCount = builder.Count;
SourceGeneration\AdditionalSourcesCollection.cs (3)
98for (int i = 0; i < _sourcesAdded.Count; i++) 111for (int i = 0; i < _sourcesAdded.Count; i++) 125if (asc._sourcesAdded.Count == 0)
SourceGeneration\GeneratorDriver.cs (1)
277if (constantSourcesBuilder.Count > 0)
SourceGeneration\Nodes\BatchNode.cs (1)
104Debug.Assert(builder.Count == entryCount);
SourceGeneration\Nodes\NodeStateTable.cs (23)
124Debug.Assert(compacted.Count == nonRemovedCount); 191public int Count => _states.Count; 195if (_previous._states.Length <= _states.Count) 202var previousEntries = _previous._states[_states.Count].AsRemoved(); 222if (_previous._states.Length <= _states.Count) 228var previousEntries = _previous._states[_states.Count]; 250if (_previous._states.Length <= _states.Count) 256Debug.Assert(_previous._states[_states.Count].Count == 1); 257var (chosen, state, _) = GetModifiedItemAndState(_previous._states[_states.Count].GetItem(0), value, comparer); 265if (_previous._states.Length <= _states.Count) 277var previousEntry = _previous._states[_states.Count]; 377Debug.Assert(_steps.Count + 1 == _states.Count); 416Debug.Assert(!TrackIncrementalSteps || _states.Count == _steps.Count); 418if (_states.Count == 0) 428Debug.Assert(_requestedTableCapacity == null || _states.Count <= _requestedTableCapacity); 434if (_states.Count == _previous.Count && _states.SequenceEqual(_previous._states, (e1, e2) => e1.Matches(e2, _equalityComparer))) 615for (int i = 0, n = _items.Count - 1; i < n; i++) 626Debug.Assert(_items.Count >= 1, "Created a builder with no values?"); 628Debug.Assert(_items.Count == _requestedCapacity); 629Debug.Assert(_states == null || _states.Count == _requestedCapacity); 632if (_items.Count == 1)
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithSimpleName.cs (1)
224var localAliasCount = localAliases.Count;
SourceGeneration\SyntaxStore.cs (2)
78if (syntaxInputBuilders.Count > 0) 91for (int i = 0; i < syntaxInputBuilders.Count; i++)
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (3)
222if (result == 0 && usedFieldsAndValues.Count > 0) 225for (int i = usedFieldsAndValues.Count - 1; i >= 0; i--) 227if (i != (usedFieldsAndValues.Count - 1))
Syntax\GreenNode.cs (1)
670while (stack.Count > 0)
Syntax\GreenNodeExtensions.cs (3)
25if (newAnnotations.Count == 0) 64if (newAnnotations.Count == existingAnnotations.Length) 88if (removalAnnotations.Count == 0)
Syntax\LineDirectiveMap.cs (1)
158for (int i = 0; i < entries.Count - 1; ++i)
Syntax\SyntaxNode.cs (1)
458while (stack.Count > 0)
Syntax\SyntaxNode.Iterators.cs (2)
214public bool IsNotEmpty { get { return _discriminatorStack?.Count > 0; } } 309public bool IsNotEmpty { get { return _discriminatorStack?.Count > 0; } }
Text\CompositeText.cs (8)
185if (segments.Count == 0) 189else if (segments.Count == 1) 209if (segments.Count > MAXIMUM_SEGMENT_COUNT_BEFORE_REDUCTION) 252for (int i = 0; i < segments.Count - 1; i++) 258for (int j = i + 1; j < segments.Count; j++) 275return segments.Count - numberOfSegmentsReduced; 283for (int i = 0; i < segments.Count - 1; i++) 291for (int j = i + 1; j < segments.Count; j++)
Text\SourceText.cs (1)
704if (position == 0 && segments.Count == 0)
Microsoft.CodeAnalysis.CSharp (517)
Binder\Binder.CapturedParametersFinder.cs (1)
70if (captured.Count == 0)
Binder\Binder.IdentifierUsedAsValueFinder.cs (1)
277Debug.Assert(members.Count > 0);
Binder\Binder_Constraints.cs (3)
351Debug.Assert(typeParameters.Length == constraintClauses.Count); 393if (constraintTypeBuilder.Count < n) 469if (constraintTypes.Count > 0)
Binder\Binder_Crefs.cs (2)
464if (builder.Count > 1) 864if (viable.Count > 1)
Binder\Binder_Deconstruct.cs (10)
262if (variables.Count != tupleOrDeconstructedTypes.Length) 264Error(diagnostics, ErrorCode.ERR_DeconstructWrongCardinality, syntax, tupleOrDeconstructedTypes.Length, variables.Count); 270if (variables.Count < 2) 277BoundExpression deconstructInvocation = MakeDeconstructInvocationExpression(variables.Count, 294int count = variables.Count; 351var matchCount = Math.Min(variables.Count, foundTypes.Length); 393int count = variables.Count; 462return $"Nested variables ({NestedVariables.Count})"; 473int leftLength = lhsVariables.Count; 548int count = variables.Count;
Binder\Binder_Expressions.cs (46)
1107Debug.Assert(elementNames.Count == inferredElementNames.Count); 1108var builder = ArrayBuilder<bool>.GetInstance(elementNames.Count); 1109for (int i = 0; i < elementNames.Count; i++) 1146for (int i = 0; i < inferredElementNames.Count; i++) 1520Debug.Assert(members.Count > 0); 1742Debug.Assert(members.Count > 0); 2849if (!hadError && isDelegateCreation && origRefKind != RefKind.None && result.Arguments.Count == 1) 3082int argCount = result.Arguments.Count; 3103int argCount = result.Arguments.Count; 3168for (int arg = 0; arg < arguments.Count; ++arg) 3615knownSizes[dimension - 1] = initializers.Count; 3617else if (knownSizeOpt != initializers.Count) 4280for (int i = 0; i < analyzedArguments.Arguments.Count; i++) 4499else if (analyzedArguments.Arguments.Count == 0) 4504else if (analyzedArguments.Names.Count != 0 || analyzedArguments.RefKinds.Count != 0 || analyzedArguments.Arguments.Count != 1) 4509var end = analyzedArguments.Arguments[analyzedArguments.Arguments.Count - 1].Syntax.Span.End; 4524BoundExpression argument = analyzedArguments.Arguments.Count >= 1 ? BindToNaturalType(analyzedArguments.Arguments[0], diagnostics) : null; 5944if (analyzedArguments.Arguments.Count > 0) 5946diagnostics.Add(ErrorCode.ERR_BadCtorArgCount, typeNode.Location, interfaceType, analyzedArguments.Arguments.Count); 5978else if (analyzedArguments.Arguments.Count > 0) 6733Debug.Assert(symbols.Count > 0); 7126Debug.Assert(extensionMethodArguments.Arguments.Count == 0); 7127Debug.Assert(extensionMethodArguments.Names.Count == 0); 7128Debug.Assert(extensionMethodArguments.RefKinds.Count == 0); 7134if (originalArguments.Names.Count > 0) 7140if (originalArguments.RefKinds.Count > 0) 7176Debug.Assert(members.Count > 0); 7297for (int i = methodGroup.Methods.Count - 1; i >= 0; i--) 7304if (methodGroup.Methods.Count != 0) 7310if (methodGroup.Methods.Count == 0) 7405Debug.Assert(members.Count > 0); 7766if (methodOrPropertyGroup.Count > 0) 7804if ((methodOrPropertyGroup.Count > 0) && 7832Debug.Assert(members.Count > 0); 7980if (arguments.Names.Count > 0) 7995if (arguments.Arguments.Count != rank) 8002BoundExpression[] convertedArguments = new BoundExpression[arguments.Arguments.Count]; 8004for (int i = 0; i < arguments.Arguments.Count; ++i) 8187if (analyzedArguments.Names.Count > 0) 8202if (arguments.Count != 1) 8226int numArguments = analyzedArguments.Arguments.Count; 8535if (arguments.Arguments.Count != 1) 8584if (arguments.Names.Count > 0)
Binder\Binder_InterpolatedString.cs (6)
345Debug.Assert(partsArrayBuilder.Count >= 2); 347if (partsArrayBuilder.Count <= 4 && partsArrayBuilder.All(static parts => AllInterpolatedStringPartsAreStrings(parts))) 796if (parameterNamesAndLocationsBuilder.Count > 1) 802Debug.Assert(parameterNamesAndLocationsBuilder.Count == 0 || parameterNamesAndLocationsBuilder[0] == null); 908if (memberAnalysisResult.ArgsToParamsOpt.IsDefault && arguments.Count == parameters.Length) 928for (int argumentIndex = 0; argumentIndex < arguments.Count; argumentIndex++)
Binder\Binder_Invocation.cs (24)
197for (int i = 0; i < analyzedArguments.Arguments.Count; ++i) 400if (arguments.Names.Count == 0) 411for (int i = 0; i < arguments.Names.Count; i++) 427var builder = ArrayBuilder<BoundExpression>.GetInstance(arguments.Arguments.Count); 429for (int i = 0, n = builder.Count; i < n; i++) 820for (int i = 0, n = overloadResolutionResult.ResultsBuilder.Count; i < n; i++) 856if (finalCandidates.Count == 0) 948Debug.Assert(methodGroup.Methods.Count > 0); 949Debug.Assert(((object)delegateTypeOpt == null) || (methodGroup.Methods.Count == 1)); 1005return CreateBadCall(node, methodGroup.Name, invokedAsExtensionMethod && analyzedArguments.Arguments.Count > 0 && (object)methodGroup.Receiver == (object)analyzedArguments.Arguments[0] ? null : methodGroup.Receiver, 1060if (analyzedArguments.RefKinds.Count == 0) 1062analyzedArguments.RefKinds.Count = analyzedArguments.Arguments.Count; 1279for (var i = 0; i < argumentsBuilder.Count; i++) 1318var argumentsCount = argumentsBuilder.Count; 1326defaultArguments[argumentsBuilder.Count] = true; 1329if (argumentRefKindsBuilder is { Count: > 0 }) 1337Debug.Assert(argumentRefKindsBuilder is null || argumentRefKindsBuilder.Count == 0 || argumentRefKindsBuilder.Count == argumentsBuilder.Count); 1338Debug.Assert(argsToParamsBuilder is null || argsToParamsBuilder.Count == argumentsBuilder.Count); 1652if (parameterListList.Count == MaxParameterListsForErrorRecovery) 1672if (parameterListList.Count == MaxParameterListsForErrorRecovery) 1687int argumentCount = analyzedArguments.Arguments.Count;
Binder\Binder_Lookup.cs (7)
349if (submissionSymbols.Symbols.Count > 0 && submissionSymbols.Symbols.First().Kind != lookingForOverloadsOfKind.Value) 364if (result.Symbols.Count == 0) 592switch (symbols.Count) 615Debug.Assert(symbols.Count >= 2); 619for (int i = 0; i < symbols.Count; i++) 1232var hidingCount = hidingSymbols.Count; 1234var hiddenCount = hiddenSymbols.Count;
Binder\Binder_Operators.cs (3)
491while (syntaxNodes.Count > 0) 745Debug.Assert(stack.Count > 0 && stack.Peek().Left is BoundUnconvertedInterpolatedString); 760Debug.Assert(stack.Count == 0);
Binder\Binder_Patterns.cs (3)
1760Debug.Assert(candidates.Count >= 2); 1764for (int i = 1, n = candidates.Count; i < n; i++) 1770for (int i = 0, n = candidates.Count; i < n; i++)
Binder\Binder_Query.cs (1)
702x2m[x2m.Count - 1] = x2.Name;
Binder\Binder_Statements.cs (1)
477var symbol = result.Symbols.Count > 0 && result.IsMultiViable ?
Binder\Binder_Symbols.cs (7)
1415Debug.Assert(members.Count > 0); 1905if (symbols.Count > 1) 1912for (int i = 0; i < symbols.Count; i++) 2274Debug.Assert(symbols.Count > 0); 2279for (int i = 0; i < symbols.Count; i++) 2293if ((symbols.Count > 1) || (symbols[0] is NamespaceOrTypeSymbol || symbols[0] is AliasSymbol) || 2435for (int i = 0; i < symbols.Count; i++)
Binder\DecisionDagBuilder.cs (5)
839while (workList.Count != 0) 2245for (int i = remainingTests.Count - 1; i >= 0; i--) 2263var result = remainingTests.Count switch 2325for (int i = remainingTests.Count - 1; i >= 0; i--) 2343var result = remainingTests.Count switch
Binder\ExpressionVariableFinder.cs (1)
343while (operands.Count > 0)
Binder\Imports.cs (1)
137for (int i = nameParts.Count - 1; i >= 0; i--)
Binder\LookupResult.cs (3)
87return _kind == LookupResultKind.Empty && _error == null && _symbolList.Count == 0; 113return (_symbolList.Count == 1) ? _symbolList[0] : null; 151return Kind == LookupResultKind.Viable && _symbolList.Count == 1;
Binder\MethodGroupResolution.cs (2)
45Debug.Assert((methodGroup == null) || (methodGroup.Methods.Count > 0)); 87MethodGroup?.Methods.Count == 1 && // Local functions cannot be overloaded
Binder\PatternExplainer.cs (1)
489return "(" + string.Join(", ", subpatterns) + ")" + (subpatterns.Count == 1 ? " { }" : null);
Binder\RefSafetyAnalysis.cs (1)
762int n = variables.Count;
Binder\Semantics\AccessCheck.cs (1)
603while (baseInterfaces.Count != 0)
Binder\Semantics\BestTypeInferrer.cs (3)
159hadMultipleCandidates = candidateTypes.Count > 1; 181switch (types.Count) 191for (int i = 0; i < types.Count; i++)
Binder\Semantics\Conversions\ConversionsBase.cs (5)
2949Debug.Assert(typeParameters.Count == sourceTypeArguments.Count); 2950Debug.Assert(typeParameters.Count == destinationTypeArguments.Count); 2952for (int paramIndex = 0; paramIndex < typeParameters.Count; ++paramIndex)
Binder\Semantics\Conversions\UserDefinedConversions.cs (1)
90bool excludeExisting = result.Count > 0;
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (1)
115if (u.Count == 0 && haveInterfaces)
Binder\Semantics\Conversions\UserDefinedImplicitConversions.cs (1)
263if (u.Count == 0 && haveInterfaces)
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (15)
24if (result.Results.Count > 0) 36Debug.Assert(result.Results.Count == 0); 58Debug.Assert(result.Results.Count == 0); 120Debug.Assert((result.Results.Count == 0) != hadApplicableCandidates); 193Debug.Assert((result.Results.Count == 0) != hadApplicableCandidates); 214Debug.Assert(candidates.Count == 0); 794int initialCount = result.Count; 837Debug.Assert(results.Count == 0); 900Debug.Assert(operators.Count == 0); 915if (operators.Count != 0) 917for (int i = operators2.Count - 1; i >= 0; i--) 956for (int i = operators.Count - 1; i >= 0; i--) 1061for (int index = 0; index < candidates.Count; ++index) 1072for (int i = 1; i < candidates.Count; ++i) 1107for (int index = 0; index < candidates.Count; index++)
Binder\Semantics\Operators\BinaryOperatorOverloadResolutionResult.cs (2)
79if (Results.Count == 0) 110for (int i = 0, n = this.Results.Count; i < n; i++)
Binder\Semantics\Operators\UnaryOperatorOverloadResolution.cs (9)
26Debug.Assert(result.Results.Count == 0); 30if (result.Results.Count > 0) 89for (int index = 0; index < candidates.Count; ++index) 100for (int i = 1; i < candidates.Count; ++i) 134for (int index = 0; index < candidates.Count; index++) 477Debug.Assert(operators.Count == 0); 492if (operators.Count != 0) 494for (int i = operators2.Count - 1; i >= 0; i--) 547for (int i = operators.Count - 1; i >= 0; i--)
Binder\Semantics\Operators\UnaryOperatorOverloadResolutionResult.cs (2)
79if (Results.Count == 0) 110for (int i = 0, n = this.Results.Count; i < n; i++)
Binder\Semantics\OverloadResolution\AnalyzedArguments.cs (7)
49if (Names.Count == 0) 60int count = this.Names.Count; 67var builder = ArrayBuilder<string?>.GetInstance(this.Names.Count); 68for (int i = 0; i < this.Names.Count; ++i) 78return RefKinds.Count > 0 ? RefKinds[i] : Microsoft.CodeAnalysis.RefKind.None; 95bool hasRefKinds = RefKinds.Count > 0; 96for (int i = 0; i < Arguments.Count; i++)
Binder\Semantics\OverloadResolution\MethodGroup.cs (3)
99return this.Methods.Count > 0 ? this.Methods[0].Name : null; 125Debug.Assert(this.Methods.Count == 0); 126Debug.Assert(this.TypeArguments.Count == 0);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (13)
1775Debug.Assert(sourceTypeArguments.Count == targetTypeArguments.Count); 1777for (int arg = 0; arg < sourceTypeArguments.Count; ++arg) 2174Debug.Assert(typeParameters.Count == sourceTypeArguments.Count); 2175Debug.Assert(typeParameters.Count == targetTypeArguments.Count); 2177for (int arg = 0; arg < sourceTypeArguments.Count; ++arg) 2524Debug.Assert(typeParameters.Count == sourceTypeArguments.Count); 2525Debug.Assert(typeParameters.Count == targetTypeArguments.Count); 2527for (int arg = 0; arg < sourceTypeArguments.Count; ++arg)
Binder\Semantics\OverloadResolution\OverloadResolution.cs (49)
259if (members.Count > 50) // TODO: fine-tune this value 265for (int i = 0; i < members.Count; i++) 338Debug.Assert(funcPtrBuilder.Count == 1); 391for (int f = 0; f < results.Count; ++f) 407for (int f = 0; f < results.Count; f++) 429for (int f = 0; f < results.Count; ++f) 465for (int i = 0; i < results.Count; i++) 629for (int f = 0; f < results.Count; ++f) 672for (int i = 0; i < members.Count; i++) 754arguments.Arguments.Count, 792arguments.Arguments.Count, 859if (members.Count < 2) 926Debug.Assert(typeArguments.Count == 0 || typeArguments.Count == member.GetMemberArity()); 1096for (var i = 0; i < members.Count; ++i) 1144for (int f = 0; f < results.Count; ++f) 1252for (int f = 0; f < results.Count; ++f) 1289for (int f = 0; f < results.Count; ++f) 1359for (int f = 0; f < results.Count; f++) 1380for (int f = 0; f < results.Count; f++) 1440for (int index = 0; index < results.Count; index++) 1530for (int index = 0; index < results.Count; index++) 1545var worse = ArrayBuilder<int>.GetInstance(results.Count, unknown); 1550for (int c1Idx = 0; c1Idx < results.Count; c1Idx++) 1560for (int c2Idx = 0; c2Idx < results.Count; c2Idx++) 1591for (int i = 0; i < worse.Count; ++i) 1602for (int i = 0; i < worse.Count; ++i) 1624for (int i = 0; i < worse.Count; ++i) 1745for (i = 0; i < arguments.Count; ++i) 1753Debug.Assert(i == arguments.Count - 1); 1889for (i = i + 1; i < arguments.Count; ++i) 1897Debug.Assert(i == arguments.Count - 1); 1960if (m1ParametersUsedIncludingExpansionAndOptional == arguments.Count) 1964else if (m2ParametersUsedIncludingExpansionAndOptional == arguments.Count) 2027bool hasAll1 = m1.Result.Kind == MemberResolutionKind.ApplicableInExpandedForm || m1ParameterCount == arguments.Count; 2028bool hasAll2 = m2.Result.Kind == MemberResolutionKind.ApplicableInExpandedForm || m2ParameterCount == arguments.Count; 2053for (i = 0; i < arguments.Count; ++i) 2059Debug.Assert(i == arguments.Count - 1); 2147for (int i = 0; i < arguments.Count; ++i) 2208if (arguments.Count < declaredParameterCount) 2225parametersUsedIncludingExpansionAndOptional = arguments.Count; 3308arguments.Arguments.Count, 3321arguments.Arguments.Count, 3378arguments.Arguments.Count, 3391arguments.Arguments.Count, 3434if (typeArgumentsBuilder.Count == 0 && arguments.HasDynamicArgument && !inferWithDynamic) 3453if (typeArgumentsBuilder.Count > 0) 3624if (arguments.Arguments.Count < paramCount) 3629paramCount = arguments.Arguments.Count;
Binder\Semantics\OverloadResolution\OverloadResolution_ArgsToParameters.cs (7)
71if (!expanded && arguments.Names.Count == 0) 78int argumentCount = arguments.Arguments.Count; 207int length = arguments.Arguments.Count; 264isNamedArgument = arguments.Names.Count > argumentPosition && arguments.Names[argumentPosition] != null; 349Debug.Assert(arguments.Names.Count == 0); 353int argumentCount = arguments.Arguments.Count; 495for (int i = 0; i < arguments.Names.Count; ++i)
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (6)
748Debug.Assert(arguments.Arguments.Count > 0); 776Debug.Assert(arguments.Names.Count > badArg); 796Debug.Assert(arguments.Names.Count > badArg); 836Debug.Assert(arguments.Names.Count > badArg); 927int argCount = arguments.Arguments.Count; 1477if (ResultsBuilder.Count == 0)
Binder\WithUsingNamespacesAndTypesBinder.cs (5)
79Debug.Assert(methods.Count == 0); 94var count = methods.Count; 98if (methods.Count != count) 109var count = methods.Count; 113if (methods.Count != count)
BoundTree\BoundNodeExtensions.cs (1)
150Debug.Assert(stack.Count == 0);
BoundTree\BoundTreeRewriter.cs (1)
148while (stack.Count > 0);
BoundTree\BoundTreeWalker.cs (1)
130while (rightOperands.Count > 0)
BoundTree\NullabilityRewriter.cs (2)
44Debug.Assert(stack.Count > 0); 76while (stack.Count > 0);
BoundTree\UnboundLambda.cs (3)
229int numExpressions = types.Count; 253int n = returns.Count; 923returnType = (forErrorRecovery && returnTypes.Count == 0)
CodeGen\CodeGenerator.cs (5)
243int n = yieldPoints.Count; 302Debug.Assert(!(_expressionTemps?.Count > 0), "leaking expression temps?"); 428for (int i = sequencePoints.Count - 1; i >= 0; i--) 526if (_expressionTemps?.Count > 0) 529for (int i = _expressionTemps.Count - 1; i >= 0; i--)
CodeGen\EmitArrayInitializer.cs (1)
194Debug.Assert(indices.Count == arrayType.Rank - 1);
CodeGen\EmitExpression.cs (2)
2771int exprTempsBefore = _expressionTemps?.Count ?? 0; 2783var exprTempsAfter = _expressionTemps?.Count ?? 0;
CodeGen\EmitOperators.cs (1)
151while (stack.Count > 0);
CodeGen\EmitStatement.cs (6)
151Debug.Assert(_asyncYieldPoints.Count == _asyncResumePoints.Count); 159Debug.Assert(_asyncYieldPoints.Count == _asyncResumePoints.Count); 470else if (stack.Count == 0 && ReferenceEquals(destBox, top.destBox)) 484while (stack.Count != 0);
CodeGen\Optimizer.cs (9)
132var defs = ArrayBuilder<LocalDefUseSpan>.GetInstance(dummies.Count); 145var dummyCnt = defs.Count; 173var cnt = defs.Count; 548return _evalStack.Count; 563SetStackDepth(_evalStack.Count - 1); 1462if (stack.Count == 0) 1833if (defs.Count == 0) 1857var last = defs.Count - 1; 2037if (stack.Count == 0)
Compilation\CSharpCompilation.cs (11)
1226assemblies.EnsureCapacity(assemblies.Count + length); 1867if (viableEntryPoints.Count == 0) 1879else if (LanguageVersion >= MessageID.IDS_FeatureAsyncMain.RequiredVersion() && taskEntryPoints.Count > 0) 1901if (viableEntryPoints.Count == 0) 1926if (viableEntryPoints.Count == 0) 1949if (viableEntryPoints.Count > 1) 4610spine.RemoveAt(spine.Count - 1); 4633spine.RemoveAt(spine.Count - 1); 4638if (spine.Count == 0) 4643var symbol = GetCachedSymbol(spine[spine.Count - 1]); 4650for (var i = 1; i < spine.Count; i++)
Compilation\CSharpCompilation.UsingsFromOptionsAndDiagnostics.cs (1)
77if (boundUsings.Count == 0 && diagnostics is null)
Compilation\CSharpSemanticModel.cs (6)
4084if (symbols.Count == 0) 4513if (symbols.Count == 0) 4707Debug.Assert(methods.Count > 0); 4714Debug.Assert((methods.Count == 0) == (resultKind == LookupResultKind.Empty)); 4715Debug.Assert(methods.Count == filteredMethods.Count);
Compilation\MemberSemanticModel.NodeMapBuilder.cs (1)
218while (stack.Count > 0)
Compiler\DocumentationCommentCompiler.cs (1)
425Debug.Assert(paramTags.Count > 0);
Compiler\MethodBodySynthesizer.Lowered.cs (1)
404Debug.Assert(fields.Count > 0);
Compiler\MethodCompiler.cs (4)
1709while (index >= awaiters.Count) 1720while (index >= hoistedVariables.Count) 1734while (awaiters.Count < previousAwaiterCount) 1740while (hoistedVariables.Count < previousAwaiterSlotCount)
Emitter\Model\MostCommonNullableValueBuilder.cs (1)
83int n = builder.Count;
Emitter\Model\PEModuleBuilder.cs (10)
222while (namespacesAndTopLevelTypesToProcess.Count > 0) 250Debug.Assert(debugDocuments.Count == 0); 252Debug.Assert(typesToProcess.Count == 0); 277if (debugDocuments.Count > 0) 302while (typesToProcess.Count > 0) 573index = builder.Count; 748Debug.Assert(stack.Count == 0); 751while (stack.Count > 0) 766int index = builder.Count; 1691if (builder.Count == 1 && builder[0])
FlowAnalysis\AbstractFlowPass.cs (5)
2255Debug.Assert(stack.Count > 0); 2293if (stack.Count == 0) 2404if (stack.Count == 0) 2421if (stack.Count == 0) 2503Debug.Assert(parts.Count >= 2);
FlowAnalysis\AbstractFlowPass.PendingBranchesCollection.cs (1)
65if (_unlabeledBranches.Count == 0)
FlowAnalysis\AlwaysAssignedWalker.cs (1)
56if (i >= variableBySlot.Count)
FlowAnalysis\ControlFlowPass.cs (1)
403var initialUsingCount = _usingDeclarations.Count;
FlowAnalysis\DefiniteAssignment.cs (4)
277int slot = variableBySlot.Count; 1000int n = variableBySlot.Count; 1168_alreadyReported.EnsureCapacity(variableBySlot.Count); 1745var result = new LocalState(BitVector.AllSet(variableBySlot.Count));
FlowAnalysis\DefiniteAssignment.LocalFunctions.cs (2)
32new LocalState(BitVector.AllSet(variableBySlot.Count), normalizeToBottom: true), 128int n = variableBySlot.Count;
FlowAnalysis\DefinitelyAssignedWalker.cs (1)
93if (slot < variableBySlot.Count &&
FlowAnalysis\NullableWalker.cs (9)
4162int n = expressions.Count; 4316int n = returns.Count; 4505if (stack.Count == 0) 4525if (stack.Count == 0) 4836if (slotBuilder.Count != 0) 8394if (previousArgumentConversionResults.Count > placeholder.ArgumentIndex) 8412if (placeholder.ArgumentIndex < previousArgumentConversionResults.Count && placeholder.ArgumentIndex >= 0) 9280int n = variables.Count; 9361int n = variables.Count;
FlowAnalysis\NullableWalker.SnapshotManager.cs (1)
175Debug.Assert(_symbolToSlot.Count == _walkerStates.Count);
FlowAnalysis\NullableWalker.Variables.cs (3)
166Debug.Assert(_variableBySlot.Count == 1); 320internal int NextAvailableIndex => _variableBySlot.Count; 333for (index++; index < variableBySlot.Count; index++)
Lowering\ClosureConversion\ClosureConversion.Analysis.cs (2)
144if (function.CapturedEnvironments.Count > 0) 535closureId = new DebugId(closureDebugInfo.Count, _compilationState.ModuleBuilderOpt.CurrentGenerationOrdinal);
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (1)
389Debug.Assert(_labelsInScope.Count == 1);
Lowering\ClosureConversion\ClosureConversion.cs (8)
428else if ((nestedFunction.CapturedEnvironments.Count == 0 && 900var refkindsBuilder = ArrayBuilder<RefKind>.GetInstance(argumentsBuilder.Count); 1154if (prologue.Count > 0) 1189if (newLocals.Count == 0) 1228if (prologue.Count > 0) 1238else if (prologue.Count > 0) 1241var prologueBuilder = ArrayBuilder<BoundStatement>.GetInstance(prologue.Count); 1475lambdaId = new DebugId(_lambdaDebugInfoBuilder.Count, CompilationState.ModuleBuilderOpt.CurrentGenerationOrdinal);
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (2)
207if (fileIndices.Count == 1) 506int spansIndex = _spansBuilder.Count;
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
107if (_lazyPreviousContextVariables is { Count: > 0 })
Lowering\LocalRewriter\LocalRewriter.cs (3)
641for (int i = 0; i < statements.Count; i++) 657if (optimizedInitializers == statements.Count) 667for (int i = 0; i < statements.Count; i++)
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (2)
1088Debug.Assert(whenNodes.Count > 1); 1141&& whenExpressionInfo.WhenNodes.Count > 1;
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (3)
138Debug.Assert(stack.Count >= 1); 146while (stack.Count > 0) 151applyParentUnaryOperator: (stack.Count == 0) ? applyParentUnaryOperator : null);
Lowering\LocalRewriter\LocalRewriter_Call.cs (8)
531Debug.Assert(saveTempsOpt is object || tempsOpt?.Count is null or > 0); 1065Debug.Assert(refKinds.Count == arguments.Length); 1066Debug.Assert(storesToTemps.Count == 0); 1355if (storesToTemps.Count > 0) 1383int tempsRemainedInUse = tempStores.Count; 1412for (int i = firstUnclaimedStore; i < tempStores.Count; i++) 1462Debug.Assert(firstUnclaimedStore == tempStores.Count, "not all side-effects were claimed"); 1482Debug.Assert(argsRefKindsBuilder.Count == parameters.Length);
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (2)
105BoundExpression result = (temps.Count == 0 && stores.Count == 0) ?
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (3)
146length = builder.Count; 153ImmutableArray.Create<BoundExpression>(_factory.Literal(builder.Count)), 169while (stack.Count != 0)
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (5)
224Debug.Assert(leftTargets.Count == rightParts.Length && leftTargets.Count == deconstructConversionInfo.Length); 226var builder = isUsed ? ArrayBuilder<BoundExpression>.GetInstance(leftTargets.Count) : null; 227for (int i = 0; i < leftTargets.Count; i++) 504if (init.Count == 0)
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (1)
53Debug.Assert(statementBuilder.Count == numFixedLocals + 1 + 1);
Lowering\LocalRewriter\LocalRewriter_FunctionPointerInvocation.cs (1)
50if (temps.Count == 0)
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (1)
153if (temps.Count == 0)
Lowering\LocalRewriter\LocalRewriter_IsPatternOperator.cs (5)
124if (_statements.Count != 0) 179if (_sideEffectBuilder.Count != 0) 302if (_sideEffectBuilder.Count > 0 || _conjunctBuilder.Count == 0) 307Debug.Assert(_sideEffectBuilder.Count == 0);
Lowering\LocalRewriter\LocalRewriter_NullCoalescingAssignmentOperator.cs (2)
48return (temps.Count == 0 && stores.Count == 0) ?
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (2)
268int dynamicSiteCount = dynamicSiteInitializers?.Count ?? 0; 269var sideEffects = ArrayBuilder<BoundExpression>.GetInstance(1 + dynamicSiteCount + loweredInitializers.Count);
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (1)
200Debug.Assert(temps.Count == 0);
Lowering\LocalRewriter\LocalRewriter_PatternSwitchStatement.cs (1)
108if (result.Count == 0)
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
84switch (leftFlattened.Count)
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (1)
168else if (appendShouldProceedLocal is not null && resultExpressions.Count > 0)
Lowering\LocalRewriter\LocalRewriter_TupleCreationExpression.cs (4)
55underlyingTupleTypeChain.Count * (NamedTypeSymbol.ValueTupleRestPosition - 1), 69if (underlyingTupleTypeChain.Count > 0) 85(underlyingTupleTypeChain.Count - 1) * (NamedTypeSymbol.ValueTupleRestPosition - 1), 92while (underlyingTupleTypeChain.Count > 0);
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
136for (int i = 0; i < variableBySlot.Count; i++)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (6)
374if (variableCleanup.Count != 0) 384if (hoistedLocalsWithDebugScopes.Count != 0) 454if (_lazyAvailableReusableHoistedFields != null && _lazyAvailableReusableHoistedFields.TryGetValue(type, out fields) && fields.Count > 0) 530if (sideEffects.Count == 0) 738if (hoistedLocalsWithDebugScopes.Count != 0) 742if (newLocalsBuilder.Count == 0)
Lowering\SyntheticBoundNodeFactory.cs (1)
945if (locals.IsDefaultOrEmpty && builder.Count == 0)
Operations\CSharpOperationFactory.cs (2)
1397Debug.Assert(stack.Count > 0); 1412Debug.Assert(left is not null && stack.Count == 0);
Parser\LanguageParser.cs (1)
13203while (stack.Count > 0)
Parser\LanguageParser_InterpolatedString.cs (2)
102for (var i = 0; i < interpolations.Count; i++) 125indentationWhitespace, content, isFirst: interpolations.Count == 0, isLast: true,
SymbolDisplay\SymbolDisplayVisitor.Members.cs (1)
801(format.CompilerInternalOptions.IncludesOption(SymbolDisplayCompilerInternalOptions.IncludeParameterNameIfStandalone) && builder.Count == 0));
Symbols\AbstractTypeMap.cs (2)
165Debug.Assert(builder.Count == customModifiers.Length); 373map.Add(substituted.Type, result.Count);
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (3)
550if (anonymousTypes.Count > 0 && !ReportMissingOrErroneousSymbols(diagnostics)) 578if (anonymousDelegatesWithIndexedNames.Count > 0 || anonymousDelegates.Count > 0)
Symbols\AssemblySymbol.cs (1)
765int i = nestedTypes.Count - 1;
Symbols\Compilation_UsedAssemblies.cs (1)
159while (stack.Count != 0)
Symbols\Metadata\PE\NativeIntegerTypeDecoder.cs (1)
134for (int i = 0; i < allTypeArguments.Count; i++)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (6)
1023count += eventFields.Count; 1042Debug.Assert(result.Count == count); 1379int membersCount = members.Count; 1409int originalCount = members.Count; 1412membersCount += members.Count; // account for added tuple error fields 2053if (symbols.Count == 0)
Symbols\Metadata\PE\PETypeParameterSymbol.cs (1)
198if (symbolsBuilder.Count == 0)
Symbols\NamedTypeSymbol.cs (2)
945for (int i = 0; i < allTypeArguments.Count; i++) 978for (int i = 0; i < allTypeArguments.Count; i++)
Symbols\ReducedExtensionMethodSymbol.cs (1)
208if (useSiteDiagnosticsBuilder != null && useSiteDiagnosticsBuilder.Count > 0)
Symbols\ReferenceManager.cs (1)
599if (linkedReferencedAssembliesBuilder.Count > 0)
Symbols\Retargeting\RetargetingSymbolTranslator.cs (9)
524startOfNonInterfaceArguments = oldArguments.Count; 534var newArguments = ArrayBuilder<TypeWithAnnotations>.GetInstance(oldArguments.Count); 565ArrayBuilder<TypeParameterSymbol> newParameters = ArrayBuilder<TypeParameterSymbol>.GetInstance(newArguments.Count); 578Debug.Assert(newParameters.Count == newArguments.Count); 601for (int i = startOfNonInterfaceArguments; i < oldArguments.Count; i++) 614for (int i = startOfNonInterfaceArguments; i < oldArguments.Count; i++) 627for (int i = startOfNonInterfaceArguments; i < newArguments.Count; i++) 741Debug.Assert(newModifiers == null || newModifiers.Count == oldModifiers.Length);
Symbols\Source\ConstantEvaluationHelpers.cs (4)
57Debug.Assert(order.Count == 0); 108while (pending.Count > 0) 183if (set.Count > 0) 302while (stack.Count > 0)
Symbols\Source\CustomModifierUtils.cs (1)
103int length = flagsBuilder.Count;
Symbols\Source\SourceAssemblySymbol.cs (2)
140moduleBuilder.Add(new PEModuleSymbol(this, netModule, importOptions, moduleBuilder.Count)); 1076for (int i = 0; i < topLevelTypesFromModules.Count - 1; i++)
Symbols\Source\SourceMemberContainerSymbol.cs (20)
1340return symbols.Count > 0 ? 2913Debug.Assert(InstanceInitializersForPositionalMembers.Count != 0); 2950Debug.Assert(insertedInitializers[insertedInitializers.Count - 1].Syntax.SyntaxTree == declaredInitializers[0].Syntax.SyntaxTree); 2951Debug.Assert(insertedInitializers[insertedInitializers.Count - 1].Syntax.Span.Start < declaredInitializers[0].Syntax.Span.Start); 2960Debug.Assert(groupsBuilder.Count == groupCount); 2970Debug.Assert(groupsBuilder.Count == groupCount + 1); 3025if (initializers.Count == 0) 3031var builder = ArrayBuilder<ImmutableArray<FieldOrPropertyInitializer>>.GetInstance(initializers.Count); 3754else if (initializers.Count != 0) 4041members.Add(new SynthesizedRecordDeconstruct(this, ctor, positionalMembers, memberOffset: members.Count, diagnostics)); 4088var copyCtor = new SynthesizedRecordCopyCtor(this, memberOffset: members.Count); 4110members.Add(new SynthesizedRecordClone(this, memberOffset: members.Count, diagnostics)); 4136printMembersMethod = new SynthesizedRecordPrintMembers(this, userDefinedMembers, memberOffset: members.Count, diagnostics); 4210memberOffset: members.Count, 4343members.Add(new SynthesizedRecordObjEquals(this, thisEquals, memberOffset: members.Count, diagnostics)); 4366getHashCode = new SynthesizedRecordGetHashCode(this, equalityContract, memberOffset: members.Count, diagnostics); 4464thisEquals = new SynthesizedRecordEquals(this, equalityContract, memberOffset: members.Count, diagnostics); 4506members.Add(new SynthesizedRecordBaseEquals(this, memberOffset: members.Count, diagnostics)); 4512members.Add(new SynthesizedRecordEqualityOperator(this, memberOffset: members.Count, diagnostics)); 4513members.Add(new SynthesizedRecordInequalityOperator(this, memberOffset: members.Count, diagnostics));
Symbols\Source\SourceNamedTypeSymbol.cs (1)
536Debug.Assert(originalConstraintTypes.Length == mergedConstraintTypes.Count);
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (1)
622if (this.SpecialType == SpecialType.System_Object && ((object)localBase != null || localInterfaces.Count != 0))
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (1)
312if (mergedNamespacesOrTypes.Count == 0)
Symbols\Source\SourceNamespaceSymbol.cs (2)
555Debug.Assert(builder.Count > 1); 557for (int i = 0; (i < builder.Count) && !hasNamespaces; i++)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
564for (int i = 0; i < result.Count; i++)
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
760parameters.Add(new SynthesizedAccessorValueParameterSymbol(this, _property.TypeWithAnnotations, parameters.Count));
Symbols\SubstitutedTypeParameterSymbol.cs (2)
107for (int i = constraintTypes.Count - 1; i >= 0; i--) 122if (constraintTypes.Count == 0)
Symbols\Symbol_Attributes.cs (1)
469if (builder.Count != 0)
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (1)
158if (fields.Count > 0 && !foundBadField)
Symbols\Synthesized\SynthesizedDelegateSymbol.cs (1)
65(Method: this, ParameterCount: parameterDescriptions.Count));
Symbols\Tuples\TupleTypeSymbol.cs (1)
737for (int i = 0; i < elementsMatchedByFields.Count; i++)
Symbols\TypeSymbol.cs (5)
1276for (int i = 0; i < implementations.Count; i++) 1292Debug.Assert(implementations.Count == 1); 1310if (implementations.Count != 0) 1314for (int i = implementations.Count - 1; i >= 0; i--) 1333switch (implementations.Count)
Symbols\TypeSymbolExtensions.cs (1)
1882for (int i = 0; i < typeArgumentsBuilder.Count; i++)
Syntax\CSharpPragmaWarningStateMap.cs (2)
82var entries = new WarningStateMapEntry[directiveList.Count + 1]; 94while (index < directiveList.Count)
Syntax\SyntaxExtensions.cs (1)
408while (stack.Count > 0)
Syntax\SyntaxFacts.cs (1)
565while (stack.Count > 0)
Syntax\SyntaxNormalizer.cs (8)
161for (int i = _indentations.Count; i <= count; i++) 1036(currentTriviaList.Count > 0 && NeedsSeparatorBetween(currentTriviaList.Last())) || 1037(currentTriviaList.Count == 0 && isTrailing); 1040|| (currentTriviaList.Count > 0 && NeedsLineBreakBetween(currentTriviaList.Last(), trivia, isTrailing)); 1080&& (currentTriviaList.Count == 0 || !EndsInLineBreak(currentTriviaList.Last()))) 1090if (currentTriviaList.Count > 0 1115if (currentTriviaList.Count == 0) 1119else if (currentTriviaList.Count == 1)
Utilities\ValueSetFactory.NumericValueSet.cs (2)
217Debug.Assert(builder.Count == 0 || tc.Related(LessThanOrEqual, builder.Last().first, first)); 218if (builder.Count > 0 && (tc.Related(Equal, tc.MinValue, first) || tc.Related(GreaterThanOrEqual, builder.Last().last, tc.Prev(first))))
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (4)
Diagnostics\CompilationEventTests.cs (1)
58if (unexpected || expected.Count != 0 || expectedEvents.Length != actual.Count)
Diagnostics\DiagnosticAnalyzerTests.cs (1)
1831for (int i = 0; i < builder.Count; i++)
Semantics\PatternMatchingTests3.cs (2)
4977for (int i = 0; i < cases.Count; i++) 4979int o = random.Next(i, cases.Count);
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (16)
Binders\EEMethodBinder.cs (1)
57for (int i = 0; i < symbols.Count; i++)
CompilationContext.cs (8)
293=> "<>m" + builder.Count; 410int saveCount = methodBuilder.Count; 423if (saveCount != methodBuilder.Count) 803while (stack.Count > 0) 862Debug.Assert(assembliesAndModulesBuilder.Count == updatedReferences.Count); 945while (stack.Count > 0) 1536for (int i = 0; i < displayClassInstances.Count; i++)
CompilationExtensions.cs (1)
121var bytes = builder.Count > 0 && compilation.HasDynamicEmitAttributes(BindingDiagnosticBag.Discarded, Location.None)
EEAssemblyBuilder.cs (1)
88var def = ToLocalDefinition(local, builder.Count, diagnostics);
EvaluationContext.cs (1)
416if (moduleBuilder != null && locals.Count > 0)
Rewriters\LocalDeclarationRewriter.cs (1)
50if (builder.Count == 0)
Symbols\EEMethodSymbol.cs (2)
149Debug.Assert(ordinal == parameterBuilder.Count); 684Debug.Assert(!(local is EELocalSymbol) || (((EELocalSymbol)local).Ordinal == localBuilder.Count));
SyntaxHelpers.cs (1)
46builder.Count > 0)
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.UnitTests (121)
CompileExpressionsTests.cs (2)
1336Assert.Equal(2, locals.Count); 1503Assert.Equal(3, locals.Count);
DynamicTests.cs (23)
54Assert.Equal(1, locals.Count); 95Assert.Equal(1, locals.Count); 136Assert.Equal(1, locals.Count); 177Assert.Equal(1, locals.Count); 217Assert.Equal(1, locals.Count); 262Assert.Equal(1, locals.Count); 311Assert.Equal(2, locals.Count); 329Assert.Equal(2, locals.Count); 379Assert.Equal(2, locals.Count); 388Assert.Equal(2, locals.Count); 445Assert.Equal(3, locals.Count); 464Assert.Equal(3, locals.Count); 484Assert.Equal(3, locals.Count); 543Assert.Equal(3, locals.Count); 560Assert.Equal(2, locals.Count); 569Assert.Equal(3, locals.Count); 611Assert.Equal(4, locals.Count); 653Assert.Equal(1, locals.Count); 692Assert.Equal(1, locals.Count); 731Assert.Equal(1, locals.Count); 779Assert.Equal(1, locals.Count); 890Assert.Equal(2, locals.Count); 945Assert.Equal(1, locals.Count);
LocalFunctionTests.cs (5)
45Assert.Equal(0, locals.Count); 74Assert.Equal(2, locals.Count); 124Assert.Equal(2, locals.Count); 186Assert.Equal(2, locals.Count); 247Assert.Equal(1, locals.Count);
LocalsTests.cs (88)
50Assert.Equal(0, locals.Count); 85Assert.Equal(4, locals.Count); 169Assert.Equal(4, locals.Count); 228Assert.Equal(4, locals.Count); 323Assert.Equal(3, locals.Count); 387Assert.Equal(3, locals.Count); 451Assert.Equal(1, locals.Count); 479Assert.Equal(1, locals.Count); 548Assert.Equal(4, locals.Count); 619Assert.Equal(4, locals.Count); 721Assert.Equal(2, locals.Count); 791Assert.Equal(1, locals.Count); 804Assert.Equal(6, locals.Count); 883Assert.Equal(2, locals.Count); 922Assert.Equal(1, locals.Count); 968Assert.Equal(2, locals.Count); 1031Assert.Equal(3, locals.Count); 1062Assert.Equal(5, locals.Count); 1106Assert.Equal(2, locals.Count); 1162Assert.Equal(3, locals.Count); 1297Assert.Equal(5, locals.Count); 1371Assert.Equal(4, locals.Count); 1554Assert.Equal(4, locals.Count); 1592Assert.Equal(6, locals.Count); 1631Assert.Equal(7, locals.Count); 1669Assert.Equal(7, locals.Count); 1706Assert.Equal(3, locals.Count); 1718Assert.Equal(4, locals.Count); 1752Assert.Equal(6, locals.Count); 1885Assert.Equal(3, locals.Count); 1936Assert.Equal(2, locals.Count); 2025Assert.Equal(4, locals.Count); 2093Assert.Equal(4, locals.Count); 2155Assert.Equal(2, locals.Count); 2229Assert.Equal(2, locals.Count); 2269Assert.Equal(2, locals.Count); 2311Assert.Equal(2, locals.Count); 2368Assert.Equal(2, locals.Count); 2434Assert.Equal(0, locals.Count); 2478Assert.Equal(0, locals.Count); 2564Assert.Equal(1, locals.Count); 2637Assert.Equal(1, locals.Count); 2678Assert.Equal(5, locals.Count); 2767Assert.Equal(1, locals.Count); 3446Assert.Equal(2, locals.Count); 3498Assert.Equal(2, locals.Count); 3897Assert.Equal(2, locals.Count); 3933Assert.Equal(2, locals.Count); 3994Assert.Equal(2, locals.Count); 4030Assert.Equal(2, locals.Count); 4066Assert.Equal(2, locals.Count); 4125Assert.Equal(2, locals.Count); 4158Assert.Equal(1, locals.Count); 4204Assert.Equal(2, locals.Count); 4239Assert.Equal(1, locals.Count); 4263Assert.Equal(2, locals.Count); 4298Assert.Equal(1, locals.Count); 4341Assert.Equal(2, locals.Count); 4396Assert.Equal(2, locals.Count); 4429Assert.Equal(1, locals.Count); 4478Assert.Equal(2, locals.Count); 4538Assert.Equal(2, locals.Count); 4596Assert.Equal(2, locals.Count); 4657Assert.Equal(3, locals.Count); 4726Assert.Equal(3, locals.Count); 4799Assert.Equal(2, locals.Count); 4833Assert.Equal(1, locals.Count); 4879Assert.Equal(2, locals.Count); 4939Assert.Equal(2, locals.Count); 5003Assert.Equal(2, locals.Count); 5037Assert.Equal(1, locals.Count); 5065Assert.Equal(count, locals.Count); 5105Assert.Equal(count, locals.Count); 5138Assert.Equal(3, locals.Count); 5224Assert.Equal(4, locals.Count); 5334Assert.Equal(3, locals.Count); 5420Assert.Equal(4, locals.Count); 5524Assert.Equal(3, locals.Count); 5606Assert.Equal(4, locals.Count); 5708Assert.Equal(5, locals.Count); 5823Assert.Equal(3, locals.Count); 5908Assert.Equal(3, locals.Count); 5994Assert.Equal(3, locals.Count); 6073Assert.Equal(3, locals.Count); 6154Assert.Equal(3, locals.Count); 6236Assert.Equal(2, locals.Count); 6313Assert.Equal(3, locals.Count); 6400Assert.Equal(3, locals.Count);
TupleTests.cs (3)
220Assert.Equal(1, locals.Count); 268Assert.Equal(1, locals.Count); 465Assert.Equal(1, locals.Count);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\Retargeting\RetargetingTests.cs (1)
60for (int i = 0; i < sourceMethods.Count; i++)
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (9)
DynamicFlagsCustomTypeInfo.cs (1)
19int numFlags = dynamicFlags.Count - startIndex;
ExpressionCompiler.cs (1)
71Debug.Assert((builder.Count == 0) == (assembly.Count == 0));
InstructionDecoder.cs (1)
67var includeArgumentValues = argumentValues != null && parameters.Length == argumentValues.Count;
MetadataUtilities.cs (5)
271Debug.Assert(modules.Count == identities.Count); 277int n = identities.Count; 310Debug.Assert(referencedIndices.Count <= modules.Count); 311Debug.Assert(referencedIndices.Count <= referencedModules.Count);
PDB\MethodDebugInfo.Portable.cs (1)
300Debug.Assert(importGroupBuilder.Count == 0);
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler.Utilities (1)
ExpressionCompilerTestHelpers.cs (1)
361while (names.Count <= slot)
Microsoft.CodeAnalysis.Scripting (4)
Hosting\ObjectFormatter\CommonTypeNameFormatter.cs (1)
261for (int i = nestedTypes.Count - 1; i >= 0; i--)
Script.cs (2)
407var executors = ArrayBuilder<Func<object[], Task>>.GetInstance(scriptsReversed.Count); 411for (int i = scriptsReversed.Count - 1; i >= 0; i--)
Utilities\ParameterValidationHelpers.cs (1)
61throw new ArgumentNullException($"{parameterName}[{builder.Count}]");
Microsoft.CodeAnalysis.Test.Utilities (10)
Compilation\ControlFlowGraphVerifier.cs (3)
471if (block.ConditionalSuccessor != null && block.ConditionalSuccessor.LeavingRegions.Length > regions.Count) 477if (block.FallThroughSuccessor.LeavingRegions.Length > regions.Count) 483if (regions.Count > 0)
Compilation\TestOperationVisitor.cs (1)
73Assert.Equal(count, builder?.Count ?? 0);
CompilationVerifier.cs (1)
520for (int i = 0; i < expected.Count; i++)
CustomDataFlowAnalysis.cs (3)
60Debug.Assert(unreachableBlocksToVisit.Count == 0); 103for (index = 0; index < unreachableBlocksToVisit.Count; index++) 198while (toVisit.Count != 0 || unreachableBlocksToVisit.Count != 0);
Diagnostics\DiagnosticDescription.cs (1)
619int n = lines.Count;
Diagnostics\DiagnosticExtensions.cs (1)
96if (unmatchedActualDescription.Count > 0 || unmatchedExpected.Count > 0)
Microsoft.CodeAnalysis.UnitTests (4)
Analyzers\AnalyzerConfigTests.cs (2)
1579Assert.Equal(2, configs.Count); 1601Assert.Equal(2, configs.Count);
Text\TextChangeTests.cs (2)
986if (oldChangesBuilder.Count == 5) break; 1005if (newChangesBuilder.Count == 5) break;
Microsoft.CodeAnalysis.VisualBasic (440)
Analysis\FlowAnalysis\AbstractFlowPass.NestedTypes.vb (1)
33Dim count As Integer = other.Count
Analysis\FlowAnalysis\AbstractFlowPass.vb (4)
1056Dim level = Me._nesting.Count 2123If stack.Count > 0 Then 2127For i As Integer = 1 To stack.Count - 1 2180If stack.Count > 0 Then
Analysis\FlowAnalysis\DataFlowPass.SlotCollection.vb (1)
38Return Me._builder.Count
Analysis\InitializerRewriter.vb (1)
161If boundStatements.Count = 0 Then
Binding\Binder.vb (1)
223Debug.Assert(methods.Count = 0)
Binding\Binder_Delegates.vb (3)
549Debug.Assert(bestCandidates.Count > 0 AndAlso bestCandidates.Count > 0) 557Debug.Assert(bestCandidates.Count > 1 AndAlso bestSymbols.Length > 1)
Binding\Binder_Expressions.vb (16)
445Debug.Assert(elementNames.Count = inferredElementNames.Count) 446Dim builder = ArrayBuilder(Of Boolean).GetInstance(elementNames.Count) 447For i = 0 To elementNames.Count - 1 476For index = 0 To inferredElementNames.Count - 1 619If symbols.Count = 0 Then 639If symbols.Count = 1 AndAlso symbols(0).Kind = SymbolKind.ErrorType Then 3378If symbols.Count > 0 Then 4270knownSizes(dimension - 1) = DimensionSize.ConstantSize(initializers.Count) 4276ElseIf curSize.Size < initializers.Count Then 4277ReportDiagnostic(diagnostics, node, ERRID.ERR_InitializerTooManyElements1, initializers.Count - curSize.Size) 4280ElseIf curSize.Size > initializers.Count Then 4281ReportDiagnostic(diagnostics, node, ERRID.ERR_InitializerTooFewElements1, curSize.Size - initializers.Count) 4560If results.Count = 1 AndAlso errorReasons = InferenceErrorReasons.Other Then 4577Debug.Assert(results.Count > 1, "internal logic error: if InferenceErrorReasonsAmbiguous, you'd have expected more than 1 candidate") 4578numCandidates = results.Count
Binding\Binder_Invocation.vb (22)
1359Debug.Assert(commonReturnType IsNot Nothing AndAlso bestSymbols.Length > 0 AndAlso bestCandidates.Count >= bestSymbols.Length) 1364If bestCandidates.Count > 0 Then 1378If bestSymbols.Length = 1 AndAlso bestCandidates.Count < 3 Then 1384If bestCandidates.Count > 1 Then 1704If bestCandidates.Count = 0 Then 1721Dim bestSymbolsBuilder = ArrayBuilder(Of Symbol).GetInstance(bestCandidates.Count) 1724If bestCandidates.Count = 1 Then 1743For i As Integer = 0 To bestCandidates.Count - 1 Step 1 1744If i = 0 OrElse Not bestSymbolsBuilder(bestSymbolsBuilder.Count - 1).Equals(bestCandidates(i).Candidate.UnderlyingSymbol) Then 1838Dim diagnosticPerSymbol = ArrayBuilder(Of KeyValuePair(Of Symbol, ImmutableBindingDiagnostic(Of AssemblySymbol))).GetInstance(candidates.Count) 1844For i As Integer = 0 To candidates.Count - 1 Step 1 1853If allowUnexpandedParamArrayForm AndAlso i + 1 < candidates.Count AndAlso 1880Dim diagnosticInfos = ArrayBuilder(Of DiagnosticInfo).GetInstance(candidates.Count) 1882For i As Integer = 0 To diagnosticPerSymbol.Count - 1 1953For i As Integer = 1 To diagnosticPerSymbol.Count - 1 2322If paramArrayItems.Count = 1 Then 2346If paramArrayItems.Count = 0 Then 2393For i As Integer = 0 To paramArrayItems.Count - 1 Step 1 2398Debug.Assert(paramArrayItems.Count = 1) 2711Dim items = ArrayBuilder(Of BoundExpression).GetInstance(paramArrayItems.Count) 2713For i As Integer = 0 To paramArrayItems.Count - 1 Step 1 2724ConstantValue.Create(items.Count),
Binding\Binder_Lambda.vb (5)
754For i As Integer = fields.Count - 1 To 0 Step -1 917If returnExpressions.Count = 0 AndAlso source.Flags = SourceMemberFlags.Async Then 922ElseIf returnExpressions.Count = 0 AndAlso source.Flags = SourceMemberFlags.Iterator Then 931Debug.Assert(returnExpressions.Count < 2) 935If returnExpressions.Count > 0 Then
Binding\Binder_Lookup.vb (13)
509If currentResult.StopFurtherLookup AndAlso currentResult.Symbols.Count > 0 AndAlso 510lookupResult.StopFurtherLookup AndAlso lookupResult.Symbols.Count > 0 Then 1208Dim count As Integer = methods.Count 1555For i As Integer = 0 To symbols.Count - 2 1558For j As Integer = i + 1 To symbols.Count - 1 1588Debug.Assert(resultSymbols.Count > 0) 1592While j < resultSymbols.Count 1740For i As Integer = 0 To knownSymbols.Count - 1 1750For j As Integer = 0 To newSymbols.Count - 1 1803For k = i + 1 To knownSymbols.Count - 1 1829While i < first.Count 1839While j < first.Count 1855While i < second.Count
Binding\Binder_Query.vb (1)
3503If resultList.Count = 1 Then
Binding\Binder_SelectCase.vb (1)
393For index = 0 To caseBlockBuilder.Count - 1
Binding\Binder_Statements.vb (3)
647If array.Count > 1 Then 650For i As Integer = 1 To array.Count - 1 2768For i = conditions.Count - 1 To 0 Step -1
Binding\Binder_Utils.vb (3)
890For i = 0 To params.Count - 1 967For i = 0 To params.Count - 1 1036Dim ordinal = params.Count
Binding\Binder_XmlLiterals.vb (5)
223((rootInfoOpt Is Nothing) OrElse (rootInfoOpt.ImportedNamespaces.Count = 0)) Then 316For i = importedNamespaces.Count - 1 To 0 Step -1 982Debug.Assert(result.Symbols.Count > 0) 1080Debug.Assert(xmlnsAttributes.Count = 0) 1081Debug.Assert(otherAttributes.Count = 0)
Binding\BinderBuilder.vb (2)
195While namespaces.Count > 0 251While types.Count > 0
Binding\DocumentationCommentBinder.vb (5)
177If symbols Is Nothing OrElse symbols.Count < 2 Then 183For i = 0 To symbols.Count - 1 200For i = 0 To symbols.Count - 1 248For i = 0 To indices2remove.Count - 1 253For source = 0 To symbols.Count - 1
Binding\DocumentationCommentCrefBinder.vb (9)
92If symbols.Count = 0 Then 105Debug.Assert(signatureTypes Is Nothing OrElse signatureTypes.Count > 0) 106Dim signatureParameterCount As Integer = If(signatureTypes Is Nothing, 0, signatureTypes.Count) 112While candidatePointer < symbols.Count 379If symbols.Count = 1 AndAlso checkForColorColor Then 595If symbols.Count <> 1 Then 670If symbols.Count <> 1 Then 705Debug.Assert(symbols.Count = 0) 846For i = 0 To symbols.Count - 1
Binding\DocumentationCommentCrefBinder_Compat.vb (6)
105If symbols.Count <> 1 Then 130If symbols.Count <> 1 Then 150If symbols.Count > 0 Then 306If symbols.Count <> 1 Then 327If symbols.Count > 0 Then 428Debug.Assert(lookupResult.Symbols.Count = 1)
Binding\ExecutableCodeBinder.vb (1)
68If labels.Count > 0 Then
Binding\ImportedTypesAndNamespacesMembersBinder.vb (7)
75Debug.Assert(lookupResult.Symbols.Count > 0) ' How can it stop lookup otherwise? 76Debug.Assert(currentResult.Symbols.Count > 0) ' How can it stop lookup otherwise? 91If Not (lookupResult.Symbols.Count = currentResult.Symbols.Count AndAlso 119If lookupResult.IsGood AndAlso lookupResult.Symbols.Count > 1 AndAlso lookupResult.Symbols(0).Kind = SymbolKind.Namespace Then 133Debug.Assert(methods.Count = 0) 139If methods.Count <> 0 AndAlso Not originalBinder.IsSemanticModelBinder Then
Binding\LookupResult.vb (18)
304Return _symList.Count > 0 310Return _symList.Count = 1 371Return _kind = LookupResultKind.Empty AndAlso _symList.Count = 0 AndAlso _diagInfo Is Nothing 664For i = 0 To _symList.Count - 1 677If lost = _symList.Count Then 684Debug.Assert(lost + ambiguous < _symList.Count) 694Debug.Assert(ambiguous = _symList.Count - lost) 699Debug.Assert(_symList.Count > 0) 707If _symList.Count = 1 AndAlso ambiguous = 1 AndAlso AreEquivalentEnumConstants(_symList(0), other.Symbol) Then 729For i = 0 To _symList.Count - 1 763For i = 0 To _symList.Count - 1 769Debug.Assert(i < _symList.Count) 770Dim left As Integer = _symList.Count - lost 774For j = i + 1 To _symList.Count - 1 785For j = j + 1 To _symList.Count - 1 798For i = 0 To _symList.Count - 1 810For i = i + 1 To _symList.Count - 1 907Me.StopFurtherLookup AndAlso Me.Symbols.Count > 0 Then
Binding\MemberSemanticModel.vb (1)
2250While rightOperands.Count > 0
Binding\NamedTypeBinder.vb (1)
102Debug.Assert(methods.Count = 0)
Binding\NamespaceBinder.vb (1)
88Debug.Assert(methods.Count = 0)
Binding\SyntheticBoundTrees\SynthesizedPropertyAccessorBase.vb (2)
230For i As Integer = 0 To eventsToHookup.Count - 1 311For i As Integer = 0 To eventsToHookup.Count - 1
Binding\TypesOfImportedNamespacesMembersBinder.vb (3)
69Debug.Assert(methods.Count = 0) 73Dim count = methods.Count 75If methods.Count <> count AndAlso Not originalBinder.IsSemanticModelBinder Then
BoundTree\BoundTreeRewriter.vb (1)
138Loop While stack.Count > 0
BoundTree\BoundTreeWalker.vb (1)
99While rightOperands.Count > 0
CodeGen\CodeGenerator.vb (2)
128Debug.Assert(yieldPoints.Count > 0, "Why it was allocated?") 133For i = 0 To yieldPoints.Count - 1
CodeGen\EmitArrayInitializer.vb (1)
159Debug.Assert(indices.Count = arrayType.Rank - 1)
CodeGen\EmitOperators.vb (1)
193Debug.Assert(stack.Count = 0)
CodeGen\EmitStatement.vb (4)
102Debug.Assert(_asyncYieldPoints.Count = _asyncResumePoints.Count) 108Debug.Assert((_asyncYieldPoints.Count - 1) = _asyncResumePoints.Count)
CodeGen\Optimizer\StackScheduler.Analyzer.vb (3)
155Return _evalStack.Count 167SetStackDepth(_evalStack.Count - 1) 960If stack.Count = 0 Then
CodeGen\Optimizer\StackScheduler.Rewriter.vb (1)
93If stack.Count = 0 Then
Compilation\DocumentationComments\DocumentationCommentCompiler.Common.vb (3)
273If nodes Is Nothing OrElse nodes.Count < 2 Then 280For i = 0 To nodes.Count - 1 285For i = 0 To array.Count - 2
Compilation\DocumentationComments\DocumentationCommentCompiler.Includes.vb (4)
62sourceIncludeElementNodes.Count = 0, 171Debug.Assert(sourceIncludeElementNodes.Count > 0) 202Debug.Assert(expander._nextSourceIncludeElementIndex = expander._sourceIncludeElementNodes.Count) 589Debug.Assert(_nextSourceIncludeElementIndex < _sourceIncludeElementNodes.Count)
Compilation\DocumentationComments\DocumentationCommentCompiler.NamedType.vb (2)
67If multipleDocComments.Count > 1 Then 80ElseIf multipleDocComments.Count = 0 Then
Compilation\MethodCompiler.vb (9)
373If builder.Count = 0 Then 377For index = 0 To builder.Count - 1 1078constructorsInPath.Add(currentMethod, constructorsPath.Count) 1086ReportConstructorCycles(foundAt, constructorsPath.Count - 1, constructorsPath, diagnostics) 1151If diagnosticInfos.Count > 1 Then 1716While index >= awaiters.Count 1724While index >= hoistedVariables.Count 1736While awaiters.Count < previousAwaiterCount 1741While hoistedVariables.Count < previousAwaiterSlotCount
Compilation\SemanticModel.vb (5)
870If symbolsBuilder.Count = 0 Then 872ElseIf symbolsBuilder.Count = 1 Then 1311If symbolsBuilder.Count > 0 Then 1367If symbolsBuilder.Count > 0 Then 2839If symbols.Count = 0 Then
Compilation\SyntaxTreeSemanticModel.vb (1)
702Debug.Assert(symbolBuilder.Count = 0)
Compilation\VisualBasicCompilation.vb (10)
1599If entryPointCandidates.Count = 0 Then 1620If viableEntryPoints.Count = 0 Then 1626ElseIf viableEntryPoints.Count > 1 Then 1731If unusedBuilder IsNot Nothing AndAlso unusedBuilder.Count > 0 Then 1732If unusedBuilder.Count = numClauseSpans Then 3219spine.RemoveAt(spine.Count - 1) 3238spine.RemoveAt(spine.Count - 1) 3242If spine.Count = 0 Then 3246Dim symbol = GetCachedSymbol(spine(spine.Count - 1)) 3252For i = 1 To spine.Count - 1
Declarations\DeclarationTreeBuilder.vb (4)
416While index < typeStack.Count 433nestedTypeIndices.Add(typeStack.Count) 447Debug.Assert(index = typeStack.Count) 477For i = 0 To nestedTypes.Count - 1
Declarations\MergedNamespaceDeclaration.vb (2)
117Select Case childNamespaces.Count 141If singleTypeDeclarations.Count <> 0 Then
Emit\PEModuleBuilder.vb (9)
510index = builder.Count 553Debug.Assert(stack.Count = 0) 556While stack.Count > 0 566Dim index = builderOpt.Count 652While namespacesAndTopLevelTypesToProcess.Count > 0 679Debug.Assert(debugDocuments.Count = 0) 681Debug.Assert(typesToProcess.Count = 0) 700If debugDocuments.Count > 0 Then 717While typesToProcess.Count > 0
Lowering\AsyncRewriter\AsyncRewriter.AsyncMethodToClassRewriter.Expressions.vb (1)
300If initializersBuilder.Count = 0 Then
Lowering\AsyncRewriter\AsyncRewriter.AsyncMethodToClassRewriter.Spilling.vb (1)
165For index = spillBuilders.Count - 1 To 0 Step -1
Lowering\AsyncRewriter\AsyncRewriter.SpillBuilder.vb (1)
115If other Is Nothing OrElse other.Count = 0 Then
Lowering\AsyncRewriter\AsyncRewriter.vb (2)
552Debug.Assert(result.Symbols.Count > 0) 611Debug.Assert(result.Symbols.Count > 0)
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter.vb (1)
836Debug.Assert(result.Symbols.Count > 0)
Lowering\Instrumentation\CodeCoverageInstrumenter.vb (2)
207If fileIndices.Count = 1 Then 459Dim spansIndex As Integer = _spansBuilder.Count
Lowering\LambdaRewriter\LambdaRewriter.vb (6)
719If newLocals.Count = 0 Then 793If newLocals.Count <> 0 Then 794Debug.Assert(newLocals.Count = 1, "must be only one local that is the frame reference") 825If prologue.Count <> 0 Then 970closureId = New DebugId(closureDebugInfo.Count, CompilationState.ModuleBuilderOpt.CurrentGenerationOrdinal) 1011lambdaId = New DebugId(_lambdaDebugInfoBuilder.Count, CompilationState.ModuleBuilderOpt.CurrentGenerationOrdinal)
Lowering\LocalRewriter\LocalRewriter_BinaryOperators.vb (1)
139Debug.Assert(stack.Count = 0)
Lowering\LocalRewriter\LocalRewriter_Block.vb (1)
43Debug.Assert(builder.Count < node.Locals.Length)
Lowering\LocalRewriter\LocalRewriter_ForTo.vb (1)
166If cacheAssignments.Count > 0 Then
Lowering\LocalRewriter\LocalRewriter_LateBindingHelpers.vb (1)
322Debug.Assert(initializers.Count = 0, "once we have named argument all following arguments must be named")
Lowering\LocalRewriter\LocalRewriter_RedimClause.vb (1)
88If temporaries.Count > 0 Then
Lowering\LocalRewriter\LocalRewriter_StringConcat.vb (1)
69Select Case leftFlattened.Count
Lowering\LocalRewriter\LocalRewriter_TupleLiteralExpression.vb (4)
45underlyingTupleTypeChain.Count * (TupleTypeSymbol.RestPosition - 1), 65If underlyingTupleTypeChain.Count > 0 Then 84(underlyingTupleTypeChain.Count - 1) * (TupleTypeSymbol.RestPosition - 1), 90Loop While (underlyingTupleTypeChain.Count > 0)
Lowering\LocalRewriter\LocalRewriter_UnstructuredExceptionHandling.vb (6)
181Dim resumeSwitchJumps(1 + _unstructuredExceptionHandling.ResumeTargets.Count - 1) As BoundGotoStatement 187For i As Integer = 0 To _unstructuredExceptionHandling.ResumeTargets.Count - 1 220Dim onErrorSwitchJumps(2 + _unstructuredExceptionHandling.ExceptionHandlers.Count - 1) As BoundGotoStatement 227For i As Integer = 0 To _unstructuredExceptionHandling.ExceptionHandlers.Count - 1 353newErrorHandlerIndex = s_activeHandler_FirstNonReservedOnErrorGotoIndex + _unstructuredExceptionHandling.ExceptionHandlers.Count 464nodeFactory.Literal(_unstructuredExceptionHandling.ResumeTargets.Count)).ToStatement())
Lowering\MethodToClassRewriter\MethodToClassRewriter.vb (1)
379If prologue.Count > 0 Then
Lowering\StateMachineRewriter\StateMachineRewriter.StateMachineMethodToClassRewriter.vb (1)
278If hoistedLocalsWithDebugScopes.Count > 0 Then
Lowering\StateMachineRewriter\StateMachineRewriter.vb (1)
151If initializers.Count > 0 Then
Operations\VisualBasicOperationFactory.vb (2)
560Debug.Assert(stack.Count > 0) 578Debug.Assert(left IsNot Nothing AndAlso stack.Count = 0)
Parser\BlockContexts\CompilationUnitContext.vb (7)
197Debug.Assert(rewriter._declarationBlocksBeingVisited.Count = 0) 198Debug.Assert(rewriter._parentsOfRegionDirectivesAwaitingClosure.Count = 0) ' We never add parents of not closed #Region directives into this stack. 438Debug.Assert(_declarationBlocksBeingVisited.Count > 1 OrElse containingBlock.Kind = SyntaxKind.CompilationUnit) 440If _declarationBlocksBeingVisited.Count > 1 Then 446containingBlock = _declarationBlocksBeingVisited(_declarationBlocksBeingVisited.Count - 2) 453containingBlock = _declarationBlocksBeingVisited(_declarationBlocksBeingVisited.Count - 2) 465If _parentsOfRegionDirectivesAwaitingClosure.Count > 0 Then
Semantics\AccessCheck.vb (4)
463While baseInterfaces.Count <> 0 1047Debug.Assert(illegalExposure.Count > 0) 1120Debug.Assert(illegalExposure.Count > 0) 1167Debug.Assert(illegalExposure.Count > 0)
Semantics\Conversions.vb (1)
3860If queueIndex < queue.Count Then
Semantics\Operators.vb (30)
1956If opSet.Count = 0 Then 1962conversionKinds.ZeroInit(opSet.Count) 1964Dim applicable = BitVector.Create(opSet.Count) 1973ElseIf opSet.Count = 0 Then 1983ElseIf opSet.Count = 0 Then 1991conversionKinds.ZeroInit(opSet.Count) 2043For i As Integer = 0 To opSet.Count - 1 2098For i As Integer = 0 To opSet.Count - 1 2170For i As Integer = 0 To opSet.Count - 1 2194For i As Integer = 0 To opSet.Count - 1 2202Debug.Assert(typeSet.Count = applicableCount) 2214For i As Integer = 0 To opSet.Count - 1 2222Debug.Assert(typeSet.Count = applicableCount) 2239For i As Integer = 0 To opSet.Count - 1 2267For i As Integer = 0 To opSet.Count - 1 2380For i As Integer = 0 To opSet.Count - 1 2445For i As Integer = 0 To opSet.Count - 1 2564For i As Integer = 0 To opSet.Count - 1 2587For i As Integer = 0 To opSet.Count - 1 2603Debug.Assert(typeSet.Count = applicableCount OrElse (haveWideningInConversions <> 0 AndAlso typeSet.Count = haveWideningInConversions)) 2619For i As Integer = 0 To opSet.Count - 1 2635Debug.Assert(typeSet.Count = applicableCount OrElse (haveWideningOutConversions <> 0 AndAlso typeSet.Count = haveWideningOutConversions)) 2657For i As Integer = 0 To opSet.Count - 1 2681For i As Integer = 0 To typeSet.Count - 1 2690For j As Integer = 0 To typeSet.Count - 1 2726For i As Integer = 0 To typeSet.Count - 1 2735For j As Integer = 0 To typeSet.Count - 1 3152If opSet.Count = 0 Then
Semantics\OverloadResolution.vb (49)
920If instanceCandidates.Count > 0 Then 951If curriedCandidates.Count > 0 Then 1048For i As Integer = 0 To candidates.Count - 1 Step 1 1196For i As Integer = 0 To candidates.Count - 1 Step 1 1242indexesOfEqualMostApplicableCandidates.Count = CountApplicableCandidates(candidates)) Then 1251Debug.Assert(indexesOfEqualMostApplicableCandidates.Count > 0) 1255For i As Integer = 0 To candidates.Count - 1 Step 1 1259If nextMostApplicable < indexesOfEqualMostApplicableCandidates.Count Then 1262indexOfNextMostApplicable = candidates.Count 1282applicableCandidates = indexesOfEqualMostApplicableCandidates.Count 1304For i As Integer = 0 To candidates.Count - 1 Step 1 1329Debug.Assert(buckets.Count > 0) 1334For i As Integer = 0 To buckets.Count - 1 Step 1 1339For i As Integer = 0 To buckets.Count - 1 Step 1 1369For i As Integer = 0 To candidates.Count - 1 Step 1 1440Dim applicableCandidates As Integer = bucket.Count 1442For i = 0 To bucket.Count - 1 Step 1 1449For j = i + 1 To bucket.Count - 1 Step 1 1628For i As Integer = 0 To candidates.Count - 1 Step 1 1645For i As Integer = 0 To candidates.Count - 1 Step 1 1722For i As Integer = 0 To candidates.Count - 1 Step 1 1755For i As Integer = 0 To candidates.Count - 1 Step 1 1761Debug.Assert(indexesOfApplicableCandidates.Count = applicableCandidates) 1777For i As Integer = 0 To indexesOfApplicableCandidates.Count - 2 1784For j As Integer = i + 1 To indexesOfApplicableCandidates.Count - 1 1855For i As Integer = 0 To candidates.Count - 1 Step 1 1872For i As Integer = 0 To candidates.Count - 1 Step 1 2185For i = 0 To candidates.Count - 1 Step 1 2194left.EquallyApplicableCandidatesBucket = buckets.Count + 1 2201For j = i + 1 To candidates.Count - 1 Step 1 2350For i = 0 To candidates.Count - 2 Step 1 2370If i < candidates.Count - 1 Then 2381For i = i To candidates.Count - 2 Step 1 2462For i As Integer = 0 To candidates.Count - 1 Step 1 2494For i As Integer = 0 To candidates.Count - 1 Step 1 2498For j As Integer = i + 1 To candidates.Count - 1 Step 1 2560For i As Integer = 0 To candidates.Count - 1 Step 1 2602For i As Integer = 0 To candidates.Count - 1 Step 1 2631For i As Integer = 0 To candidates.Count - 1 Step 1 2901If useSiteDiagnosticsBuilder IsNot Nothing AndAlso useSiteDiagnosticsBuilder.Count > 0 Then 3002If paramArrayItems.Count = 1 AndAlso arguments(paramArrayItems(0)).IsNothingLiteral() AndAlso Not forceExpandedForm Then 3030For j As Integer = 0 To paramArrayItems.Count - 1 Step 1 3507For i As Integer = 0 To group.Count - 1 3541For j As Integer = i + 1 To group.Count - 1 3558ElseIf applicableCount = quickInfo.Count Then 3572For k As Integer = 0 To If(applicableCount > 0 OrElse Not includeEliminatedCandidates, applicableCount, quickInfo.Count) - 1 3587For l As Integer = k + 1 To quickInfo.Count - 1 3647For l As Integer = k + 1 To quickInfo.Count - 1 3928While i < results.Count
Semantics\TypeInference\Graph.vb (4)
105Dim lastIndex As Integer = list.Count - 1 196Dim oldListSize = resultList.Count 197resultList.AddMany(Nothing, Vertices.Count) 198Dim newListSize = resultList.Count
Semantics\TypeInference\TypeArgumentInference.vb (11)
226Dim numberOfIncomingEdges As Integer = IncomingEdges.Count 269Dim numberOfTypeHints As Integer = InferenceTypeCollection.GetTypeDataList().Count() 312If dominantTypeDataList.Count = 1 Then 776If childNodes.Count = 1 Then 808DirectCast(child, TypeParameterNode).InferenceTypeCollection.GetTypeDataList().Count > 0 Then 960If paramArrayItems.Count = 1 AndAlso arguments(paramArrayItems(0)).IsNothingLiteral() Then 979For j As Integer = 0 To paramArrayItems.Count - 1 Step 1 2296Debug.Assert(typeInfos.Count() >= 2, "Must have at least 2 elements in the list") 2299For i As Integer = 1 To typeInfos.Count - 1 Step 1 2311If typeInfos.Count < 1 Then 2316For i As Integer = 1 To typeInfos.Count - 1 Step 1
Semantics\TypeInference\TypeInferenceCollection.vb (8)
205Debug.Assert(resultList.Count() = numberOfUnstrictCandidates, "code logic error: we should have >1 unstrict candidates, like we calculated earlier") 285If resultList.Count > 1 Then 288For i As Integer = 0 To resultList.Count - 1 306For i As Integer = 1 To resultList.Count - 1 318For i As Integer = 1 To resultList.Count - 1 377If resultList.Count = 1 Then 382If resultList.Count > 1 Then 400Debug.Assert(resultList.Count > 0, "code logic error: we already said there were multiple strict candidates")
Symbols\AnonymousTypes\AnonymousTypeManager_Templates.vb (1)
239If builder.Count > 0 AndAlso Not Me.CheckAndReportMissingSymbols(builder, diagnostics) Then
Symbols\ConstraintsHelper.vb (2)
272If constraintsBuilder.Count <> constraints.Length Then 296Dim n = constraints.Count
Symbols\EmbeddedSymbols\EmbeddedSymbolManager.SymbolsCollection.vb (1)
117Debug.Assert(builder.Count = 0)
Symbols\MergedNamespaceSymbol.vb (7)
125Debug.Assert(namespaceArray.Count <> 0) 127If (namespaceArray.Count = 1) Then 170Debug.Assert(namespaceArray.Count <> 0) 172If (namespaceArray.Count = 1) Then 654Debug.Assert(namespaceArray.Count <> 0) 655If namespaceArray.Count = 0 Then 662If namespaceArray.Count = 1 Then
Symbols\ReducedExtensionMethodSymbol.vb (1)
128If typeParametersToFix.Count = toFixCount Then
Symbols\ReferenceManager.vb (1)
515If linkedReferencedAssembliesBuilder.Count > 0 Then
Symbols\Retargeting\RetargetingNamedTypeSymbol.vb (2)
192Dim oldCount As Integer = methods.Count 198For i As Integer = oldCount To methods.Count - 1
Symbols\Retargeting\RetargetingNamespaceSymbol.vb (2)
221Dim oldCount As Integer = methods.Count 228For i As Integer = oldCount To methods.Count - 1
Symbols\Retargeting\RetargetingSymbolTranslator.vb (9)
423startOfNonInterfaceArguments = oldArguments.Count 448Dim newArguments = ArrayBuilder(Of TypeWithModifiers).GetInstance(oldArguments.Count) 478Dim newParameters = ArrayBuilder(Of TypeParameterSymbol).GetInstance(newArguments.Count) 489Debug.Assert(newParameters.Count = newArguments.Count) 511For i As Integer = startOfNonInterfaceArguments To oldArguments.Count - 1 Step 1 521For i As Integer = startOfNonInterfaceArguments To oldArguments.Count - 1 Step 1 531For i As Integer = startOfNonInterfaceArguments To newArguments.Count - 1 Step 1 626Debug.Assert(newModifiers Is Nothing OrElse newModifiers.Count = oldModifiers.Length)
Symbols\Source\ImplementsHelper.vb (6)
236Dim candidatesCount As Integer = If(candidates IsNot Nothing, candidates.Count, 0) 240For i As Integer = 0 To candidates.Count - 2 247For j As Integer = i + 1 To candidates.Count - 1 270For i As Integer = 0 To candidates.Count - 2 281For j As Integer = i + 1 To candidates.Count - 1 318For i As Integer = 0 To candidates.Count - 1
Symbols\Source\OverloadingHelper.vb (1)
44If overloadedMembers.Count = 1 AndAlso Not hasOverloadSpecifier AndAlso Not hasOverrideSpecifier Then
Symbols\Source\OverrideHidingHelper.vb (9)
244Dim diagnosticInfos = ArrayBuilder(Of DiagnosticInfo).GetInstance(unimplementedMembers.Count) 263If diagnosticInfos.Count > 0 Then 713If overriddenInThisType.Count > 1 Then 717If overriddenInThisType.Count > 0 Then 723If overriddenBuilder.Count = 0 Then 819For i = 0 To builder.Count - 1 933If members.Count < 2 Then 966If nonConflicting.Count <> members.Count Then
Symbols\Source\SourceAssemblySymbol.vb (1)
101moduleBuilder.Add(New PEModuleSymbol(Me, netModule, importOptions, moduleBuilder.Count))
Symbols\Source\SourceDelegateMethodSymbol.vb (1)
349parameters.Add(New SynthesizedParameterSymbol(Me, iAsyncResultType, parameters.Count, False, StringConstants.DelegateMethodResultParameterName))
Symbols\Source\SourceFieldSymbol.vb (4)
246Debug.Assert(order.Count = 0) 293While pending.Count > 0 429If [set].Count > 0 Then 534While stack.Count > 0
Symbols\Source\SourceMemberContainerTypeSymbol.vb (4)
362Debug.Assert(infosBuffer.Count = 0) 560Return diagnostics IsNot Nothing AndAlso diagnostics.Count > 0 2846If candidates.Count = 1 AndAlso candidates(0).Kind = SymbolKind.Event Then 3004Debug.Assert(definedSymbols.Count > 0)
Symbols\Source\SourceModuleSymbol.vb (2)
651trees.Count, 720While stack.Count > 0
Symbols\Source\SourceNamedTypeSymbol.vb (1)
932Debug.Assert(syntaxRefBuilder.Count > 0)
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (5)
192If interfaceMembers.Count = 0 AndAlso eventMembers.Count = 0 Then 198If eventMembers.Count = 0 Then 538For i As Integer = 0 To interfaceMembers.Count - 1 1331If attributes.Count = toClone.Length Then
Symbols\Source\SourceNamedTypeSymbol_GroupClass.vb (4)
69If Not haveBaseTypes AndAlso baseTypes.Count > 0 AndAlso baseTypes.Last() IsNot Nothing Then 83If collectionTypes.Count > 0 Then 91For i As Integer = 0 To collectionTypes.Count - 1 97(i < collectionTypes.Count - 1 AndAlso IdentifierComparison.Equals(current.Key.Name, collectionTypes(i + 1).Key.Name))
Symbols\Source\SourceNamespaceSymbol.vb (2)
193Debug.Assert(builder.Count > 1) 196For i = 0 To builder.Count - 1
Symbols\Source\SourcePropertyAccessorSymbol.vb (3)
427Dim valueParameter = parameters(parameters.Count - 1) 438Dim overriddenParameter = overriddenMethod.Parameters(parameters.Count - 1) 442parameters(parameters.Count - 1) = valueParameter
Symbols\Tuples\TupleTypeSymbol.vb (4)
442Debug.Assert(nonTupleTypeChain.Count > 1) 450Loop While nonTupleTypeChain.Count <> 0 780members.Add(New TupleFieldSymbol(Me, field.AsMember(currentUnderlying), -members.Count - 1)) 824For i As Integer = 0 To elementsMatchedByFields.Count - 1
Symbols\TypeSubstitution.vb (5)
178For i As Integer = 0 To result.Count - 1 423If pairs.Count > 0 Then 454If pairs.Count > 0 Then 718If pairs.Count = 0 AndAlso adjustedParent Is Nothing Then 895Debug.Assert(builder.Count = customModifiers.Length)
Symbols\TypeSymbolExtensions.vb (1)
88Debug.Assert(elementTypesBuilder.Count = cardinality)
Symbols\UsedAssemblies.vb (1)
118While stack.Count <> 0
Syntax\InternalSyntax\SyntaxNodeExtensions.vb (1)
801If conditionalAccessStack Is Nothing OrElse conditionalAccessStack.Count = 0 Then
Syntax\SyntaxNormalizer.vb (7)
96For i As Integer = _indentations.Count To count 215(currentTriviaList.Count > 0 AndAlso NeedsSeparatorBetween(currentTriviaList.Last()) AndAlso Not EndsInLineBreak(currentTriviaList.Last())) OrElse 216(currentTriviaList.Count = 0 AndAlso isTrailing) 220(currentTriviaList.Count > 0 AndAlso NeedsLineBreakBetween(currentTriviaList.Last(), trivia, isTrailing)) 264If currentTriviaList.Count > 0 AndAlso EndsInLineBreak(currentTriviaList.Last()) Then 286If currentTriviaList.Count = 0 Then 292ElseIf currentTriviaList.Count = 1 Then
Syntax\VisualBasicSyntaxNode.vb (1)
79While stack.Count > 0
Utilities\TypeUnification.vb (3)
212For i As Integer = 0 To substitutionPairs.Count ' intentionally going 1 past end of current range 213If i > substitutionPairs.Count - 1 OrElse substitutionPairs(i).Key.ContainingType.IsSameOrNestedWithin(tp.ContainingType) Then 219Dim count = substitutionPairs.Count
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (7)
Attributes\AssemblyAttributes.vb (4)
2072Assert.Equal(1, list.Count) 2127Assert.Equal(1, list.Count) 2176Assert.Equal(1, list.Count) 2224Assert.Equal(1, list.Count)
CodeGen\CodeGenNullable.vb (3)
6677newBlock = newBlock.ReplaceToken(newBlock.SubOrFunctionStatement.Identifier, SyntaxFactory.Identifier("Test" + (newBlocks.Count + 1).ToString())) 6679Loop While newBlocks.Count < batchSize AndAlso enumerator.MoveNext() 6681Dim newRoot = tree1.GetRoot().ReplaceNode(invocation, Enumerable.Range(1, newBlocks.Count).
Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ExpressionCompiler (12)
Binders\EENamedTypeBinder.vb (2)
61For i As Integer = 0 To symbols.Count - 1 86Debug.Assert(methods.Count = 0)
CompilationContext.vb (5)
185Return String.Format("<>m{0}", builder.Count) 588While stack.Count > 0 625While stack.Count > 0 1079Dim startIndex = displayClassInstances.Count 1185While i < displayClassInstances.Count()
EEAssemblyBuilder.vb (1)
100Dim def = ToLocalDefinition(local, builder.Count, diagnostics)
EvaluationContext.vb (1)
473If modulebuilder IsNot Nothing AndAlso locals.Count > 0 Then
Symbols\EEMethodSymbol.vb (2)
116Debug.Assert(ordinal = parameterBuilder.Count) 582Debug.Assert(TypeOf targetLocal IsNot EELocalSymbol OrElse DirectCast(targetLocal, EELocalSymbol).Ordinal = localBuilder.Count)
SyntaxHelpers.vb (1)
28If ParseFormatSpecifiers(builder, expr, syntax.Expression.FullWidth, diagnostics) AndAlso builder.Count > 0 Then
Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ExpressionCompiler.UnitTests (46)
LocalsTests.vb (40)
39Assert.Equal(0, locals.Count) 70Assert.Equal(4, locals.Count) 154Assert.Equal(1, locals.Count) 166Assert.Equal(6, locals.Count) 256Assert.Equal(2, locals.Count) 309Assert.Equal(2, locals.Count) 352Assert.Equal(1, locals.Count) 400Assert.Equal(3, locals.Count) 482Assert.Equal(4, locals.Count) 514Assert.Equal(6, locals.Count) 560Assert.Equal(2, locals.Count) 636Assert.Equal(3, locals.Count) 672Assert.Equal(5, locals.Count) 766Assert.Equal(locals.Count, 2) 792Assert.Equal(locals.Count, 4) 915Assert.Equal(locals.Count, 4) 938Assert.Equal(locals.Count, 6) 973Assert.Equal(locals.Count, 7) 1010Assert.Equal(locals.Count, 7) 1072Assert.Equal(3, locals.Count) 1083Assert.Equal(4, locals.Count) 1116Assert.Equal(6, locals.Count) 1261Assert.Equal(3, locals.Count) 1321Assert.Equal(2, locals.Count) 1376Assert.Equal(4, locals.Count) 1450Assert.Equal(4, locals.Count) 1541Assert.Equal(2, locals.Count) 1616Assert.Equal(2, locals.Count) 1675Assert.Equal(2, locals.Count) 1730Assert.Equal(0, locals.Count) 1796Assert.Equal(2, locals.Count) 1840Assert.Equal(1, locals.Count) 1879Assert.Equal(locals.Count, 5) 1969Assert.Equal(1, locals.Count) 2697Assert.Equal(2, locals.Count) 2752Assert.Equal(2, locals.Count) 3260Assert.Equal(2, locals.Count) 3299Assert.Equal(2, locals.Count) 3318Assert.Equal(count, locals.Count) 3353Assert.Equal(count, locals.Count)
StaticLocalsTests.vb (3)
209Assert.Equal(4, locals.Count) 251Assert.Equal(3, locals.Count) 293Assert.Equal(2, locals.Count)
TupleTests.vb (3)
223Assert.Equal(1, locals.Count) 270Assert.Equal(1, locals.Count) 457Assert.Equal(1, locals.Count)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (17)
Binding\LookupTests.vb (14)
201Assert.Equal(1, r19.Symbols.Count) 205Assert.Equal(2, r19.Symbols.Count) 209Assert.Equal(3, r19.Symbols.Count) 216Assert.Equal(1, r19.Symbols.Count) 327Assert.Equal(1, lr.Symbols.Count) 335Assert.Equal(1, lr.Symbols.Count) 343Assert.Equal(1, lr.Symbols.Count) 351Assert.Equal(1, lr.Symbols.Count) 359Assert.Equal(1, lr.Symbols.Count) 367Assert.Equal(4, lr.Symbols.Count) 378Assert.Equal(3, lr.Symbols.Count) 1505Assert.Equal(1, lr.Symbols.Count) 1516Assert.Equal(1, lr.Symbols.Count) 1530Assert.Equal(1, lr.Symbols.Count)
Diagnostics\CompilationEventTests.vb (1)
49If unexpected OrElse expected.Count <> 0 OrElse expectedEvents.Length <> actual.Count Then
Diagnostics\DiagnosticAnalyzerTests.vb (1)
1292For i As Integer = 0 To builder.Count - 1
Semantics\BinaryOperators.vb (1)
1348For i As Integer = 0 To builder1.Count - 1
Roslyn.Test.PdbUtilities (4)
Reader\MethodDebugInfoBytes.cs (4)
79if ((_bytesBuilder.Count % 4) != 0) 84Assert.Equal(0, _bytesBuilder.Count % 4); 111Assert.Equal(0, _bytesBuilder.Count % 4); 124Assert.Equal(0, _bytesBuilder.Count % 4);