2296 references to Item
Aspire.Hosting (3)
ApplicationModel\ResourceNotificationService.cs (2)
448if (commands[i].Name == name) 450return commands[i];
src\Shared\CustomResourceSnapshotExtensions.cs (1)
15var property = properties[i];
Aspire.Hosting.Azure (1)
src\Shared\CustomResourceSnapshotExtensions.cs (1)
15var property = properties[i];
BuildActionTelemetryTable (1)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
252hashCode = unchecked((hashCode ^ data[i]) * Hash.FnvPrime);
BuildValidator (1)
PEReaderExtensions.cs (1)
116SectionHeader containingSection = reader.PEHeaders.SectionHeaders[index];
IdeBenchmarks (1)
InheritanceMargin\InheritanceMarginGlyphBenchmarks.cs (1)
106var tag = _tags[j];
illink (4)
ILLink.RoslynAnalyzer (26)
DataFlow\ControlFlowGraphProxy.cs (2)
232 new BlockProxy (ControlFlowGraph.Blocks[region.Region.FirstBlockOrdinal]); 235 new BlockProxy (ControlFlowGraph.Blocks[region.Region.LastBlockOrdinal]);
DataFlow\LocalDataFlowVisitor.cs (3)
769 var argument = arguments[argumentIndex]; 774 argumentOperation = callOperation.Arguments[argumentIndex]; 777 argumentOperation = callOperation.Arguments[argumentIndex];
DynamicallyAccessedMembersAnalyzer.cs (9)
225 var methodTypeParameterAnnotation = overrideMethod.TypeParameters[i].GetDynamicallyAccessedMemberTypes (); 226 var overriddenMethodTypeParameterAnnotation = baseMethod.TypeParameters[i].GetDynamicallyAccessedMemberTypes (); 231 var attributableSymbol = attributableMethod.TypeParameters[i]; 236 || (overrideMethod.TypeParameters[i].TryGetAttribute (DynamicallyAccessedMembersAnalyzer.DynamicallyAccessedMembersAttribute, out var _) 237 && baseMethod.TypeParameters[i].TryGetAttribute (DynamicallyAccessedMembersAnalyzer.DynamicallyAccessedMembersAttribute, out var _)) 240 var typeParameterOrigin = origin ?? overrideMethod.TypeParameters[i]; 244 overrideMethod.TypeParameters[i].GetDisplayName (), overrideMethod.GetDisplayName (), 245 baseMethod.TypeParameters[i].GetDisplayName (), baseMethod.GetDisplayName ())); 292 && methodSymbol.Parameters[methodSymbol.Parameters.Length - 1].GetDynamicallyAccessedMemberTypes () != DynamicallyAccessedMemberTypes.None) {
RequiresAnalyzerBase.cs (2)
88 var typeParam = typeParams[i]; 89 var typeArg = typeArgs[i];
src\tools\illink\src\ILLink.Shared\TrimAnalysis\HandleCallAction.cs (2)
1318 var targetValue = _annotations.GetGenericParameterValue (genericParameters[i].GenericParameter, GetGenericParameterEffectiveMemberTypes (genericParameters[i]));
TrimAnalysis\GenericArgumentDataFlow.cs (2)
43 var typeArgument = typeArguments[i]; 45 var genericParameterValue = new GenericParameterValue (typeParameters[i]);
TrimAnalysis\ParameterProxy.cs (4)
25 switch (Method.Method.Parameters[MetadataIndex].RefKind) { 31 Debug.Fail ($"Unexpected RefKind {Method.Method.Parameters[MetadataIndex].RefKind} found on parameter {GetDisplayName ()}"); 39 public IParameterSymbol? ParameterSymbol => IsImplicitThis ? null : Method.Method.Parameters[MetadataIndex]; 49 : new TypeProxy (Method.Method.Parameters[MetadataIndex].Type);
TrimAnalysis\TrimAnalysisMethodCallPattern.cs (2)
60 argumentsBuilder.Add (lattice.Meet (Arguments[i], other.Arguments[i]));
Microsoft.Analyzers.Extra (7)
CallAnalysis\Fixers\LegacyLoggingFixer.cs (5)
185matchParams = invocationArgList[i].Equals(methodSymbol.Parameters[i].Type, SymbolEqualityComparer.Default); 386parameters.Add(gen.ParameterDeclaration("exception", gen.TypeExpression(invocationOp.Arguments[details.ExceptionParamIndex].Value.Type!))); 398var paramsArg = invocationOp.Arguments[details.ArgsParamIndex]; 436args.Add(invocationOp.Arguments[details.ExceptionParamIndex].Value.Type!); 447var paramsArg = invocationOp.Arguments[details.ArgsParamIndex];
CallAnalysis\Fixers\LegacyLoggingFixer.FixDetails.cs (2)
44var op = invocationOp.Arguments[MessageParamIndex]; 106var op = invocationOp.Arguments[LogLevelParamIndex].Descendants().SingleOrDefault(x => x.Kind == OperationKind.Literal || x.Kind == OperationKind.FieldReference);
Microsoft.AspNetCore.Analyzers (8)
CompilationFeatureDetector.cs (2)
39var semanticModel = compilation.GetSemanticModel(syntaxReferences[j].SyntaxTree); 41var syntax = await syntaxReferences[j].GetSyntaxAsync(cancellationToken).ConfigureAwait(false);
OptionsFacts.cs (1)
15var item = analysis.Options[i];
StartupAnalysis.cs (2)
29if (list[i] is T item) 46if (list[i] is T item)
StartupFacts.cs (2)
33if (members[i] is IMethodSymbol method && (IsConfigureServices(symbols, method) || IsConfigure(symbols, method))) 112if (SymbolEqualityComparer.Default.Equals(symbol.Parameters[i].Type, symbols.IApplicationBuilder))
UseAuthorizationAnalyzer.cs (1)
35var middlewareItem = middlewareAnalysis.Middleware[i];
Microsoft.AspNetCore.App.Analyzers (28)
Infrastructure\AmbiguousRoutePatternComparer.cs (6)
28var xPart = x.Root.Parts[i]; 29var yPart = y.Root.Parts[i]; 61var xChild = x.Children[i]; 62var yChild = y.Children[i]; 134var xPart = x.PolicyFragments[i]; 135var yPart = y.PolicyFragments[i];
Infrastructure\EmbeddedSyntax\EmbeddedSeparatedSyntaxNodeList.cs (4)
44Debug.Assert(NodesAndTokens[i].IsNode); 45Debug.Assert(NodesAndTokens[i].Node is EmbeddedSyntaxNode<TSyntaxKind, TSyntaxNode>); 50Debug.Assert(!NodesAndTokens[i].IsNode); 66var nodeOrToken = NodesAndTokens[index * 2];
Infrastructure\RoutePattern\RoutePatternNodes.cs (4)
37return Parts[index]; 57=> Children[index]; 133return ParameterParts[index - 1]; 332_ => PolicyFragments[index - 1],
Mvc\DetectAmbiguousActionRoutes.cs (4)
60if (routePattern.Root.Parts[i] is RoutePatternSegmentNode segment) 64if (segment.Children[j] is RoutePatternReplacementNode replacementNode) 75else if (segment.Children[j] is RoutePatternParameterNode parameterNode) 79if (parameterNode.ParameterParts[k] is RoutePatternNameParameterPartNode namePartNode)
RenderTreeBuilder\RenderTreeBuilderAnalyzer.cs (1)
62&& targetMethod.Parameters[SequenceParameterOrdinal].Name == "sequence";
RouteEmbeddedLanguage\Infrastructure\RouteStringSyntaxDetector.cs (2)
431return parameters[index]; 509return parameters[index];
RouteEmbeddedLanguage\RoutePatternAnalyzer.cs (1)
122var routeParameter = routeParameters[i];
RouteHandlers\DetectAmbiguousRoutes.cs (4)
239var argument1 = GetParameterArgument(method.Parameters[i], arguments1); 240var argument2 = GetParameterArgument(method.Parameters[i], arguments2); 275if (SymbolEqualityComparer.Default.Equals(arguments[i].Parameter, parameter)) 277return WalkDownConversion(arguments[i].Value);
RouteHandlers\RouteHandlerAnalyzer.cs (1)
208var parmeterType = targetMethod.Parameters[DelegateParameterOrdinal].Type;
src\Shared\Roslyn\MvcFacts.cs (1)
136if (method.ExplicitInterfaceImplementations[i].ContainingType.SpecialType == SpecialType.System_IDisposable)
Microsoft.AspNetCore.App.Analyzers.Test (1)
RouteEmbeddedLanguage\RoutePatternParserTests.cs (1)
217var actual = routeParameter.Policies[i].Substring(1).Replace("{{", "{").Replace("}}", "}");
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
StaticRouteHandlerModel\Endpoint.cs (1)
57var parameterSymbol = method.Parameters[i];
Microsoft.AspNetCore.Mvc.Analyzers (5)
src\Shared\Roslyn\MvcFacts.cs (1)
136if (method.ExplicitInterfaceImplementations[i].ContainingType.SpecialType == SpecialType.System_IDisposable)
TopLevelParameterNameAnalyzer.cs (4)
66var parameter = method.Parameters[i]; 161var namedArgument = attribute.NamedArguments[i]; 184var namedArgument = attribute.NamedArguments[i]; 198if (string.Equals(constructorParameters[i].Name, "binderType", StringComparison.Ordinal))
Microsoft.AspNetCore.Mvc.Api.Analyzers (10)
ActualApiResponseMetadataFactory.cs (3)
108var arm = switchExpression.Arms[i]; 268if (SymbolEqualityComparer.Default.Equals(property.ExplicitInterfaceImplementations[i], statusCodeActionResultStatusProperty)) 284if (attributes[i].AttributeClass.Name == attributeName)
src\Shared\Roslyn\MvcFacts.cs (1)
136if (method.ExplicitInterfaceImplementations[i].ContainingType.SpecialType == SpecialType.System_IDisposable)
SymbolApiConventionMatcher.cs (3)
34var conventionParameter = conventionMethodParameters[i]; 48if (!IsTypeMatch(methodParameters[i].Type, conventionParameter.Type, typeMatchBehavior) || 49!IsNameMatch(methodParameters[i].Name, conventionParameter.Name, nameMatchBehavior))
SymbolApiResponseMetadataProvider.cs (3)
191var namedArgument = attribute.NamedArguments[i]; 210var parameter = constructorParameters[i]; 219var argument = attribute.ConstructorArguments[i];
Microsoft.Build (1)
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (1)
54var (minValue, maxValue) = _numberRangePairs[i];
Microsoft.Cci.Extensions (1)
Extensions\CSharp\CSharpCciExtensions.cs (1)
970array[i] = (byte)argumentValue[i].Value;
Microsoft.CodeAnalysis (316)
CodeGen\PrivateImplementationDetails.cs (2)
539if (x.Constants[i] != y.Constants[i])
CodeGen\SwitchIntegralJumpTableEmitter.cs (3)
266this.EmitSwitchBucket(switchBuckets[i], nextBucketLabel); 272this.EmitSwitchBucket(switchBuckets[high], _fallThroughLabel); 296ConstantValue pivotConstant = switchBuckets[mid - 1].EndConstant;
CodeGen\SwitchIntegralJumpTableEmitter.SwitchBucket.cs (5)
96return _allLabels[i + _startLabelIndex]; 145var lastLabel = allLabels[_startLabelIndex].Value; 149var switchLabel = allLabels[idx]; 249return _allLabels[_startLabelIndex].Key; 257return _allLabels[_endLabelIndex].Key;
Collections\ByteSequenceComparer.cs (2)
38if (x[i] != y[i])
Collections\ImmutableArrayExtensions.cs (20)
194builder.Add(map(items[i], i, arg)); 359builder[i] = await selector(array[i], cancellationToken).ConfigureAwait(false); 377builder[i] = await selector(array[i], arg, cancellationToken).ConfigureAwait(false); 438builder[i] = map(self[i], other[i]); 456builder.Add(map(self[i], other[i], i, arg)); 489var a = array[i]; 523builder.Add(array[j]); 551var a = array[i]; 567var a = array[i]; 583var a = array[i]; 599var a = array[i]; 615var a = array[i]; 1048if (predicate(items[i])) 1070sum += selector(items[i], i); 1215if (!predicate(array1[i], array2[i], arg)) 1233if (comparer.Compare(array[i - 1], array[i]) > 0)
CommandLine\AnalyzerConfig.SectionNameMatching.cs (1)
52var (minValue, maxValue) = _numberRangePairs[i];
CommandLine\AnalyzerConfigSet.cs (7)
206var config = _analyzerConfigs[analyzerConfigIndex]; 227ImmutableArray<SectionNameMatcher?> matchers = _analyzerMatchers[analyzerConfigIndex]; 230if (matchers[sectionIndex]?.IsMatch(relativePath) == true) 232var section = config.NamedSections[sectionIndex]; 273AnalyzerConfig config = _analyzerConfigs[analyzerConfigIndex]; 274ImmutableArray<SectionNameMatcher?> matchers = _analyzerMatchers[analyzerConfigIndex]; 277if (sectionKey[sectionKeyIndex] == config.NamedSections[matcherIndex])
CommandLine\CommonCompiler.cs (4)
1027var options = sourceFileAnalyzerConfigOptions[i].AnalyzerOptions; 1042var options = additionalFileOptions[i].AnalyzerOptions; 1047Debug.Assert(existing.GetOptions(additionalFiles[i]) == DictionaryAnalyzerConfigOptions.Empty); 1048builder.Add(additionalFiles[i], new DictionaryAnalyzerConfigOptions(options));
Compilation\Compilation.cs (8)
674var reference = result[i]; 1318if (elementTypes[i] == null) 1323if (!elementLocations.IsDefault && elementLocations[i] == null) 1372if (elementNames[i] == "") 1495if (memberTypes[i] == null) 1500if (memberNames[i] == null) 1505if (!memberLocations.IsDefault && memberLocations[i] == null) 3633result = FirstSourceLocation(result, locations[i]);
Compilation\DeterministicKeyBuilder.cs (1)
305writeModuleMetadata(modules[i]);
Compilation\SyntaxTreeOptionsProvider.cs (1)
67new Options(results.IsDefault ? null : (AnalyzerConfigOptionsResult?)results[i]));
Diagnostic\DiagnosticBag.cs (1)
130bag.Enqueue(diagnostics[i]);
DiagnosticAnalyzer\AnalyzerDriver.cs (2)
1213DiagnosticAnalysisContextHelpers.VerifyDiagnosticLocationsInCompilation(diagnostics[i], compilation); 1216var diagnostic = suppressMessageState.ApplySourceSuppressions(diagnostics[i]);
DiagnosticAnalyzer\AnalyzerManager.cs (1)
212var symbolStartAction = symbolStartActions[i];
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (7)
510return TypeInfo.Create(methodContext.TypeParameters[methodTypeParameterIndex]); 552if (methodContext.TypeParameters[i].Name == typeParameterName) 554return TypeInfo.Create(methodContext.TypeArguments[i]); 564if (containingType.TypeParameters[i].Name == typeParameterName) 566return TypeInfo.Create(containingType.TypeArguments[i]); 784if (!ParameterMatches(symbolParameters[i], expectedParameters[i])) 848return typeParameters[index];
DocumentationCommentId.cs (5)
493var p = parameters[i]; 605this.Visit(symbol.TypeArguments[i]); 991results.Add(methodContext.TypeParameters[methodTypeParameterIndex]); 1388if (!ParameterMatches(symbolParameters[i], expectedParameters[i])) 1422return typeParameters[index];
Emit\AnonymousTypeKey.cs (1)
99builder.Append(this.Fields[i].Name);
Emit\CommonPEModuleBuilder.cs (1)
469string alias = aliases[i];
Emit\EditAndContinue\DefinitionMap.cs (4)
35=> LambdaSymbols.BinarySearch(lambdaId, static (info, id) => info.id.CompareTo(id)) is int i and >= 0 ? LambdaSymbols[i].symbol : null; 193declaratorToIndex.Add(declarators[i], i); 504var slot = hoistedLocalSlots[slotIndex]; 516var slot = hoistedAwaiters[slotIndex];
Emit\EditAndContinue\DeltaMetadataWriter.cs (4)
184tableSizes[i] = previousTableSizes[i] + deltaTableSizes[i]; 567? DeletedMethodBody.GetIL(context, orderedLambdaRuntimeRudeEdits[rudeEditIndex].RudeEdit, isLambdaOrLocalFunction: true) 781var paramDef = paramDefinitions[i]; 1384Debug.Assert(rowCounts[i] == 0);
Emit\EditAndContinue\EmitBaseline.cs (1)
495sizes[i] = reader.GetTableRowCount((TableIndex)i) + delta[i];
Emit\EditAndContinue\EncVariableSlotAllocator.cs (1)
86var localInfo = previousLocals[slot];
Emit\NoPia\EmbeddedTypesManager.cs (5)
108Cci.INamespaceTypeDefinition current = _frozen[i]; 115Debug.Assert(_frozen[i - 1] == prev); 118ReportNameCollisionBetweenEmbeddedTypes(_frozen[i - 1], _frozen[i], diagnostics); 125reportedDuplicate = HasNameConflict(namesOfTopLevelTypes, _frozen[i], diagnostics);
Generated\Operations.Generated.cs (32)
4015=> Operations[index], 4070=> Declarations[index], 4134=> Cases[index], 4228=> NextVariables[index], 4310=> Before[index], 4316=> AtLoopBottom[index], 4420=> NextVariables[index], 4742=> Catches[index], 5027=> Arguments[index], 5178=> Arguments[index], 5245=> Indices[index], 5476=> Arguments[index], 5936=> Arguments[index], 6055=> DimensionSizes[index], 6593=> Parts[index], 6649=> Initializers[index], 6705=> Initializers[index], 6879=> Elements[index], 7722=> ElementValues[index], 7782=> IgnoredArguments[index], 7851=> IgnoredDimensions[index], 7853=> Declarators[index], 8071=> Clauses[index], 8073=> Body[index], 9118=> Clauses[index], 9178=> DimensionSizes[index], 9248=> DeconstructionSubpatterns[index], 9250=> PropertySubpatterns[index], 9337=> Arms[index], 10308=> Arguments[index], 10375=> Patterns[index], 10686=> Elements[index],
InternalUtilities\Hash.cs (1)
252hashCode = unchecked((hashCode ^ data[i]) * Hash.FnvPrime);
InternalUtilities\OneOrMany.cs (1)
82return _many[index];
InternalUtilities\StringExtensions.cs (1)
27return (number < numerals.Length) ? numerals[number] : number.ToString();
MetadataReader\MetadataDecoder.cs (1)
1653var parameterType = attributeConstructor.Parameters[i].Type;
MetadataReader\PEAssembly.cs (1)
73ImmutableArray<AssemblyIdentity> refsForModule = modules[i].ReferencedAssemblies;
MetadataReader\PEModule.cs (1)
2984AttributeDescription.TypeHandleTargetInfo targetInfo = AttributeDescription.TypeHandleTargets[targetSignature[j + 1]];
MetadataReference\AssemblyIdentity.cs (1)
444result.Add(hash[l - i]);
MetadataReference\AssemblyMetadata.cs (4)
207if (modules[i] == null) 212if (!modules[i].IsImageOwner) 398previousData.Modules[i].Dispose(); 420var module = modules[i].Module;
NativePdbWriter\PdbWriter.cs (1)
471var currentScope = scopes[i];
Operations\ControlFlowBranch.cs (3)
142if (leavingRegions[i].Kind == ControlFlowRegionKind.Try && leavingRegions[i + 1].Kind == ControlFlowRegionKind.TryAndFinally) 149builder.Add(leavingRegions[i + 1].NestedRegions.Last());
Operations\ControlFlowGraph.cs (1)
252Debug.Assert(localFunction == LocalFunctions[info.ordinal]);
Operations\ControlFlowGraphBuilder.cs (14)
467ControlFlowRegion @catch = tryAndCatch.NestedRegions[i]; 1419if (VisitStatementsOneOrAll(statements[i], statements, i)) 2052if (arguments[i].Value is IInterpolatedStringHandlerCreationOperation creation) 2078var argument = arguments[i].Value switch 2093var originalArgument = (ArgumentOperation)args[index]; 4808builder[--parametersCount] = new ArgumentOperation(ArgumentKind.Explicit, method.Parameters[parametersCount], 4814builder[--parametersCount] = new ArgumentOperation(ArgumentKind.Explicit, method.Parameters[parametersCount], 4823builder[--parametersCount] = new ArgumentOperation(ArgumentKind.Explicit, method.Parameters[parametersCount], 6389var simpleAssignment = (ISimpleAssignmentOperation)operation.Initializers[i]; 6522IOperation elementValue = initializer.ElementValues[i]; 6555return elements[index] is ISpreadOperation spread ? 6700elementBuilder.Add(PopTargetAndWrapTupleIfNecessary(tuple.Elements[i])); 6818if (arguments[i] is { Value: IInterpolatedStringHandlerArgumentPlaceholderOperation { PlaceholderKind: InterpolatedStringArgumentPlaceholderKind.TrailingValidityArgument } } arg) 7048IInterpolatedStringContentOperation element = operation.Parts[i];
Operations\ControlFlowRegion.cs (1)
112ControlFlowRegion r = NestedRegions[i];
Operations\IOperation.OperationList.Reversed.cs (1)
63builder.Add(input[i]);
Operations\OperationExtensions.cs (2)
246return argumentNames.IsDefaultOrEmpty ? null : argumentNames[index]; 325return argumentRefKinds[index];
Operations\OperationNodes.cs (5)
32=> Children[index], 103=> Children[index], 268=> Arguments[index], 348=> Arguments[index], 434=> Arguments[index],
PEWriter\CustomDebugInfoWriter.cs (1)
216if (dynamicTransformFlags[k])
PEWriter\InstructionOperandTypes.cs (2)
15byte operation = il[position++]; 18return (OperandType)TwoByte[il[position++]];
PEWriter\MetadataWriter.cs (8)
611IParameterDefinition parDef = parameters[i]; 3098return buffer[pos]; 3103return buffer[pos] | buffer[pos + 1] << 8 | buffer[pos + 2] << 16 | buffer[pos + 3] << 24; 3477SerializeMetadataExpression(in attributeContext, fixedArgsEncoder.AddArgument(), arguments[i], parameters[i].GetType(Context));
PEWriter\MetadataWriter.DynamicAnalysis.cs (8)
145var currentDocument = spans[i].Document; 154SerializeDeltaLinesAndColumns(writer, spans[i]); 160writer.WriteCompressedInteger(spans[i].StartLine); 161writer.WriteCompressedInteger(spans[i].StartColumn); 165writer.WriteCompressedSignedInteger(spans[i].StartLine - previousStartLine); 166writer.WriteCompressedSignedInteger(spans[i].StartColumn - previousStartColumn); 169previousStartLine = spans[i].StartLine; 170previousStartColumn = spans[i].StartColumn;
PEWriter\MetadataWriter.PortablePdb.cs (16)
521if (vector[i]) 589writer.WriteUInt32((uint)asyncInfo.YieldOffsets[i]); 590writer.WriteUInt32((uint)asyncInfo.ResumeOffsets[i]); 651var currentDocument = sequencePoints[i].Document; 669writer.WriteCompressedInteger(sequencePoints[i].Offset - sequencePoints[i - 1].Offset); 673writer.WriteCompressedInteger(sequencePoints[i].Offset); 676if (sequencePoints[i].IsHidden) 683SerializeDeltaLinesAndColumns(writer, sequencePoints[i]); 689writer.WriteCompressedInteger(sequencePoints[i].StartLine); 690writer.WriteCompressedInteger(sequencePoints[i].StartColumn); 694writer.WriteCompressedSignedInteger(sequencePoints[i].StartLine - previousNonHiddenStartLine); 695writer.WriteCompressedSignedInteger(sequencePoints[i].StartColumn - previousNonHiddenStartColumn); 698previousNonHiddenStartLine = sequencePoints[i].StartLine; 699previousNonHiddenStartColumn = sequencePoints[i].StartColumn; 710if (sequencePoints[i].Document != singleDocument)
ReferenceManager\AssemblyDataForAssemblyBeingBuilt.cs (5)
50refs.AddRange(modules[i].ReferencedAssemblies); 88Debug.Assert(assemblies[_referencedAssemblyData[i].Identity.Name].Contains((_referencedAssemblyData[i], i + 1))); 89boundReferences[i] = new AssemblyReferenceBinding(_referencedAssemblyData[i].Identity, i + 1); 96_referencedAssemblies[i],
ReferenceManager\CommonReferenceManager.Binding.cs (25)
122explicitAssembliesMap.Add(explicitAssemblies[i].Identity.Name, (explicitAssemblies[i], i)); 129referenceBindings.Add(explicitAssemblies[i].BindAssemblyReferences(explicitAssembliesMap, IdentityComparer)); 407var moduleReference = explicitReferences[explicitModuleToReferenceMap[moduleIndex]]; 408var moduleBindingsCount = explicitModules[moduleIndex].ReferencedAssemblies.Length; 422var explicitReferenceMapping = explicitReferenceMap[referenceIndex]; 430(explicitReferences[referenceIndex], 450var resolvedReference = resolvedReferences[i]; 469result.Add(GetResolvedReferenceAndFreePropertyMapEntry(references[i], explicitAssemblyCount - 1 + i, MetadataImageKind.Assembly, propertyMapOpt)); 595if (!assemblies[i].ContainsNoPiaLocalTypes) 600foreach (TAssemblySymbol candidateAssembly in assemblies[i].AvailableSymbols) 606if (IsLinked(candidateAssembly) != assemblies[i].IsLinked) 633if (assemblies[j].IsMatchingAssembly(assembly) && 634IsLinked(assembly) == assemblies[j].IsLinked) 741if (boundInputs[i].AssemblySymbol != null || assemblies[i].ContainsNoPiaLocalTypes) 746foreach (TAssemblySymbol candidateAssembly in assemblies[i].AvailableSymbols) 803if (IsLinked(candidate.AssemblySymbol) != assemblies[candidateIndex].IsLinked) 869if (!assemblies[definitionIndex].IsMatchingAssembly(currentCandidateReferencedSymbol)) 876if (assemblies[definitionIndex].ContainsNoPiaLocalTypes) 884if (IsLinked(currentCandidateReferencedSymbol) != assemblies[definitionIndex].IsLinked) 924if (!assemblies[corLibraryIndex].IsMatchingAssembly(candidateCorLibrary)) 931Debug.Assert(!assemblies[corLibraryIndex].ContainsNoPiaLocalTypes); 932Debug.Assert(!assemblies[corLibraryIndex].IsLinked); 999var assembly = assemblies[i];
ReferenceManager\CommonReferenceManager.Resolution.cs (4)
248var boundReference = references[referenceIndex]; 272location = referenceDirectiveLocations[referenceIndex]; 419referenceMap[i] = GetResolvedReferenceAndFreePropertyMapEntry(references[i], reversedIndex, referenceMap[i].Kind, lazyAliasMap); 900boundReferences[j] = ResolveReferencedAssembly(references[j], definitions, resolveAgainstAssemblyBeingBuilt, assemblyIdentityComparer);
ReferenceManager\CommonReferenceManager.State.cs (19)
481if (referenceMap[i].IsSkipped) 486if (referenceMap[i].Kind == MetadataImageKind.Module) 489int moduleIndex = 1 + referenceMap[i].Index; 490referencedModulesMap.Add(references[i], moduleIndex); 495int assemblyIndex = referenceMap[i].Index; 498MetadataReference reference = references[i]; 500aliasesOfReferencedAssembliesBuilder.Add(referenceMap[i].AliasesOpt); 502if (!referenceMap[i].MergedReferences.IsEmpty) 504(mergedAssemblyReferencesMapOpt ??= new Dictionary<MetadataReference, ImmutableArray<MetadataReference>>()).Add(reference, referenceMap[i].MergedReferences); 507hasRecursiveAliases |= !referenceMap[i].RecursiveAliasesOpt.IsDefault; 549var symbolIdentity = symbols[i].Identity; 550var versionPattern = symbols[i].AssemblyVersionPattern; 551var originalIdentity = originalIdentities[i]; 682return ReferencedAssembliesMap.Select(ra => KeyValuePairUtil.Create(ra.Key, (IAssemblySymbolInternal)ReferencedAssemblies[ra.Value])); 688return ReferencedAssembliesMap.TryGetValue(reference, out index) ? ReferencedAssemblies[index] : null; 704if ((object)ReferencedAssemblies[entry.Value] == assemblySymbol) 717yield return (ReferencedAssemblies[i], AliasesOfReferencedAssemblies[i]); 723var aliases = AliasesOfReferencedAssemblies[referencedAssemblyIndex];
SignatureComparer.cs (10)
48int paramCount = signature[position++]; 92int paramCount = signature[position++]; 142SignatureTypeCode typeCode = (SignatureTypeCode)signature[position]; 171SignatureTypeCode typeCode = (SignatureTypeCode)signature[position++]; 191int countOfDimensions = signature[position++]; 202paramPosition = signature[position++]; 206paramPosition = signature[position++]; 215int argumentCount = signature[position++]; 238var firstByte = signature[position++]; 241return (short)(signature[position++] + WellKnownType.ExtSentinel);
SourceGeneration\GeneratorDriver.cs (10)
105states.Add(_state.GeneratorStates[existingIndex]); 123if (generators.Contains(newGenerators[i])) 230var generator = state.IncrementalGenerators[i]; 231var generatorState = state.GeneratorStates[i]; 232var sourceGenerator = state.Generators[i]; 315if (shouldSkipGenerator(state.Generators[i]) || generatorState.OutputNodes.Length == 0) 320using var generatorTimer = CodeAnalysisEventSource.Log.CreateSingleGeneratorRunTimer(state.Generators[i], (t) => t.Add(syntaxStoreBuilder.GetRuntimeAdjustment(stateBuilder[i].InputNodes))); 328stateBuilder[i] = generatorState.WithResults(ParseAdditionalSources(state.Generators[i], sources, cancellationToken), generatorDiagnostics, generatorRunStateTable.ExecutedSteps, generatorRunStateTable.OutputSteps, hostOutputs, generatorTimer.Elapsed); 330catch (UserFunctionException ufe) when (handleGeneratorException(compilation, MessageProvider, state.Generators[i], ufe.InnerException, isInit: false)) 332stateBuilder[i] = SetGeneratorException(compilation, MessageProvider, generatorState, state.Generators[i], ufe.InnerException, diagnosticsBag, cancellationToken, runTime: generatorTimer.Elapsed);
SourceGeneration\Nodes\BatchNode.cs (1)
80if (!EqualityComparer<TInput>.Default.Equals(entry.Item, previousItems[indexInPrevious]))
SourceGeneration\Nodes\InputNode.cs (2)
86var modified = tableBuilder.TryModifyEntry(inputItems[itemIndex], _comparer, elapsedTime, noInputStepsStepInfo, EntryState.Modified); 88itemsSet.Remove(inputItems[itemIndex]);
SourceGeneration\Nodes\NodeStateTable.cs (6)
138_step = _stateTable.HasTrackedSteps ? _stateTable.Steps[_nextStatesIndex] : null; 139_inputEntry = _stateTable._states[_nextStatesIndex]; 385var replacementItem = outputs[i]; 425builder!.Add(outputs[i], EntryState.Added); 471previousEntry = canUsePrevious ? _previous._states[previousTableEntryIndex] : default; 630public EntryState GetState(int index) => _states.Length == 1 ? _states[0] : _states[index];
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (9)
435var importString = importStrings[pos]; 455var importString = importStrings[pos]; 527return bytes[i] | (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24); 539return (short)(bytes[i] | (bytes[i + 1] << 8)); 551return bytes[i];
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
603Add(items[i]);
Symbols\Attributes\CommonAttributeData.cs (3)
150return constructorArgs[i].DecodeValue<T>(specialType); 173return index >= 0 ? namedArguments[index].Value.DecodeValue<T>(specialType) : defaultValue; 183if (string.Equals(namedArguments[i].Key, name, StringComparison.Ordinal))
Symbols\Attributes\SecurityWellKnownAttributeData.cs (1)
77Cci.ICustomAttribute attribute = customAttributes[i];
Symbols\ISymbolExtensions.cs (3)
38var arg = method.TypeArguments[i]; 39var typeParameter = method.TypeParameters[i]; 54var inferredType = method.GetTypeInferredDuringReduction(reducedFrom.TypeParameters[i]);
Syntax\LineDirectiveMap.cs (2)
127return this.Entries[r]; 187var next = Entries[i];
Text\CompositeText.cs (16)
44Debug.Assert(_segments[i].Length > 0); 45offset += _segments[i].Length; 79return _segments[index][offset]; 99var segment = _segments[segIndex]; 157var segment = _segments[segIndex]; 446var segment = compositeText.Segments[i]; 455Debug.Assert(i == compositeText.Segments.Length - 1 || segment[^1] != '\r' || compositeText.Segments[i + 1][0] != '\n'); 480var segment = _compositeText.Segments[segmentIndex]; 483return _segmentLineNumbers[segmentIndex] + lineNumberWithinSegment; 499var firstSegmentFirstLineNumber = _segmentLineNumbers[firstSegmentIndexInclusive]; 500var firstSegment = _compositeText.Segments[firstSegmentIndexInclusive]; 510var nextSegment = _compositeText.Segments[nextSegmentIndex]; 522var lastSegment = _compositeText.Segments[lastSegmentIndexInclusive]; 547if (_segmentLineNumbers[firstSegmentIndexInclusive] != lineNumber) 554var previousSegment = _compositeText.Segments[firstSegmentIndexInclusive - 1]; 564if (_segmentLineNumbers[lastSegmentIndexInclusive + 1] != lineNumber)
Text\LargeText.cs (4)
44offset += chunks[i].Length; 148return _chunks[i][position - _chunkStartOffsets[i]]; 167var chunk = _chunks[chunkIndex]; 202var chunk = _chunks[chunkIndex];
Text\TextChangeRangeExtensions.cs (2)
345oldChange = oldChanges[oldIndex]; 360newChange = new UnadjustedNewChange(newChanges[newIndex]);
Microsoft.CodeAnalysis.CodeStyle (88)
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
198var statement = statements[i];
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchStatementHelpers.cs (1)
22if (HasDefaultCase(switchStatement.Cases[index]))
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
133return IsInvariantCultureReference(invocation.Arguments[formatProviderArgumentIndex].Value)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (1)
59falseStatement = parentBlock.Operations[ifIndex + 1];
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (3)
150statements[ifOperationIndex + 1].Syntax, 151statements[expressionStatementIndex - 1].Syntax); 178expressionStatement = containingBlock.Operations[i] as IExpressionStatementOperation;
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (20)
194builder.Add(map(items[i], i, arg)); 359builder[i] = await selector(array[i], cancellationToken).ConfigureAwait(false); 377builder[i] = await selector(array[i], arg, cancellationToken).ConfigureAwait(false); 438builder[i] = map(self[i], other[i]); 456builder.Add(map(self[i], other[i], i, arg)); 489var a = array[i]; 523builder.Add(array[j]); 551var a = array[i]; 567var a = array[i]; 583var a = array[i]; 599var a = array[i]; 615var a = array[i]; 1048if (predicate(items[i])) 1070sum += selector(items[i], i); 1215if (!predicate(array1[i], array2[i], arg)) 1233if (comparer.Compare(array[i - 1], array[i]) > 0)
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (7)
510return TypeInfo.Create(methodContext.TypeParameters[methodTypeParameterIndex]); 552if (methodContext.TypeParameters[i].Name == typeParameterName) 554return TypeInfo.Create(methodContext.TypeArguments[i]); 564if (containingType.TypeParameters[i].Name == typeParameterName) 566return TypeInfo.Create(containingType.TypeArguments[i]); 784if (!ParameterMatches(symbolParameters[i], expectedParameters[i])) 848return typeParameters[index];
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
252hashCode = unchecked((hashCode ^ data[i]) * Hash.FnvPrime);
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (1)
82return _many[index];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
27return (number < numerals.Length) ? numerals[number] : number.ToString();
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
345oldChange = oldChanges[oldIndex]; 360newChange = new UnadjustedNewChange(newChanges[newIndex]);
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
603Add(items[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (1)
316var (minValue, maxValue) = _numberRangePairs[i];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSeparatedSyntaxNodeList.cs (4)
45Debug.Assert(NodesAndTokens[i].IsNode); 46Debug.Assert(NodesAndTokens[i].Node is EmbeddedSyntaxNode<TSyntaxKind, TSyntaxNode>); 51Debug.Assert(!NodesAndTokens[i].IsNode); 67var nodeOrToken = NodesAndTokens[index * 2];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
38result.Add(array[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
382symbol = method.GetConstructedReducedFrom()!.Parameters[parameter.Ordinal + 1];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (8)
44if (!blocks[i].IsReachable) 46unreachableBlocksToVisit.Add(blocks[i]); 81var firstBlock = blocks[firstBlockOrdinal]; 97current = blocks[min]; 281var previousAnalysisData = analyzer.GetCurrentAnalysisData(blocks[@finally.FirstBlockOrdinal]); 327var currentAnalysisData = analyzer.GetCurrentAnalysisData(blocks[fromRegion.FirstBlockOrdinal]); 380var @catch = tryAndCatch.NestedRegions[i]; 389var entryBlock = blocks[@catch.FirstBlockOrdinal];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (2)
249foreach (var operation in cfg.Blocks[i].DescendantOperations()) 398var firstBasicBlockInOutermostRegion = ControlFlowGraph.Blocks[containingTryCatchFinallyRegion.FirstBlockOrdinal];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
265=> index < values.Length ? values[index] : null; 285refKinds[i], parameters[i].RefKind, distinguishRefFromOut: false))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ParameterSymbolKey.cs (1)
98result.AddIfNotNull(parameters[ordinal]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
402if (!signatureComparer.Equals(originalParameterTypes[i], parameters[i].Type))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (1)
26var typeParameter = method?.TypeParameters[ordinal];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKeyResolution.Enumeration.cs (2)
40if (_symbolKeyResolution.CandidateSymbols[_index] is TSymbol) 58return (TSymbol)_symbolKeyResolution.CandidateSymbols[_index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (9)
342if (!SymbolsAreCompatibleCore(originalSymbolInfo.CandidateSymbols[i], newSymbolInfo.CandidateSymbols[i], performEquivalenceCheck, requireNonNullSymbols)) 791if (!SymbolsAreCompatible(originalLocalVariables[i].Type, newLocalVariables[i].Type)) 1117var argument = specifiedArguments[i]; 1147specifiedParameters1.Add(signature1Parameters[i]); 1148specifiedParameters2.Add(signature2Parameters[i]); 1162var parameter1 = signature1Parameters[i]; 1168var parameter2 = signature2Parameters[i];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
63tasks[i] = ProcessAsync(streams[i], channel.Writer, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (2)
212var typeParameter1 = method1.TypeParameters[i]; 213var typeParameter2 = method2.TypeParameters[i];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (2)
134return _equivalenceVisitors[visitorIndex]; 141return _getHashCodeVisitors[visitorIndex];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (10)
85if (!AreEquivalent(x[i], y[i], equivalentTypesWithDifferingAssemblies)) 433var xElement = xElements[i]; 434var yElement = yElements[i]; 450var xElement = xElements[i]; 451var yElement = yElements[i]; 477if (!symbolEquivalenceComparer.ParameterEquivalenceComparer.Equals(xParameters[i], yParameters[i], equivalentTypesWithDifferingAssemblies, compareParameterName, isParameterNameCaseSensitive)) 502if (!AreEquivalent(xTypeArguments[i], yTypeArguments[i], equivalentTypesWithDifferingAssemblies))
Microsoft.CodeAnalysis.CodeStyle.Fixes (34)
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
202if (argumentName.Equals(parameters[j].Name))
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (2)
153var parameterType = parameters[parameterIndex].Type; 154if (parameters[parameterIndex].IsParams
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
493var parameter = method.Parameters[i];
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (2)
92var t1NameSegment = t1NameSegments[i]; 93var t2NameSegment = t2NameSegments[i];
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
68var parameterName = parameterNames[index]; 90nodeBeforeNewParamNode = GetParamNodeForParamName(paramNodes, parameterNames[index - 1]);
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (7)
258var ctorParameter = ctor.Parameters[i]; 259var result = SymbolEquivalenceComparer.Instance.Equals(ctorParameter.Type, ParameterTypes[i]) && 260ctorParameter.RefKind == _parameterRefKinds[i]; 278=> _arguments.IsDefault || index >= _arguments.Length ? string.Empty : _arguments[index].Name; 422var parameterName = parameterNames[i]; 423var parameterType = parameterTypes[i]; 424var argument = arguments[i];
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (2)
105var constructorParameter = constructorInCompilation.Parameters[i]; 109var expression = expressions[i];
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (6)
187if (typeArguments[i] != null) 189result[typeArguments[i]] = typeParameters[i]; 219refKind: modifiers[i], 221isOptional: optionality[i], 223name: names[i].BestNameForParameter));
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (1)
99(INamedTypeSymbol)symbol.ConstraintTypes[i], projects).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
222var parameter = containingMethod.Parameters[i];
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (2)
182var (typeA, membersA) = state.MembersWithoutExplicitOrImplicitImplementation[i]; 183var (typeB, membersB) = state.MembersWithoutExplicitImplementation[i];
src\Analyzers\Core\CodeFixes\MakeMemberStatic\AbstractMakeMemberStaticCodeFixProvider.cs (1)
37var declaration = diagnostics[i].Location.FindNode(cancellationToken);
src\Analyzers\Core\CodeFixes\MakeTypeAbstract\AbstractMakeTypeAbstractCodeFixProvider.cs (1)
37if (IsValidRefactoringContext(diagnostics[i].Location?.FindNode(cancellationToken), out var typeDeclaration))
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
198localDeclaration = parentBlock.Operations[ifIndex - 1] as IVariableDeclarationGroupOperation;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (3)
59mapping[method.TypeParameters[i]] = updatedTypeParameters[i]; 113var typeParameter = typeParameters[i]; 119newNames[i],
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (1)
17result.Add(parameters[i].RenameParameter(parameterNames[i]));
Microsoft.CodeAnalysis.CSharp (826)
Binder\Binder.QueryUnboundLambdaState.cs (2)
33public override string ParameterName(int index) { return _parameters[index].Name; } 52public override Location ParameterLocation(int index) { return _parameters[index].TryGetFirstLocation(); }
Binder\Binder.ValueChecks.cs (7)
2317var argument = argsOpt[argIndex]; 2332parameters[argsToParamsOpt.IsDefault ? argIndex : argsToParamsOpt[argIndex]] : 2347refKind = argRefKindsOpt[argIndex]; 2436var argument = argsOpt[argIndex]; 2437var refKind = argRefKindsOpt.IsDefault ? RefKind.None : argRefKindsOpt[argIndex]; 2965int paramIndex = argsToParamsOpt.IsDefault ? argIndex : argsToParamsOpt[argIndex];
Binder\Binder.WithQueryLambdaParametersBinder.cs (1)
61var nextField = path[i];
Binder\Binder_Attributes.cs (13)
46var binder = binders[i]; 47AttributeSyntax attributeToBind = attributesToBind[i]; 90AttributeSyntax attributeSyntax = attributesToBind[i]; 91NamedTypeSymbol boundAttributeType = boundAttributeTypes[i]; 92Binder binder = binders[i]; 384Debug.Assert(!arguments[argIndex].IsParamsArrayOrCollection || arguments[argIndex] is BoundArrayCreation); 386int paramIndex = argsToParamsOpt.IsDefault ? argIndex : argsToParamsOpt[argIndex]; 389(arguments[argIndex].IsParamsArrayOrCollection && arguments[argIndex] is BoundArrayCreation { Bounds: [BoundLiteral { ConstantValueOpt.Value: 0 }] }) ? 716var paramIndex = argumentsToParams.IsDefault ? i : argumentsToParams[i]; 717ParameterSymbol parameter = parameters[paramIndex]; 719TypedConstant reorderedArgument = constructorArgsArray[i];
Binder\Binder_Await.cs (1)
483var parameter = method.Parameters[method.ParameterCount - 1];
Binder\Binder_Constraints.cs (2)
396constraintClauses[i] = RemoveInvalidConstraints(typeParameters[i], constraintClauses[i], syntaxNodes[i], performOnlyCycleSafeValidation, diagnostics); 417var constraintType = constraintTypes[i];
Binder\Binder_Conversions.cs (10)
384new BoundValuePlaceholder(source.Syntax, sourceTypes[i].Type), 385elementConversions[i], 389destTypes[i].Type, 392elementConversions[i].AssertUnderlyingConversionsChecked(); 1979? CreateConversion(oldValue.Syntax, oldValue, underlyingConversions[i], isCast: false, conversionGroupOpt: null, destination, diagnostics) 2319var lambdaParameter = lambdaSymbol.Parameters[p]; 2320var delegateParameter = delegateParameters[p]; 2486var destType = targetElementTypes[i]; 2848var delegateParameter = delegateOrFuncPtrParameters[i]; 2849var methodParameter = methodParameters[isExtensionMethod ? i + 1 : i];
Binder\Binder_Crefs.cs (3)
506if (ContainsNestedTypeOfUnconstructedGenericType(parameterSymbols[i].Type)) 700symbol = symbols[symbolIndex]; // NOTE: symbols, not unwrappedSymbols. 712diagnostics.Add(ErrorCode.WRN_AmbiguousXMLReference, crefSyntax.Location, crefSyntax.ToString(), symbol, symbols[otherIndex]);
Binder\Binder_Deconstruct.cs (7)
305hasErrors |= !MakeDeconstructionConversion(tupleOrDeconstructedTypes[i], elementSyntax, rightSyntax, diagnostics, 323nestedConversion = this.Conversions.ClassifyConversionFromType(tupleOrDeconstructedTypes[i], single.Type, isChecked: CheckOverflowAtRuntime, ref useSiteInfo); 329GenerateImplicitConversionError(diagnostics, Compilation, single.Syntax, nestedConversion, tupleOrDeconstructedTypes[i], single.Type); 334var operandPlaceholder = new BoundValuePlaceholder(syntax, tupleOrDeconstructedTypes[i]).MakeCompilerGenerated(); 362variables[i] = new DeconstructionVariable(SetInferredType(pending, foundTypes[i], diagnostics), variable.Syntax); 480BoundExpression element = rhsLiteral.Arguments[i]; 687if (parameters[i].RefKind != RefKind.Out)
Binder\Binder_Expressions.cs (19)
2860var argument = tupleArguments[i]; 2861var targetElementType = targetElementTypesWithAnnotations[i].Type; 3484arguments[arg] = coerceArgument(in methodResult, receiver, parameters, argumentsForInterpolationConversion: arguments, argument, arg, parameters[paramNum].TypeWithAnnotations, diagnostics); 3606if (parameters[paramsIndex].Type.IsSZArray()) 3626BoundExpression collection = CreateParamsCollection(node, parameters[paramsIndex], collectionArgs, diagnostics); 3680return parameters[paramNum]; 3765int handlerParameter = handlerParameterIndexes[handlerParameterIndex]; 3798int argumentIndex = handlerArgumentIndexes[i]; 3814var originalParameterIndex = handlerParameterIndexes[i]; 3815var parameter = parameters[originalParameterIndex]; 3834var originalParameterIndex = handlerParameterIndexes[i]; 3835var parameter = parameters[originalParameterIndex]; 4231BoundExpression boundExpression = boundInitExpr[boundInitExprIndex]; 4256init = boundInitExpr[boundInitExprIndex]; 4391var size = sizes[i]; 6559MethodSymbol constructor = constructors[i]; 7561var typeArgument = typeArgumentsWithAnnotations[i]; 10872parameterTypes[i], 10873parameterRefKinds.IsDefault ? RefKind.None : parameterRefKinds[i],
Binder\Binder_Initializers.cs (2)
173ImmutableArray<FieldOrPropertyInitializer> siblingInitializers = initializers[i]; 184var initializer = siblingInitializers[j];
Binder\Binder_InterpolatedString.cs (3)
380var part = parts[i]; 534arg.AppendCalls[i], 856var part = unconvertedInterpolatedString.Parts[i];
Binder\Binder_Invocation.cs (9)
565if (refKinds[argIndex] == RefKind.In) 567Error(diagnostics, ErrorCode.ERR_InDynamicMethodArg, arguments[argIndex].Syntax); 1434parameter = parameters[argumentOrdinal]; 1438parameter = parameters[n - 1]; 1448int parameterOrdinal = argsToParamsOpt[argumentOrdinal]; 1452parameter = parameters[parameterOrdinal]; 1571BoundExpression collection = CreateParamsCollection(node, parameters[paramsIndex], collectionArgs: ImmutableArray<BoundExpression>.Empty, diagnostics); 2154return (i < parameterList.Length) ? parameterList[i].Type : null; 2190TypeSymbol returnType = members[i].GetTypeOrReturnType().Type;
Binder\Binder_Lookup.cs (3)
638return originalSymbols[best.Index]; 1077addAllInterfaces(interfaces[i], visited, result, basesBeingResolved, cycleGuard); 1104var baseInterface = baseInterfaces[i];
Binder\Binder_Operators.cs (1)
1273var op = operators[i];
Binder\Binder_Patterns.cs (5)
1067TypeSymbol elementType = isError ? CreateErrorType() : outPlaceholders[i].Type; 1074parameter = deconstructMethod.Parameters[parameterIndex]; 1172TypeSymbol elementType = isError ? CreateErrorType() : elementTypesWithAnnotations[i].Type; 1422TypeSymbol elementType = isError ? CreateErrorType() : outPlaceholders[i].Type; 1445TypeSymbol elementType = isError ? CreateErrorType() : elementTypes[i].Type;
Binder\Binder_Query.cs (4)
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))); 680var c1 = invocation.Arguments[index] as BoundConversion;
Binder\Binder_Statements.cs (7)
2143var delegateRefKind = delegateParameters[i].RefKind; 2159if (delegateParameters[i].TypeWithAnnotations.IsStatic) 2162Error(diagnostics, ErrorFacts.GetStaticClassParameterCode(useWarning: false), anonymousFunction.ParameterLocation(i), delegateParameters[i].Type); 2185var delegateParameterType = delegateParameters[i].Type; 2186var delegateRefKind = delegateParameters[i].RefKind; 2521var argument = tupleArguments[i]; 2522var targetElementType = targetElementTypes[i].Type;
Binder\Binder_Symbols.cs (13)
1997return originalSymbols[best.Index]; 2008return originalSymbols[best.Index]; 2019return originalSymbols[best.Index]; 2032Debug.Assert(!Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything) || options.IsAttributeTypeLookup(), 2035Debug.Assert(!Symbol.Equals(first, second, TypeCompareKind.ConsiderEverything) || !Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything), 2190Debug.Assert(originalSymbols[best.Index].Name != originalSymbols[secondBest.Index].Name || 2191!Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything), 2201originalSymbols[best.Index].Name != originalSymbols[secondBest.Index].Name && // Use alias names, if available.
Binder\Binder_TupleOperators.cs (9)
61builder.Add(ApplyConvertedTypes(arguments[i], multiple.Operators[i], isRight, diagnostics)); 240operatorsBuilder.Add(BindTupleBinaryOperatorInfo(node, kind, leftParts[i], rightParts[i], diagnostics)); 295string leftName = leftNoNames ? null : leftNames[i]; 296string rightName = rightNoNames ? null : rightNames[i]; 304bool leftWasInferred = leftNoInferredNames ? false : leftInferred[i]; 305bool rightWasInferred = rightNoInferredNames ? false : rightInferred[i]; 318Location location = ((BoundTupleExpression)(useRight ? right : left)).Arguments[i].Syntax.Parent.Location;
Binder\DecisionDagBuilder.cs (10)
351tests.Add(MakeTestsAndBindings(indexTemp, pattern.Subpatterns[i].Pattern, bindings)); 539BoundPattern pattern = recursive.Deconstruction[i].Pattern; 541var element = new BoundDagTemp(syntax, method.Parameters[i + extensionExtra].Type, evaluation, i); 560BoundPattern pattern = recursive.Deconstruction[i].Pattern; 562FieldSymbol field = elements[i]; 776var node = sortedBoundDagNodes[i]; 1004var state = sortedStates[i]; 1658stateIdentifierMap.Add(allStates[i], i); 2413remainingTests.Insert(i + j, testsToInsert[j]); 2493remainingTests.Insert(i + j, testsToInsert[j]);
Binder\LocalScopeBinder.cs (1)
141var symbol = array[i];
Binder\PatternExplainer.cs (6)
53var n = nodes[i]; 252BoundDecisionDagNode node = pathToNode[i]; 257BoundDecisionDagNode nextNode = (i < n - 1) ? pathToNode[i + 1] : targetNode; 385switch (evaluations[i]) 428switch (evaluations[i]) 547var elementTemp = new BoundDagTemp(e.Syntax, method.Parameters[j + extensionExtra].Type, e, j);
Binder\RefSafetyAnalysis.cs (5)
639var arg = arguments[i]; 710valEscapeScope = GetValEscape(arguments[argIndex], _localScopeDepth); 957var arg = (BoundDeconstructValuePlaceholder)invocation.Arguments[i + offset]; 984var (placeholder, placeholderConversion) = conversion.DeconstructConversionInfo[i]; 986VisitDeconstructionArguments(nestedVariables, syntax, underlyingConversion, right: invocation.Arguments[i + offset]);
Binder\Semantics\Conversions\Conversion.cs (3)
494UserDefinedConversionAnalysis analysis = conversionResult.Results[conversionResult.Best]; 520UserDefinedConversionAnalysis analysis = conversionResult.Results[conversionResult.Best]; 1134UserDefinedConversionAnalysis analysis = conversionResult.Results[conversionResult.Best];
Binder\Semantics\Conversions\ConversionsBase.cs (17)
1517delegateParameterRefKind: delegateParameters[p].RefKind, 1519!delegateParameters[p].Type.Equals(anonymousFunction.ParameterType(p), TypeCompareKind.AllIgnoreOptions)) 1529if (delegateParameters[p].RefKind != RefKind.None) 1560if (delegateParameters[p].TypeWithAnnotations.IsStatic) 1571if (delegateParameters[p].RefKind == RefKind.Out) 1740UserDefinedConversionAnalysis analysis = result.Results[result.Best]; 2346var argument = arguments[i]; 2347var result = classifyConversion(this, argument, targetElementTypes[i], isChecked: isChecked, ref useSiteInfo, forCast: forCast); 2420var conversion = classifyConversion(this, sourceTypes[i], destTypes[i], isChecked: isChecked, ref useSiteInfo, forCast); 3398var sourceParam = sourceSig.Parameters[i]; 3399var destinationParam = destinationSig.Parameters[i]; 3406if (!hasConversion(sourceParam.RefKind, destinationSig.Parameters[i].TypeWithAnnotations, sourceSig.Parameters[i].TypeWithAnnotations, ref useSiteInfo)) 3688var sourceArg = sourceTypeArguments[i].Type; 3689var destinationArg = destinationTypeArguments[i].Type; 3691switch (original.TypeParameters[i].Variance)
Binder\Semantics\Conversions\UserDefinedConversionResult.cs (2)
89Results[i].Operator, 90Results[i].Kind);
Binder\Semantics\Conversions\UserDefinedImplicitConversions.cs (5)
552if (predicate(items[i])) 743return best == null ? null : extract(items[best.Value]); 782return best == null ? null : extract(items[best.Value]); 811T currentItem = items[currentIndex]; 860T currentItem = items[currentIndex];
Binder\Semantics\OverloadResolution\ArgumentAnalysisResult.cs (2)
27return ArgsToParamsOpt[arg]; 127s += "\nArgument " + i + " corresponds to parameter " + ArgsToParamsOpt[i];
Binder\Semantics\OverloadResolution\MemberAnalysisResult.cs (2)
159return this.ConversionsOpt[arg]; 170return ArgsToParamsOpt[arg];
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (31)
358sb.Append(_formalParameterTypes[i]); 399sb.AppendFormat("Method type parameter {0}: ", _methodTypeParameters[i].Name); 426return _formalParameterRefKinds.IsDefault ? RefKind.None : _formalParameterRefKinds[index]; 467_fixedResults[i] = (TypeWithAnnotations.Create(new ExtendedErrorTypeSymbol(_constructedContainingTypeOfMethod, _methodTypeParameters[i].Name, 0, null, false)), false); 493TypeSymbol.Equals(typeParameter, _methodTypeParameters[ordinal], TypeCompareKind.ConsiderEverything2) && 585BoundExpression argument = _arguments[arg]; 586TypeWithAnnotations target = _formalParameterTypes[arg]; 724var sourceArgument = sourceArguments[i]; 725var destType = destTypes[i]; 843var formalType = _formalParameterTypes[arg]; 844var argument = _arguments[arg]; 917var sourceArgument = sourceArguments[i]; 918var destType = destTypes[i]; 1024if (DoesInputTypeContain(pSource, pDest, _methodTypeParameters[iParam])) 1084if (DoesOutputTypeContain(argument, formalParameterType, _methodTypeParameters[iParam])) 1118var formalParameterType = _formalParameterTypes[iArg].Type; 1119var argument = _arguments[iArg]; 1120if (DoesInputTypeContain(argument, formalParameterType, _methodTypeParameters[jParam]) && 1121DoesOutputTypeContain(argument, formalParameterType, _methodTypeParameters[iParam])) 1568ExactInference(anonymousFunction.ParameterTypeWithAnnotations(i), delegateParameters[i].TypeWithAnnotations, ref useSiteInfo); 1822LowerBoundInference(sourceTypes[i], targetTypes[i], ref useSiteInfo); 1876ExactInference(sourceSignature.ParameterTypesWithAnnotations[i], targetSignature.ParameterTypesWithAnnotations[i], ref useSiteInfo); 2418var sourceParam = sourceSignature.Parameters[i]; 2419var targetParam = targetSignature.Parameters[i]; 2768var sourceParam = sourceSignature.Parameters[i]; 2769var targetParam = targetSignature.Parameters[i]; 2801var typeParameter = _methodTypeParameters[iParam]; 3099if (!anonymousFunction.ParameterType(p).Equals(fixedDelegateParameters[p].Type, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)) 3250TypeParameterSymbol pParam = _methodTypeParameters[iParam];
Binder\Semantics\OverloadResolution\OverloadResolution.cs (18)
2074return parameters[paramIndex]; 3095var element = collectionExpressionElements[i]; 3096var conversionToE1 = underlyingElementConversions1[i]; 3097var conversionToE2 = underlyingElementConversions2[i]; 3364if (!ExpressionMatchExactly(sourceArguments[i], destTypes[i].Type, ref useSiteInfo)) 3715var param1 = p1[i]; 3716var param2 = p2[i]; 3845int parm = argToParamMap.IsDefault ? arg : argToParamMap[arg]; 3851var parameter = parameters[parm]; 3987var parm = argToParamMap.IsDefault ? arg : argToParamMap[arg]; 3988var parameter = parameters[parm]; 4265if (!parameterTypes[i].Type.CheckAllConstraints(Compilation, Conversions)) 4384paramsElementTypeOpt = parameters.ParameterTypes[parameters.FirstParamsElementIndex]; 4445RefKind parameterRefKind = parameters.ParameterRefKinds.IsDefault ? RefKind.None : parameters.ParameterRefKinds[argumentPosition]; 4466&& parameters.ParameterTypes[argumentPosition].Type is NamedTypeSymbol { IsInterpolatedStringHandlerType: true, IsValueType: true }) 4479parameters.ParameterTypes[argumentPosition].Type, 4491(ignoreOpenTypes && parameters.ParameterTypes[argumentPosition].Type.ContainsTypeParameter(parameterContainer: (MethodSymbol)candidate))));
Binder\Semantics\OverloadResolution\OverloadResolution_ArgsToParameters.cs (3)
320if (memberParameters[p].Name == name) 365if (parameters.Length == parameterPosition || !CanBeOptional(parameters[parameterPosition], isMethodGroupConversion)) 462if (CanBeOptional(parameters[p], isMethodGroupConversion))
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (2)
909badParamName = parameters[badParamIndex].Name; 1122if (parameters[i].RefKind != RefKind.None)
BoundTree\BoundCollectionExpression.cs (1)
22if (Elements[i] is BoundCollectionExpressionSpreadElement spreadElement)
BoundTree\BoundDecisionDag.cs (1)
107BoundDecisionDagNode node = sortedNodes[i];
BoundTree\BoundNodeExtensions.cs (1)
26if (nodeArray[i].HasErrors)
BoundTree\BoundTreeRewriter.cs (1)
36var item = list[i];
BoundTree\BoundTreeWalker.cs (3)
23this.Visit(list[i]); 44this.Visit(arguments[arguments.Length - 1]); 48this.Visit(arguments[arguments.Length - 2]);
BoundTree\Constructors.cs (3)
192var parameterRefKind = method.ParameterRefKinds.IsDefault ? RefKind.None : method.ParameterRefKinds[i]; 193var argumentRefKind = argumentRefKindsOpt.IsDefault ? RefKind.None : argumentRefKindsOpt[i]; 206Debug.Assert(method is ErrorMethodSymbol || arguments[i].Kind == BoundKind.ArgListOperator);
BoundTree\Formatting.cs (2)
93argumentDisplays[i] = arguments[i].Display; 210argumentDisplays[i] = arguments[i].Display;
BoundTree\NullabilityRewriter.cs (2)
180_remappedSymbols.Add(lambda.Parameters[i], updatedLambda.Parameters[i]);
BoundTree\UnboundLambda.cs (13)
749parameterScopesBuilder[i] = lambdaSymbol.Parameters[i].EffectiveScope; 753Debug.Assert(lambdaSymbol.Parameters[i].EffectiveScope == parameterScopesBuilder[i]); 922if (targetParameterTypes[i].Type.ContainsPointer()) 1058if (!other.ParameterTypes[i].Equals(this.ParameterTypes[i], TypeCompareKind.ConsiderEverything) || 1059other.ParameterRefKinds[i] != this.ParameterRefKinds[i]) 1519return _parameterAttributes.IsDefault ? default : _parameterAttributes[index]; 1525return _parameterNames[index]; 1530return _parameterIsDiscardOpt.IsDefault ? false : _parameterIsDiscardOpt[index]; 1536return _parameterRefKinds.IsDefault ? Microsoft.CodeAnalysis.RefKind.None : _parameterRefKinds[index]; 1542return _parameterDeclaredScopes.IsDefault ? ScopedKind.None : _parameterDeclaredScopes[index]; 1556return _parameterTypesWithAnnotations[index];
CodeGen\EmitAddress.cs (1)
387BoundExpression index = indices[i];
CodeGen\EmitArrayInitializer.cs (2)
87var init = inits[i]; 146indices.Push(new IndexDesc(i, ((BoundArrayInitialization)inits[i]).Initializers));
CodeGen\EmitExpression.cs (15)
709BoundExpression argument = expression.Arguments[i]; 710RefKind refKind = expression.ArgumentRefKindsOpt.IsDefaultOrEmpty ? RefKind.None : expression.ArgumentRefKindsOpt[i]; 959EmitArgument(arguments[i], argRefKind); 975argRefKind = argRefKindsOpt[i]; 977Debug.Assert(argRefKind == parameters[i].RefKind || 978parameters[i].RefKind switch 988Debug.Assert(parameters[i].RefKind != RefKind.RefReadOnlyParameter, 992argRefKind = parameters[i].RefKind switch 1002Debug.Assert(arguments[i].Kind == BoundKind.ArgListOperator); 1680method.IsVararg ? (BoundArgListOperator)arguments[arguments.Length - 1] : null); 2014actualMethodTargetedByTheCall.IsVararg ? (BoundArgListOperator)arguments[arguments.Length - 1] : null); 2255int varArgCount = ((BoundArgListOperator)arguments[fixedArgCount]).Arguments.Length; 2279int varArgCount = ((BoundArgListOperator)objCreation.Arguments[fixedArgCount]).Arguments.Length; 2456constructor.IsVararg ? (BoundArgListOperator)expression.Arguments[expression.Arguments.Length - 1] : null); 2713constructor.IsVararg ? (BoundArgListOperator)objCreation.Arguments[objCreation.Arguments.Length - 1] : null);
CodeGen\EmitStatement.cs (1)
129EmitStatement(list.Statements[i]);
CodeGen\Optimizer.cs (5)
726var sideeffect = sideeffects[i]; 780if (localUsedWalker.IsLocalUsedIn(sideeffects[i])) 1276var arg = arguments[i]; 1300RefKind refKind = argRefKindsOpt.IsDefaultOrEmpty ? RefKind.None : argRefKindsOpt[i]; 1768var initializer = initializers[i];
CommandLine\CSharpCompiler.cs (2)
85sourceFiles[i], 104Debug.Assert(sourceFiles[i].IsInputRedirected || PathUtilities.IsAbsolute(normalizedFilePath));
Compilation\CSharpCompilation.cs (11)
1203return index < 0 ? null : this.Assembly.Modules[index]; 3711var m = (Symbols.Metadata.PE.PEModuleSymbol)modules[i]; 3854if (b != bytes[i]) 4039if (parameterTypes[i] is null) 4125ITypeSymbol typeSymbol = elementTypes[i]; 4127var annotation = (elementNullableAnnotations.IsDefault ? typeSymbol.NullableAnnotation : elementNullableAnnotations[i]).ToInternalAnnotation(); 4180memberTypes[i].EnsureCSharpSymbolOrNull($"{nameof(memberTypes)}[{i}]"); 4192var type = memberTypes[i].GetSymbol(); 4193var name = memberNames[i]; 4194var location = memberLocations.IsDefault ? Location.None : memberLocations[i]; 4195var nullableAnnotation = memberNullableAnnotations.IsDefault ? NullableAnnotation.Oblivious : memberNullableAnnotations[i].ToInternalAnnotation();
Compilation\MemberSemanticModel.cs (2)
1133return elements[idx].GetPublicSymbol(); 1275var boundAdd = boundCollectionInitializer.Initializers[collectionInitializer.Expressions.IndexOf(node)];
Compilation\SyntaxAndDeclarationManager.cs (4)
414var tree = syntaxTrees[i]; 527var tree = syntaxTrees[i]; 548var tree = syntaxTrees[i]; 630stack.Push(current.Children[i]);
Compilation\SyntaxAndDeclarationManager.LazyState.cs (1)
55Debug.Assert(syntaxTrees.All(tree => syntaxTrees[syntaxTreeOrdinalMap[tree]] == tree));
Compiler\AnonymousTypeMethodBodySynthesizer.cs (4)
57F.Assignment(F.Field(F.This(), anonymousType.Properties[index].BackingField), F.Parameter(_parameters[index])); 207F.Field(F.This(), anonymousType.Properties[index].BackingField), 255AnonymousTypePropertySymbol property = anonymousType.Properties[i];
Compiler\ClsComplianceChecker.cs (6)
117ModuleSymbol module = symbol.Modules[i]; 695if (TryGetClsComplianceAttributeLocation(parameters[i].GetAttributes(), out attributeLocation)) 1369TypeSymbol xType = xParameterTypes[i].Type; 1370TypeSymbol yType = yParameterTypes[i].Type; 1405sawRefKindDifference = sawRefKindDifference || xRefKinds[i] != yRefKinds[i];
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (1)
478originatingSyntax = _sourceIncludeElementNodes[_nextSourceIncludeElementIndex];
Compiler\MethodCompiler.cs (1)
496var member = members[memberOrdinal];
Declarations\MergedNamespaceDeclaration.cs (1)
51sortKey = LexicalSortKey.First(sortKey, new LexicalSortKey(_declarations[i].NameLocation, compilation));
Declarations\MergedTypeDeclaration.cs (1)
165sortKey = LexicalSortKey.First(sortKey, new LexicalSortKey(Declarations[i].NameLocation, compilation));
Emitter\EditAndContinue\CSharpDefinitionMap.cs (3)
105var key = new EncHoistedLocalInfo(localSlotDebugInfo[slotIndex], (Cci.ITypeReference)field.Type.GetCciAdapter()); 162var metadata = slotMetadata[slotIndex]; 185result[i] = new EncLocalInfo(slotMetadata[i].SignatureOpt);
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (1)
196var otherModule = otherAssembly.Modules[i];
Emitter\Model\AttributeDataAdapter.cs (1)
135metadataExprs[i] = CreateMetadataExpression(values[i], context);
Emitter\Model\NamedTypeSymbolAdapter.cs (2)
875var arg = moduleBeingBuilt.Translate(arguments[i].Type, syntaxNodeOpt: (CSharpSyntaxNode)context.SyntaxNode, diagnostics: context.Diagnostics); 876var modifiers = arguments[i].CustomModifiers;
Emitter\Model\PEAssemblyBuilder.cs (6)
131builder.Add((Cci.IFileReference)Translate(modules[i], context.Diagnostics)); 172var file = (Cci.IFileReference)Translate(modules[i], diagnostics); 176foreach (EmbeddedResource resource in ((Symbols.Metadata.PE.PEModuleSymbol)modules[i]).Module.GetEmbeddedResourcesOrThrow()) 188diagnostics.Add(new CSDiagnosticInfo(ErrorCode.ERR_BindToBogus, modules[i]), NoLocation.Singleton); 214_lazyNullableAttribute.Constructors[constructorIndex], 257_lazyNativeIntegerAttribute.Constructors[constructorIndex],
Emitter\Model\PEModuleBuilder.cs (5)
158foreach (AssemblySymbol aRef in modules[i].GetReferencedAssemblySymbols()) 641GetExportedTypes(modules[i].GlobalNamespace, -1, builder); 792stack.Push((nested[i], index)); 1228!optArgList.ArgumentRefKindsOpt.IsDefaultOrEmpty && optArgList.ArgumentRefKindsOpt[i] != RefKind.None, 1229Translate(optArgList.Arguments[i].Type, syntaxNodeOpt, diagnostics));
Emitter\Model\SymbolAdapter.cs (1)
150CSharpAttributeData attribute = userDefined[i];
FlowAnalysis\AbstractFlowPass.cs (4)
1531VisitRvalue(arguments[i], isKnownToBeAnLvalue: refKind != RefKind.None); 1535VisitLvalue(arguments[i]); 1558WriteArgument(arguments[i], refKind, method); 1568return refKindsOpt.IsDefault || refKindsOpt.Length <= index ? RefKind.None : refKindsOpt[index];
FlowAnalysis\AbstractFlowPass_Switch.cs (1)
28VisitSwitchSection(switchSections[iSection], iSection == iLastSection);
FlowAnalysis\FlowAnalysisPass.cs (1)
174builder.Add(AppendImplicitReturn((BoundBlock)statements[n - 1], method));
FlowAnalysis\NullableWalker.cs (41)
2809var parameter = methodParameters[i]; 2812var parameterType = i >= signatureParameters.Length ? parameter.TypeWithAnnotations : signatureParameters[i].TypeWithAnnotations; 4503var argument = arguments[i]; 4533var currentDeclaration = node.Declarations[currentDeclarationIndex]; 4742BoundExpression placeholder = placeholders[i]; 6526var comparand = compareExchangeInfo.Arguments[comparandIndex]; 6527var valueFlowState = compareExchangeInfo.Results[valueIndex].RValueType.State; 6534var locationFlowState = compareExchangeInfo.Results[locationIndex].RValueType.State; 6857var argumentNoConversion = argumentsNoConversions[i]; 6858var argument = i < arguments.Length ? arguments[i] : argumentNoConversion; 6892conversions.IsDefault || i >= conversions.Length ? Conversion.Identity : conversions[i], 6897results[i], 6903if (results[i].RValueType.IsNotNull || isExpandedParamsArgument) 6940arguments[i], 6945results[i], 6956var argument = arguments[i]; 6957var result = results[i]; 6958var argumentNoConversion = argumentsNoConversions[i]; 7005BoundExpression argument = arguments[a]; 7242resultsBuilder.Add(VisitArgumentEvaluate(arguments[i], GetRefKind(refKindsOpt, i), parameterAnnotationsOpt.IsDefault ? default : parameterAnnotationsOpt[i])); 7748var argument = arguments[i]; 7937var visitArgumentResult = argumentResults[i]; 7938builder.Add(getArgumentForMethodTypeInference(arguments[i], visitArgumentResult)); 7966if (collection.Elements[i] is BoundExpression elementExpression) 7973elementsBuilder.Add(collection.Elements[i]); 8482trackState(values[argOrdinal], tupleElements[i], types[argOrdinal]); 8489trackState(values[argOrdinal], restField, types[argOrdinal]); 8548trackConvertedValue(targetElements[i], conversions[i], valueElements[i]); 10184placeholderArgs.Add(new BoundExpressionWithNullability(variables[i].Expression.Syntax, variables[i].Expression, NullableAnnotation.Oblivious, conversion.DeconstructionInfo.OutputPlaceholders[i].Type)); 10210var parameter = parameters[i + offset]; 10211var (placeholder, placeholderConversion) = conversion.DeconstructConversionInfo[i]; 10216var nestedRight = CreatePlaceholderIfNecessary(invocation.Arguments[i + offset], parameter.TypeWithAnnotations); 10230var parameter = parameters[i + offset]; 10252var (placeholder, placeholderConversion) = deconstructConversionInfo[i]; 10254var rightPart = rightParts[i];
FlowAnalysis\NullableWalker.SnapshotManager.cs (5)
46int currentPosition = incrementalSnapshots[i].position; 56var sharedState = _walkerSharedStates[incrementalSnapshot.SharedStateIndex]; 63var sharedState = _walkerSharedStates[snapshot.SharedStateIndex]; 100return _incrementalSnapshots[snapshotIndex].snapshot; 118RoslynDebug.Assert(_walkerSharedStates.Length > _incrementalSnapshots[position].snapshot.SharedStateIndex, $"Did not find shared state for {node} `{node.Syntax}`.");
FlowAnalysis\NullableWalker_Patterns.cs (6)
201BoundSubpattern item = rp.Deconstruction[i]; 202FieldSymbol element = elements[i]; 451var parameterType = method.Parameters[i + extensionExtra].TypeWithAnnotations; 514((BoundTupleExpression)expression).Arguments[originalTupleElement.TupleElementIndex]); 518Debug.Assert(originalInputMap[outputSlot] == ((BoundTupleExpression)expression).Arguments[originalTupleElement.TupleElementIndex]); 1000var arm = node.SwitchArms[i];
Lowering\ClosureConversion\ClosureConversion.cs (3)
609var potentialParameter = lambda.Parameters[i]; 897var frameType = (NamedTypeSymbol)loweredSymbol.Parameters[i].Type.OriginalDefinition; 1553_parameterMap.Add(parameter, synthesizedMethod.Parameters[parameter.Ordinal]);
Lowering\DiagnosticsPass_Warnings.cs (6)
28if (argumentRefKindsOpt[i] != RefKind.None) 30var argument = arguments[i]; 244if (method.Parameters[i].RefKind != RefKind.None && (argumentRefKindsOpt.IsDefault || argumentRefKindsOpt[i] == RefKind.None)) return true; 916var leftArgument = leftArguments[i]; 917var rightArgument = rightTuple.Arguments[i];
Lowering\Extensions.cs (1)
21return ArgumentRefKinds[index];
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (2)
577if (refKinds[i] is not (RefKind.Ref or RefKind.Out)) 583if (!TryGetLocalOrParameterInfo(arguments[i], out var targetSymbol, out var targetType, out var targetIndex))
Lowering\LocalRewriter\LocalRewriter.cs (3)
767if (stmt == null || (optimize && IsFieldOrPropertyInitializer(originalStatements[i]) && ShouldOptimizeOutInitializer(stmt))) 796if (IsFieldOrPropertyInitializer(originalStatements[i])) 798BoundStatement original = originalStatements[i];
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (9)
392BoundDecisionDagNode node = nodesToLower[i]; 418BoundDecisionDagNode nextNode = ((i + 1) < length) ? nodesToLower[i + 1] : null; 444Debug.Assert(node == nodesToLower[indexOfNode]); 460nodesToLower[indexOfNode + 1] == evaluationNode && 461!loweredNodes.Contains(nodesToLower[indexOfNode + 2]) ? nodesToLower[indexOfNode + 2] : null; 830_loweredDecisionDag.Add(_factory.ConditionalGoto(MakeValueTest(node.Syntax, input, cases[i].value), cases[i].label, jumpIfTrue: true)); 839_loweredDecisionDag.Add(_factory.ConditionalGoto(MakeRelationalTest(node.Syntax, input, lessThanOrEqualOperator, cases[firstIndex + half - 1].value), gt, jumpIfTrue: false));
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (3)
187ParameterSymbol parameter = method.Parameters[i]; 623var field = loweredInput.Type.TupleElements[i].CorrespondingTupleField; 625var expr = loweredInput.Arguments[i];
Lowering\LocalRewriter\LocalRewriter_Block.cs (1)
81BoundStatement? statement = VisitPossibleUsingDeclaration(statements[i], statements, i, out var replacedUsingDeclarations);
Lowering\LocalRewriter\LocalRewriter_Call.cs (14)
739var argument = arguments[i]; 833var argument = arguments[argumentIndex]; 878var paramIndex = argsToParamsOpt.IsDefault ? argIndex : argsToParamsOpt[argIndex]; 880RefKind paramRefKind = parameters[paramIndex].RefKind; 1026if (expanded && TryOptimizeParamsArray(rewrittenArguments[rewrittenArguments.Length - 1], out optimized)) 1160var paramRefKind = parameters[i].RefKind; 1163var argRefKind = argumentRefKindsOpt.IsDefault ? RefKind.None : argumentRefKindsOpt[i]; 1169var argRefKind = argumentRefKindsOpt.IsDefault ? RefKind.None : argumentRefKindsOpt[i]; 1173Debug.Assert(parameters[i].Type is NamedTypeSymbol { IsInterpolatedStringHandlerType: true, IsValueType: true }); 1266var element = elements[i]; 1319BoundExpression argument = rewrittenArguments[a]; 1320int p = (!argsToParamsOpt.IsDefault) ? argsToParamsOpt[a] : a; 1322RefKind paramRefKind = parameters[p].RefKind; 1615RefKind paramRefKind = parameters[argIndex].RefKind;
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (4)
592var element = VisitExpression((BoundExpression)elements[i]); 1220var rewrittenExpression = RewriteCollectionExpressionElementExpression(elements[i]); 1239var element = elements[i]; 1283var element = elements[i];
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (6)
523if (CanChangeValueBetweenReads(arguments[i])) 526var temp = _factory.StoreToTemp(VisitExpression(arguments[i]), out assignmentToTemp, indexerAccess.ArgumentRefKindsOpt.RefKinds(i) != RefKind.None ? RefKind.Ref : RefKind.None); 533loweredArguments[i] = arguments[i]; 791if (CanChangeValueBetweenReads(loweredIndices[i])) 794var temp = _factory.StoreToTemp(loweredIndices[i], out assignmentToTemp); 801boundTempIndices[i] = loweredIndices[i];
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (3)
969var fieldAccess = MakeTupleFieldAccessAndReportUseSiteDiagnostics(savedTuple, syntax, srcElementFields[i]); 970var convertedFieldAccess = MakeConversionNode(syntax, fieldAccess, elementConversions[i], destElementTypes[i].Type, @checked, explicitCastInCode);
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (4)
230var (placeholder, nestedConversion) = deconstructConversionInfo[i]; 236resultPart = ApplyDeconstructionConversion(nested, rightParts[i], 241var rightPart = rightParts[i]; 364var fieldAccess = MakeTupleFieldAccessAndReportUseSiteDiagnostics(tuple, expression.Syntax, fields[i]);
Lowering\LocalRewriter\LocalRewriter_Field.cs (1)
89currentLinkType = (NamedTypeSymbol)currentLinkType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[NamedTypeSymbol.ValueTupleRestPosition - 1].Type;
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (1)
30BoundLocalDeclaration localDecl = localDecls[i];
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (1)
597var arg = args[i];
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (3)
46if (construction.ArgumentRefKindsOpt[i] == RefKind.Out) 51Debug.Assert(construction.ArgumentRefKindsOpt[i] == RefKind.None); 168var part = node.Parts[i];
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (13)
67var element = tuple.Arguments[i]; 68var elementConversion = underlyingConversions[i]; 69var elementType = resultTypes[i].Type; 119var fieldAccess = MakeTupleFieldAccessAndReportUseSiteDiagnostics(savedTuple, syntax, srcElementFields[i]); 121syntax, fieldAccess, elementConversions[i], boundConversion.Checked, boundConversion.ExplicitCastInCode, null, null, destElementTypes[i].Type, boundConversion.HasErrors); 155var argument = tuple.Arguments[i]; 156var newArgument = ReplaceTerminalElementsWithTemps(argument, multiple.Operators[i], initEffects, temps); 452argumentBuilder.Add(MakeBoundConversion(GetTuplePart(operand, i), underlyingConversions[i], types[i], conv)); 495BoundExpression nextLogicalOperand = RewriteTupleOperator(nestedOperators[i], leftElement, rightElement, type, temps, operatorKind); 521return tupleExpression.Arguments[i]; 530return MakeTupleFieldAccessAndReportUseSiteDiagnostics(tuple, tuple.Syntax, tuple.Type.TupleElements[i]);
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (1)
75result = RewriteDeclarationUsingStatement(syntax, declarations[i], result, awaitKeyword, awaitOpt, patternDisposeInfo);
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (5)
584loweredArguments[i], 585argumentNames.IsDefaultOrEmpty ? NoName : argumentNames[i], 586refKinds.IsDefault ? RefKind.None : refKinds[i], 770byRefs[j] = getRefKind(refKinds[i]); 914result[j++] = arguments[i].Type ?? systemObjectType;
Lowering\SpillSequenceSpiller.cs (6)
611if (newList[i].Kind == SpillSequenceBuilderKind) 626builder = new BoundSpillSequenceBuilder(lastSpill < newList.Length ? (newList[lastSpill] as BoundSpillSequenceBuilder)?.Syntax : null); 634var refKind = refKinds.IsDefault ? RefKind.None : refKinds[i]; 635var replacement = Spill(builder, newList[i], refKind, sideEffectsOnly); 648var lastSpillNode = (BoundSpillSequenceBuilder)newList[lastSpill]; 654result.Add(newList[i]);
Operations\CSharpOperationFactory.cs (5)
1551=> arg.@this.CreateBoundInterpolatedStringExpressionOperation(boundInterpolatedString, arg.Data.PositionInfo[i]); 2304var part = parts[i]; 2305var currentPosition = positionInfo[i]; 2389BoundExpression? alignment = alignmentIndex == -1 ? null : arguments[alignmentIndex]; 2391BoundExpression? format = formatIndex == -1 ? null : arguments[formatIndex];
Operations\CSharpOperationFactory_Methods.cs (9)
313var argumentKind = GetArgumentKind(arguments[i], ref defaultArguments, i); 314argumentsBuilder.Add(operationFactory.CreateArgumentOperation(argumentKind, parameters[i].GetPublicSymbol(), arguments[i])); 323argumentsBuilder.Add(operationFactory.CreateArgumentOperation(argumentKind, null, arguments[i])); 373BoundExpression argument = arguments[a]; 375int p = (!argsToParamsOpt.IsDefault) ? argsToParamsOpt[a] : a; 376var parameter = parameters[p]; 421IOperation value = Create(arguments[i]); 481var currentDeclaration = declarations[currentDeclarationIndex];
SymbolDisplay\SymbolDisplayVisitor.Types.cs (5)
499tupleSymbol = (INamedTypeSymbol)currentUnderlying.TypeArguments[NamedTypeSymbol.ValueTupleRestPosition - 1]; 552var element = elements[i]; 800var typeArg = typeArguments[i]; 828AddCustomModifiersIfNeeded(modifiers[i], leadingSpace: true, trailingSpace: false); 909ITypeSymbol baseType = typeParam.ConstraintTypes[i];
Symbols\AbstractTypeMap.cs (10)
66var oldArgument = oldTypeArguments[i]; 142NamedTypeSymbol modifier = ((CSharpCustomModifier)customModifiers[i]).ModifierSymbol; 150builder.Add(customModifiers[i].IsOptional ? CSharpCustomModifier.CreateOptional(substituted) : CSharpCustomModifier.CreateRequired(substituted)); 153modifier = ((CSharpCustomModifier)customModifiers[i]).ModifierSymbol; 158builder.Add(customModifiers[i].IsOptional ? CSharpCustomModifier.CreateOptional(substituted) : CSharpCustomModifier.CreateRequired(substituted)); 162builder.Add(customModifiers[i]); 297var t = original[i]; 306result[j] = original[j]; 414var t = original[i]; 423result[j] = original[j];
Symbols\AnonymousTypes\AnonymousTypeManager.cs (1)
50return anonymous.Properties[index];
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (5)
205var field = fields[i]; 236var original = TypeWithAnnotations.Create(genericFieldTypes[index].Type); 264refKinds[i] = fields[i].RefKind; 306if (!isValidTypeArgument(useUpdatedEscapeRules, runtimeSupportsByRefLikeGenerics, fields[i], ref needsIndexedName)) 311var returnParameter = fields[n - 1];
Symbols\AnonymousTypes\PublicSymbols\AnonymousType.DelegatePublicSymbol.cs (1)
60var field = fields[i];
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.ConstructorSymbol.cs (1)
32PropertySymbol property = properties[index];
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (7)
60new SynthesizedDelegateInvokeMethod.ParameterDescription(TypeWithAnnotations.Create(typeParams[i]), refKinds.IsNull ? RefKind.None : refKinds[i], ScopedKind.None, defaultValue: null, isParams: false, hasUnscopedRefAttribute: false)); 64var returnType = TypeWithAnnotations.Create(voidReturnTypeOpt ?? typeParams[parameterCount]); 129var field = fields[i]; 130var type = TypeWithAnnotations.Create(typeParams[i]); 145var returnType = TypeWithAnnotations.Create(returnsVoid ? returnParameter.Type : typeParams[parameterCount]); 180allowsRefLikeType: typeParametersToSubstitute[i].AllowsRefLikeType)); 200var field = fields[i];
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (2)
55AnonymousTypeField field = typeDescr.Fields[fieldIndex]; 196string fieldName = this.Properties[fieldIndex].Name;
Symbols\Attributes\AttributeData.cs (1)
796if (attributes[i].IsTargetAttribute(description))
Symbols\Attributes\SourceAttributeData.cs (4)
146int sourceArgIndex = _constructorArgumentsSourceIndices[parameterIndex]; 152Debug.Assert(this.AttributeConstructor.Parameters[parameterIndex].IsOptional || 153this.AttributeConstructor.Parameters[parameterIndex].IsParamsArray); 282TypeSymbol parameterType = parameters[parameterIndex].Type;
Symbols\Compilation_UsedAssemblies.cs (2)
105foreach (var dependency in assembly.Modules[i].ReferencedAssemblySymbols) 132foreach (var dependency in SourceAssembly.Modules[i].ReferencedAssemblySymbols)
Symbols\Compilation_WellKnownMembers.cs (1)
1110return named.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[argumentIndex].Type;
Symbols\ConstraintsHelper.cs (4)
427var constraint = constraintClauses[i]; 428var typeParameter = typeParameters[i]; 914if (!CheckConstraints(containingSymbol, in args, substitution, typeParameters[i], typeArguments[i], diagnosticsBuilder, nullabilityDiagnosticsBuilderOpt,
Symbols\ConstructedNamedTypeSymbol.cs (2)
104if (!typeArguments[i].Is(typeParameters[i]))
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (5)
361var thisParam = _parameters[i]; 362var otherParam = signature._parameters[i]; 464var originalParam = originalParameters[i]; 465var substitutedType = substitutedParameterTypes[i]; 466var customModifiers = substitutedRefCustomModifiers.IsDefault ? originalParam.RefCustomModifiers : substitutedRefCustomModifiers[i];
Symbols\MemberSignatureComparer.cs (2)
648if (!HaveSameConstraints(typeParameters1[i], typeMap1, typeParameters2[i], typeMap2))
Symbols\Metadata\PE\DynamicTypeDecoder.cs (1)
425private bool PeekFlag() => _index < _dynamicTransformFlags.Length && _dynamicTransformFlags[_index];
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (4)
106typeArgument = namedType.TypeParameters[position - arityOffset]; 238if (!ParametersMatch(candidateMethod.Parameters[i], candidateMethodTypeMap, ref targetParamInfo[i + 1 /*for return type*/])) 322var targetCustomModifier = targetCustomModifiers[i]; 323CustomModifier candidateCustomModifier = candidateCustomModifiers[i];
Symbols\Metadata\PE\MetadataDecoder.cs (4)
83return typeParameters[position]; 103return type.TypeParameters[position]; 241if (ReferenceEquals(containingAssembly, assemblies[i])) 255if (IsOrClosedOverATypeFromAssemblies(arguments[i].Type, assemblies))
Symbols\Metadata\PE\NativeIntegerTypeDecoder.cs (1)
120return (_transformFlags[_index++], type.IsNativeIntegerWrapperType) switch
Symbols\Metadata\PE\PENamedTypeSymbol.cs (15)
957if (instanceIndex < uncommon.lazyInstanceEnumFields.Length && uncommon.lazyInstanceEnumFields[instanceIndex].Handle == fieldDef) 959yield return uncommon.lazyInstanceEnumFields[instanceIndex]; 964if (staticIndex < staticFields.Length && staticFields[staticIndex].Kind == SymbolKind.Field) 966var field = (PEFieldSymbol)staticFields[staticIndex]; 980Debug.Assert(staticIndex == staticFields.Length || staticFields[staticIndex].Kind != SymbolKind.Field); 1071if (members[index].Kind != SymbolKind.Method) 1076var method = (MethodSymbol)members[index]; 1089if (index >= members.Length || members[index].Kind != SymbolKind.Method) 1095var method = (PEMethodSymbol)members[index]; 1117if (index == members.Length || members[index].Kind != SymbolKind.Method) 1124method = (PEMethodSymbol)members[index]; 2444if (members[i].Kind == kind) 2466var member = members[i]; 2763var containingTypeParameter = containingTypeParameters[i]; 2764var nestedTypeParameter = nestedTypeParameters[i];
Symbols\Metadata\PE\PEParameterSymbol.cs (1)
765if (parameters[i].Name.Equals(parameterName, StringComparison.Ordinal))
Symbols\Metadata\PE\SymbolFactory.cs (2)
129if (refersToNoPiaLocalType[i] || 131MetadataDecoder.IsOrClosedOverATypeFromAssemblies(arguments[i].Key, linkedAssemblies)))
Symbols\Metadata\PE\TupleTypeDecoder.cs (3)
220var param = type.Signature.Parameters[i]; 318TypeWithAnnotations typeArg = typeArgs[i]; 375if (_elementNames[start + i] != null)
Symbols\MethodSymbol.cs (1)
906internal TypeSymbol GetParameterType(int index) => ParameterTypesWithAnnotations[index].Type;
Symbols\MethodSymbolExtensions.cs (1)
18return method.ParameterCount != 0 && method.Parameters[method.ParameterCount - 1].IsParams;
Symbols\ModuleSymbol.cs (1)
248return referencedAssemblies[referencedAssemblyIndex];
Symbols\NamedTypeSymbol.cs (7)
86var result = TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[index]; 886var typeArgument = typeArguments[i]; 887var otherTypeArgument = otherTypeArguments[i]; 1055TypeWithAnnotations typeArgumentA = typeArgumentsA[i]; 1056TypeWithAnnotations typeArgumentB = typeArgumentsB[i]; 1057VarianceKind typeArgumentVariance = GetTypeArgumentVariance(variance, isTuple ? VarianceKind.Out : typeParameters[i].Variance); 1660typeToCheck = ((NamedTypeSymbol)typeToCheck).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[ValueTupleRestPosition - 1].Type;
Symbols\ParameterSignature.cs (1)
43var parameter = parameters[parm];
Symbols\PropertySymbolExtensions.cs (1)
15return property.ParameterCount != 0 && property.Parameters[property.ParameterCount - 1].IsParams;
Symbols\PublicModel\NamedTypeSymbol.cs (1)
96return UnderlyingNamedTypeSymbol.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[ordinal].CustomModifiers;
Symbols\PublicModel\Symbol.cs (2)
47var type = typeArguments[i].EnsureCSharpSymbolOrNull(nameof(typeArguments)); 48var annotation = typeArgumentNullableAnnotations.IsDefault ? NullableAnnotation.Oblivious : typeArgumentNullableAnnotations[i].ToInternalAnnotation();
Symbols\ReducedExtensionMethodSymbol.cs (4)
178if (!typeArgsForConstraintsCheck[i].HasType) 186var typeArg = typeArgsForConstraintsCheck[i]; 189notInferredTypeParameters.Add(typeParams[i]); 571parameters.Add(new ReducedExtensionMethodParameterSymbol(this, reducedFromParameters[i + 1]));
Symbols\ReferenceManager.cs (21)
338assemblyModules[i].SetReferences(referencedModulesReferences[i - 1]); 430bound.AssemblySymbol = ((AssemblyDataForMetadataOrCompilation)allAssemblyData[i]).CreateAssemblySymbol(); 434Debug.Assert(allAssemblyData[i].IsLinked == bound.AssemblySymbol.IsLinked); 551var compilationData = assemblies[i] as AssemblyDataForCompilation; 559var fileData = (AssemblyDataForFile)assemblies[i]; 575if (assemblies[i].ContainsNoPiaLocalTypes) 583if (assemblies[i].IsLinked) 627var compilationData = assemblies[i] as AssemblyDataForCompilation; 634var fileData = (AssemblyDataForFile)assemblies[i]; 656retargetingAssemblySymbol.UnderlyingAssembly.Modules[j].GetReferencedAssemblies(); 680if (!underlyingReferencedAssemblySymbols[k].IsLinked) 682filteredReferencedAssemblies[newIndex] = referencedAssemblies[k]; 705symbols[k] = GetOrAddMissingAssemblySymbol(referencedAssemblies[k], ref missingAssemblies); 710modules[j].SetReferences(moduleReferences, sourceAssemblyDebugOnly); 733int moduleReferenceCount = fileData.Assembly.ModuleReferenceCounts[j]; 754modules[j].SetReferences(moduleReferences, sourceAssemblyDebugOnly); 776int refsCount = (moduleIndex == 0) ? totalReferencedAssemblyCount : modules[moduleIndex - 1].ReferencedAssemblies.Length; 811moduleSymbols[moduleIndex].SetReferences(references, sourceAssembly); 1118if (!sourceReferencedAssemblySymbols[i].IsLinked) 1120result.Add(sourceReferencedAssemblies[i]); 1126result.AddRange(modules[i].GetReferencedAssemblies());
Symbols\Retargeting\RetargetingAssemblySymbol.cs (1)
114PEModuleSymbol under = (PEModuleSymbol)underlyingAssembly.Modules[i];
Symbols\Retargeting\RetargetingEventSymbol.cs (1)
122var retargeted = this.RetargetingTranslator.Retarget(impls[i]);
Symbols\Retargeting\RetargetingMethodSymbol.cs (2)
179parameters.Add(new RetargetingMethodParameterSymbol(this, list[i])); 325var retargeted = this.RetargetingTranslator.Retarget(impls[i], MemberSignatureComparer.RetargetedExplicitImplementationComparer);
Symbols\Retargeting\RetargetingModuleSymbol.cs (13)
205while (underlyingBoundReferences[j].IsLinked) 212var definitionIdentity = ReferenceEquals(referencedAssemblySymbols[i], originatingSourceAssemblyDebugOnly) ? 214referencedAssemblySymbols[i].Identity; 216Debug.Assert(identityComparer.Compare(moduleReferences.Identities[i], definitionIdentity) != AssemblyIdentityComparer.ComparisonResult.NotEquivalent); 217Debug.Assert(identityComparer.Compare(moduleReferences.Identities[i], underlyingBoundReferences[j].Identity) != AssemblyIdentityComparer.ComparisonResult.NotEquivalent); 220if (!ReferenceEquals(referencedAssemblySymbols[i], underlyingBoundReferences[j])) 224if (!_retargetingAssemblyMap.TryGetValue(underlyingBoundReferences[j], out destinationData)) 226_retargetingAssemblyMap.Add(underlyingBoundReferences[j], 227new DestinationData { To = referencedAssemblySymbols[i] }); 231Debug.Assert(ReferenceEquals(destinationData.To, referencedAssemblySymbols[i])); 237while (j < underlyingBoundReferences.Length && underlyingBoundReferences[j].IsLinked)
Symbols\Retargeting\RetargetingPropertySymbol.cs (2)
116parameters[i] = new RetargetingPropertyParameterSymbol(this, list[i]); 182var retargeted = this.RetargetingTranslator.Retarget(impls[i], MemberSignatureComparer.RetargetedExplicitImplementationComparer);
Symbols\Retargeting\RetargetingSymbolTranslator.cs (3)
304PEModuleSymbol addedModule = (PEModuleSymbol)this.RetargetingAssembly.Modules[module.Ordinal]; 719var oldModifier = oldModifiers[i]; 1062return retargetedContainingType.TypeParameters[typeParameter.Ordinal];
Symbols\Source\CustomModifierUtils.cs (2)
128SourceParameterSymbolBase destinationParameter = (SourceParameterSymbolBase)destinationParameters[i]; 129ParameterSymbol sourceParameter = sourceParameters[i];
Symbols\Source\ExplicitInterfaceHelpers.cs (2)
402if (implementedMemberParameters[i].RefKind != collisionCandidateParameters[i].RefKind)
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (1)
332diagnostics.Add(ErrorCode.ERR_StructOffsetOnBadStruct, allAttributeSyntaxNodes[i].Name.Location);
Symbols\Source\LambdaSymbol.cs (1)
367type = parameterTypes[p];
Symbols\Source\SourceAssemblySymbol.cs (11)
183var peModuleSymbol = (Metadata.PE.PEModuleSymbol)_modules[i]; 996ModuleSymbol m = _modules[i]; 1028var m = (PEModuleSymbol)_modules[i]; 1196CSharpAttributeData attribute = appliedSourceAttributes[i]; 1287var peModuleSymbol = (Metadata.PE.PEModuleSymbol)_modules[i]; 1339CSharpAttributeData attribute = attributesFromNetModules[i]; 1343if (!attribute.HasErrors && ValidateAttributeUsageForNetModuleAttribute(attribute, netModuleNames[i], diagnostics, ref uniqueAttributes)) 1394var peModuleSymbol = (PEModuleSymbol)_modules[i]; 1499CSharpAttributeData attribute = attributesFromNetModules[i]; 1500if (!attribute.HasErrors && ValidateAttributeUsageForNetModuleAttribute(attribute, netModuleNames[i], BindingDiagnosticBag.Discarded, ref uniqueAttributes)) 2872var peModuleSymbol = (Metadata.PE.PEModuleSymbol)_modules[i];
Symbols\Source\SourceComplexParameterSymbol.cs (4)
434return definition.Parameters[this.Ordinal].MetadataName; 486return (SourceParameterSymbol)implParameters[this.Ordinal]; 507return (SourceParameterSymbol)defParameters[this.Ordinal]; 692if (parameters[i].Name.Equals(parameterName, StringComparison.Ordinal))
Symbols\Source\SourceConstructorSymbolBase.cs (1)
73if (this.IsVararg && (IsGenericMethod || ContainingType.IsGenericType || _lazyParameters.Length > 0 && _lazyParameters[_lazyParameters.Length - 1].IsParams))
Symbols\Source\SourceDelegateMethodSymbol.cs (1)
115var parameterSymbol = invoke.Parameters[i];
Symbols\Source\SourceMemberContainerSymbol.cs (25)
398var decl = declaration.Declarations[i]; 410mods, allowedModifiers, declaration.Declarations[i].NameLocation, diagnostics, 453: ErrorCode.ERR_DuplicateNameInNS, declaration.Declarations[i].NameLocation, this.Name, this.ContainingSymbol); 462diagnostics.Add(ErrorCode.ERR_DuplicateNameInClass, declaration.Declarations[i].NameLocation, this.ContainingSymbol, this.Name); 472var singleDeclaration = declaration.Declarations[i]; 1185found = group[initializerIndex]; 1212length += getInitializerLength(initializers[i]); 1258if (precedingInitializerIndex >= 0 && initializers[precedingInitializerIndex].Syntax.Span.Contains(position)) 2154var refKind1 = method1.Parameters[i].RefKind; 2155var refKind2 = method2.Parameters[i].RefKind; 2559if (!op1.ParameterTypesWithAnnotations[p].Equals(op2.ParameterTypesWithAnnotations[p], TypeCompareKind.AllIgnoreOptions)) 2998Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i - 1].First().Syntax, compilation), new LexicalSortKey(initializers[i].Last().Syntax, compilation)) < 0); 3003Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i].First().Syntax, compilation), new LexicalSortKey(initializers[i + 1].Last().Syntax, compilation)) < 0); 3006if (initializers[i].Length != 1) 3008Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i].First().Syntax, compilation), new LexicalSortKey(initializers[i].Last().Syntax, compilation)) < 0); 3068if (LexicalSortKey.Compare(sortKey, new LexicalSortKey(declaredMembers.InstanceInitializers[insertAt][0].Syntax, compilation)) < 0) 3077declaredMembers.DeclarationWithParameters.SyntaxTree == declaredMembers.InstanceInitializers[insertAt][0].Syntax.SyntaxTree && 3078declaredMembers.DeclarationWithParameters.Span.Contains(declaredMembers.InstanceInitializers[insertAt][0].Syntax.Span.Start)) 3081var declaredInitializers = declaredMembers.InstanceInitializers[insertAt]; 3945var methodParam = methodParams[i]; 3951var propertyParamType = (((i == numParams - 1) && !getNotSet) ? propertySymbol.TypeWithAnnotations : propertyParams[i].TypeWithAnnotations).Type;
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (8)
1293var baseParameter = baseParameters[i]; 1296var overrideParameter = overrideParameters[parameterIndex]; 1330var overrideParam = overrideParameters[i + overrideParameterOffset]; 1331var baseParam = baseParameters[i]; 1456var baseParameter = baseParameters[i]; 1457var overrideParameter = overrideParameters[i + overrideParameterOffset]; 1507var baseParameter = baseParameters[i]; 1508var overrideParameter = overrideParameters[i + overrideParameterOffset];
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
1136if (namespaceSegments[i] != thisNamespaceNames[i]) 1349if (namespaceSegments[i] != thisNamespaceNames[i])
Symbols\Source\SourceNamedTypeSymbol.cs (14)
268return (constraintTypes.Length > 0) ? constraintTypes[ordinal] : ImmutableArray<TypeWithAnnotations>.Empty; 297return (constraintKinds.Length > 0) ? constraintKinds[ordinal] : TypeParameterConstraintKind.None; 505var constraint = constraintClauses[i]; 516if (!mergeConstraints(originalConstraintTypes, ref originalConstraintTypesMap, ref mergedConstraintTypes, otherPartialConstraints[i])) 525diagnostics.Add(ErrorCode.ERR_PartialWrongConstraints, GetFirstLocation(), this, typeParameters[i]); 535Debug.Assert(originalConstraintTypes[j].Equals(mergedConstraintTypes[j], TypeCompareKind.ObliviousNullableModifierMatchesAny)); 582TypeWithAnnotations constraintType1 = mergedConstraintTypes?[index1] ?? originalConstraintTypes[index1]; 592TypeWithAnnotations constraintType2 = clause.ConstraintTypes[index2]; 632result[constraintTypes[i]] = i; // Use the first type among the duplicates as the source of the nullable information 658var constraint = constraintClauses[i]; 665mergeConstraints(ref mergedKind, originalConstraintTypes, otherPartialConstraints[i]); 1582diagnostics.Add(ErrorCode.ERR_ComImportWithoutUuidAttribute, allAttributeSyntaxNodes[index].Name.Location); 1630diagnostics.Add(ErrorCode.WRN_CoClassWithoutComImport, allAttributeSyntaxNodes[index].Location, this.Name); 1639diagnostics.Add(ErrorCode.ERR_DefaultMemberOnIndexedType, allAttributeSyntaxNodes[index].Name.Location);
Symbols\Source\SourceOrdinaryMethodSymbol.cs (7)
194(args.declaredConstraints[typeParameterSymbol.Ordinal].Constraints & (TypeParameterConstraintKind.ReferenceType | TypeParameterConstraintKind.Default)) == 0; 606var typeParameter1 = typeParameters1[i]; 607var typeParameter2 = typeParameters2[i]; 645var typeParameter = this.TypeParameters[i]; 648switch (declaredConstraints[i].Constraints & (TypeParameterConstraintKind.ReferenceType | TypeParameterConstraintKind.ValueType | TypeParameterConstraintKind.Default)) 676overriddenOrExplicitlyImplementedMethod.TypeParameters[i], overriddenOrExplicitlyImplementedMethod); 900else if (isVararg && (IsGenericMethod || ContainingType.IsGenericType || Parameters.Length > 0 && Parameters[Parameters.Length - 1].IsParams))
Symbols\Source\SourcePropertySymbol.cs (3)
759var definitionParameter = (SourceParameterSymbol)this.Parameters[i]; 760var implementationParameter = (SourceParameterSymbol)implementation.Parameters[i]; 763diagnostics.Add(ErrorCode.ERR_ScopedMismatchInParameterOfPartial, implementation.GetFirstLocation(), new FormattedSymbol(implementation.Parameters[i], SymbolDisplayFormat.ShortFormat));
Symbols\Source\SourceTypeParameterSymbol.cs (5)
134var typeParameter = (SourceTypeParameterSymbolBase)implementingPart.TypeParameters[_ordinal]; 193var typeParameter = (SourceTypeParameterSymbolBase)sourceMethod.SourcePartialDefinition.TypeParameters[_ordinal]; 733var constraintTypes = constraints.IsEmpty ? ImmutableArray<TypeWithAnnotations>.Empty : constraints[Ordinal]; 746return constraintKinds.IsEmpty ? TypeParameterConstraintKind.None : constraintKinds[Ordinal]; 779return ((object)overriddenMethod != null) ? overriddenMethod.TypeParameters[ordinal] : null;
Symbols\Source\TypeParameterConstraintClause.cs (2)
159TypeParameterConstraintClause constraintClause = constraintClauses[thisTypeParameter.Ordinal]; 225TypeParameterConstraintClause constraintClause = constraintClauses[thisTypeParameter.Ordinal];
Symbols\SubstitutedMethodSymbol.cs (5)
178return this.TypeArgumentsWithAnnotations[reducedFromTypeParameter.Ordinal].Type; 413if (!typeParameters[i].Equals( 414typeArguments[i].Type, 454if (!this.TypeArgumentsWithAnnotations[i].Equals(other.TypeArgumentsWithAnnotations[i], compareKind))
Symbols\SubstitutedPropertySymbol.cs (1)
161substituted[i] = new SubstitutedParameterSymbol(this, _containingType.TypeSubstitution, unsubstitutedParameters[i]);
Symbols\SubstitutedTypeParameterSymbol.cs (1)
71return reducedFrom.TypeParameters[this.Ordinal];
Symbols\Symbol_Attributes.cs (13)
344MessageID.IDS_FeatureGenericAttributes.CheckFeatureAvailability(diagnostics, attributesToBind[i]); 422Binder attributeBinder = binders[i]; 474CSharpAttributeData boundAttribute = boundAttributes[i]; 478attributesToBind[i].ArgumentList?.Arguments[0].Expression.Location is { } location) 785NamedTypeSymbol boundAttributeType = boundAttributeTypes[i]; 788if (binders[i] != earlyBinder.Next) 790earlyBinder = new EarlyWellKnownAttributeBinder(binders[i]); 795arguments.AttributeSyntax = attributesToBind[i]; 821var attributeType = attributeTypes[i]; 825this.EarlyDecodeWellKnownAttributeType(attributeType, attributeSyntaxList[i]); 859CSharpAttributeData boundAttribute = boundAttributes[i]; 860AttributeSyntax attributeSyntax = attributeSyntaxList[i]; 861Binder binder = binders[i];
Symbols\SymbolDistinguisher.cs (1)
203return _lazyDescriptions[index];
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (2)
63var parameter = Parameters[i]; 64var positionalMember = _positionalMembers[i];
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (1)
190var member = printableMembers[i];
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (2)
444if (!TypeSymbol.Equals(_parameters[i].Type, other._parameters[i].Type, compareKind))
Symbols\Tuples\TupleErrorFieldSymbol.cs (1)
212newOwner.TupleElementTypesWithAnnotations[TupleElementIndex],
Symbols\Tuples\TupleFieldSymbol.cs (1)
223newUnderlyingOwner = (NamedTypeSymbol)newUnderlyingOwner.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[NamedTypeSymbol.ValueTupleRestIndex].Type;
Symbols\Tuples\TupleTypeSymbol.cs (17)
145underlyingType = ((NamedTypeSymbol)underlyingType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[NamedTypeSymbol.ValueTupleRestIndex].Type); 213currentType = (NamedTypeSymbol)currentType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[NamedTypeSymbol.ValueTupleRestPosition - 1].Type; 295var sourceName = sourceNames[i]; 296var wasInferred = noInferredNames ? false : inferredNames[i]; 298if (sourceName != null && !wasInferred && (allMissing || string.CompareOrdinal(destinationNames[i], sourceName) != 0)) 300diagnostics.Add(ErrorCode.WRN_TupleLiteralNameMismatch, literal.Arguments[i].Syntax.Parent!.Location, sourceName, destination); 625var providedName = elementNames.IsDefault ? null : elementNames[tupleFieldIndex]; 672var isError = errorPositions.IsDefault ? false : errorPositions[tupleFieldIndex]; 712currentValueTuple = (NamedTypeSymbol)oldUnderlying.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[ValueTupleRestIndex].Type; 747var providedName = elementNames.IsDefault ? null : elementNames[i]; 748var location = elementLocations.IsDefault ? null : elementLocations[i]; 759elementTypes[i], 773elementTypes[i], 793found = (NamedTypeSymbol)found.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[ValueTupleRestPosition - 1].Type; 849var elementLocation = elementLocations[tupleFieldIndex]; 985var extensionTupleElementTypes = tuple.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[ValueTupleRestPosition - 1].Type.TupleElementTypesWithAnnotations; 1060var member = members[i];
Symbols\TypeMap.cs (5)
75TypeParameterSymbol tp = typeParameters[i]; 76TypeWithAnnotations ta = typeArguments[i]; 180parameters.Add(currentParameters[i]); 208TypeParameterSymbol tp = from[i]; 209TypeWithAnnotations ta = to[i];
Symbols\TypeSymbol.cs (4)
347addAllInterfaces(interfaces[i], visited, result); 361var baseInterface = baseInterfaces[i]; 2104var typeParameter1 = typeParameters1[i]; 2105var typeParameter2 = typeParameters2[i];
Symbols\TypeSymbolExtensions.cs (8)
869(TypeWithAnnotations nextTypeWithAnnotations, TypeSymbol? nextType) = getNextIterationElements(fields[i].TypeWithAnnotations, canDigThroughNullable); 885next = fields[i].TypeWithAnnotations; 900(TypeWithAnnotations nextTypeWithAnnotations, TypeSymbol? nextType) = getNextIterationElements(typeArguments[i], canDigThroughNullable); 916next = typeArguments[i]; 979(TypeWithAnnotations nextTypeWithAnnotations, TypeSymbol? nextType) = getNextIterationElements(currentPointer.Parameters[i].TypeWithAnnotations, canDigThroughNullable); 996next = currentPointer.Parameters[i].TypeWithAnnotations; 1618if (!typeParameters[i].Equals( 1619typeArguments[i].Type.OriginalDefinition,
Symbols\TypeUnification.cs (2)
170if (!CanUnifyHelper(nt1Arguments[i], 171nt2Arguments[i],
Symbols\TypeWithAnnotations.cs (1)
680transformFlag = transforms[position++];
Symbols\UnboundGenericType.cs (1)
54string name = (i < typeParameters.Length) ? typeParameters[i].Name : string.Empty;
Symbols\VarianceSafety.cs (2)
385TypeParameterSymbol typeParam = namedType.TypeParameters[i]; 386TypeSymbol typeArg = namedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[i].Type;
Syntax\CSharpSyntaxTree.cs (2)
215directives = _preprocessorStates[searchResult]; 224directives = _preprocessorStates[searchResult];
Syntax\NullableContextStateMap.cs (7)
55Debug.Assert(contexts[i - 1].Position < contexts[i].Position); 84Debug.Assert(_contexts[index].Position <= position); 85Debug.Assert(index == _contexts.Length - 1 || position < _contexts[index + 1].Position); 94return index < 0 ? GetContextForFileStart() : _contexts[index]; 107var context = index < 0 ? GetContextForFileStart() : _contexts[index]; 126context = _contexts[index];
Utilities\ValueSetFactory.NumericValueSet.cs (20)
42Debug.Assert(tc.Related(LessThanOrEqual, intervals[i].first, intervals[i].last)); 46Debug.Assert(tc.Related(LessThan, tc.Next(intervals[i - 1].last), intervals[i].first)); 68return _tc.ToConstantValue(this._intervals[this._intervals.Length - 1].last); 81return _intervals.Length > 0 && _tc.Related(relation, _intervals[_intervals.Length - 1].last, value); 96return _tc.Related(GreaterThanOrEqual, value, _intervals[lastIntervalIndex].first) && _tc.Related(LessThanOrEqual, value, _intervals[lastIntervalIndex].last); 99if (_tc.Related(LessThanOrEqual, value, _intervals[midIndex].last)) 118return _tc.Related(relation, _intervals[_intervals.Length - 1].last, value); 148builder.Add((_tc.Next(_intervals[i].last), _tc.Prev(_intervals[i + 1].first))); 152if (_tc.Related(LessThan, _intervals[lastIndex].last, _tc.MaxValue)) 154builder.Add((_tc.Next(_intervals[lastIndex].last), _tc.MaxValue)); 174var leftInterval = left[l]; 175var rightInterval = right[r]; 251var leftInterval = left[l]; 252var rightInterval = right[r]; 273var leftInterval = left[l]; 280var rightInterval = right[r];
Microsoft.CodeAnalysis.CSharp.CodeStyle (10)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (2)
160var lambdaParameter = lambdaMethod.Parameters[i]; 161var invokedParameter = invokedMethod.Parameters[i];
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\RemoveUnreachableCodeHelpers.cs (1)
65var currentStatement = siblingStatements[i];
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
204var element = arrayCreationElements[startIndex + i];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
53var tupleElementType = tupleType.TupleElements[i].Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
441var parameter = member.Parameters[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (4)
1142var oldInterpolationPart = oldInterpolationOperation.Parts[i]; 1143var newInterpolationPart = newInterpolationOperation.Parts[i]; 1439var originalParameter = originalParameters[i]; 1440var rewrittenParameter = rewrittenParameters[i];
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (9)
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
232var parameter = method.Parameters[index];
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (2)
113var match = matches[i]; 162var argument = matches[i].Node;
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
44var match = matches[i];
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
175var type = elements[i].Type;
src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\CSharpUseObjectInitializerCodeFixProvider.cs (1)
65var match = matches[i];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
694DetermineTypeParameterMapping(inferredNamedType.TypeArguments[i], returnNamedType.TypeArguments[i], result); 777var parameter = parameterSet[index];
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
src\Analyzers\CSharp\Tests\RemoveUnusedMembers\RemoveUnusedMembersTests.cs (1)
2218DiagnosticSelector = fixableDiagnostics => fixableDiagnostics[diagnosticIndex],
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (8)
CodeGen\CodeGenTupleTest.cs (8)
11684Assert.NotSame(parameters1[j], parameters2[j]); 11685Assert.True(parameters1[j].Equals(parameters2[j])); 11686Assert.True(parameters2[j].Equals(parameters1[j])); 11687Assert.Equal(parameters2[j].GetHashCode(), parameters1[j].GetHashCode());
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (8)
Attributes\AttributeTests_Dynamic.cs (1)
548TypedConstant actualTransformFlag = actualTransformFlags[i];
Diagnostics\DiagnosticAnalyzerTests.cs (2)
1725var file = files[i]; 2769(ControlFlowGraph actualFlowGraph, ISymbol associatedSymbol) = flowGraphs[i];
FieldKeywordTests.cs (4)
8924var property = (SourcePropertySymbol)properties[propertyIndex]; 8925var field = (property.BackingField is null) ? null : (SynthesizedBackingFieldSymbol)fields[fieldIndex++]; 9449var actualValues = getInitializerValues(comp, comp.SyntaxTrees[reverseOrder ? 1 : 0]); 9460actualValues = getInitializerValues(comp, comp.SyntaxTrees[reverseOrder ? 0 : 1]);
Semantics\RecordTests.cs (1)
23142var method = (MethodSymbol)members[i];
Microsoft.CodeAnalysis.CSharp.Features (23)
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (2)
416var part = namespaceParts[index].EscapeIdentifier(); 429var part = namespaceParts[index].EscapeIdentifier();
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (2)
388expression = MemberAccessExpression(SimpleMemberAccessExpression, expression, names[i]); 395subpattern = Subpattern(names[i], RecursivePattern(subpattern));
Completion\CompletionProviders\OperatorsAndIndexer\UnnamedSymbolCompletionProvider_Operators.cs (1)
84var (opName, position) = s_operatorInfo[i];
Completion\CompletionProviders\TupleNameCompletionProvider.cs (1)
104var field = type.TupleElements[index];
GenerateType\CSharpGenerateTypeService.cs (2)
74var typeParameter = parameterIndex < type.TypeParameters.Length ? type.TypeParameters[parameterIndex] : null; 81var typeParameter = parameterIndex < method.TypeParameters.Length ? method.TypeParameters[parameterIndex] : null;
ImplementInterface\CSharpImplementExplicitlyCodeRefactoringProvider.cs (2)
159if (!DefaultValueMatches(implParameters[i], interfaceParameters[i]))
InitializeParameter\CSharpInitializeMemberFromParameterCodeRefactoringProvider.cs (2)
112if (tupleRight.Elements[i] is IParameterReferenceOperation parameterReference && sibling.Equals(parameterReference.Parameter) && 113IsFieldOrPropertyReference(tupleLeft.Elements[i], sibling.ContainingType, out _))
SignatureHelp\LightweightOverloadResolution.cs (1)
226inParams |= method.Parameters[parameterIndex].IsParams;
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (2)
160var lambdaParameter = lambdaMethod.Parameters[i]; 161var invokedParameter = invokedMethod.Parameters[i];
src\Analyzers\CSharp\Analyzers\RemoveUnreachableCode\RemoveUnreachableCodeHelpers.cs (1)
65var currentStatement = siblingStatements[i];
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
204var element = arrayCreationElements[startIndex + i];
src\Analyzers\CSharp\CodeFixes\Nullable\CSharpDeclareAsNullableCodeFixProvider.cs (1)
232var parameter = method.Parameters[index];
src\Analyzers\CSharp\CodeFixes\UseCollectionExpression\CSharpUseCollectionExpressionForFluentCodeFixProvider.cs (2)
113var match = matches[i]; 162var argument = matches[i].Node;
src\Analyzers\CSharp\CodeFixes\UseCollectionInitializer\CSharpUseCollectionInitializerCodeFixProvider_CollectionInitializer.cs (1)
44var match = matches[i];
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (1)
175var type = elements[i].Type;
src\Analyzers\CSharp\CodeFixes\UseObjectInitializer\CSharpUseObjectInitializerCodeFixProvider.cs (1)
65var match = matches[i];
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (2)
Diagnostics\Configuration\ConfigureCodeStyle\MultipleCodeStyleOptionConfigurationTests.cs (1)
29var nestedActionForOptionIndex = ((AbstractConfigurationActionWithNestedActions)actions[0]).NestedActions[OptionIndex];
src\Analyzers\CSharp\Tests\RemoveUnusedMembers\RemoveUnusedMembersTests.cs (1)
2218DiagnosticSelector = fixableDiagnostics => fixableDiagnostics[diagnosticIndex],
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (117)
Semantics\FieldInitializerBindingTests.cs (1)
273var boundInit = boundInitializers[i++];
Semantics\NameOfTests.cs (8)
992var argument = nameofCalls[index].ArgumentList.Arguments.Single().Expression; 997var argument2 = nameofCalls2[index].ArgumentList.Arguments.Single().Expression; 1063var argument = nameofCalls[index].ArgumentList.Arguments.Single().Expression; 1068var argument2 = nameofCalls2[index].ArgumentList.Arguments.Single().Expression; 1149var argument = nameofCalls[index].ArgumentList.Arguments.Single().Expression; 1154var argument2 = nameofCalls2[index].ArgumentList.Arguments.Single().Expression; 1227var argument = nameofCalls[index].ArgumentList.Arguments.Single().Expression; 1232var argument2 = nameofCalls2[index].ArgumentList.Arguments.Single().Expression;
Semantics\NativeIntegerTests.cs (6)
281verifyInterface(underlyingInterfaces[i], nativeIntegerInterfaces[i]); 290var underlyingTypeArgument = underlyingInterface.TypeArguments[i]; 291var nativeIntegerTypeArgument = nativeIntegerInterface.TypeArguments[i]; 390verifyInterface(underlyingInterfaces[i], nativeIntegerInterfaces[i]);
Semantics\OperatorTests.cs (5)
3286s += arguments.Value[i].Type.ToString(); 8134Assert.Equal(symbol1.Parameters[i], symbol5.Parameters[i]); 8135Assert.Equal(symbol1.Parameters[i].GetHashCode(), symbol5.Parameters[i].GetHashCode());
SourceGeneration\GeneratorDriverTests.cs (57)
1699source => Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason)); 1711source => Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason)); 1750Assert.Equal(compilation, source.Source.Outputs[source.OutputIndex].Value); 1751Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason); 1766Assert.Equal(text1, source.Source.Outputs[source.OutputIndex].Value); 1767Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason); 1788Assert.Equal(compilation, source.Source.Outputs[source.OutputIndex].Value); 1789Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 1804Assert.Equal(text1, source.Source.Outputs[source.OutputIndex].Value); 1805Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 1819Assert.Equal(text2, source.Source.Outputs[source.OutputIndex].Value); 1820Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason); 1841Assert.Equal(newCompilation, source.Source.Outputs[source.OutputIndex].Value); 1842Assert.Equal(IncrementalStepRunReason.Modified, source.Source.Outputs[source.OutputIndex].Reason); 1857Assert.Equal(text1, source.Source.Outputs[source.OutputIndex].Value); 1858Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 1872Assert.Equal(text2, source.Source.Outputs[source.OutputIndex].Value); 1873Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 1893Assert.Equal(newCompilation, source.Source.Outputs[source.OutputIndex].Value); 1894Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 1909Assert.Equal(text1, source.Source.Outputs[source.OutputIndex].Value); 1910Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 1924Assert.Equal(text2, source.Source.Outputs[source.OutputIndex].Value); 1925Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 2010Assert.Equal(compilation, source.Source.Outputs[source.OutputIndex].Value); 2011Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason); 2015Assert.Equal(texts[0], ((ImmutableArray<AdditionalText>)source.Source.Outputs[source.OutputIndex].Value)[0]); 2016Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason); 2039Assert.Equal(compilation, source.Source.Outputs[source.OutputIndex].Value); 2040Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 2044Assert.Empty((ImmutableArray<AdditionalText>)source.Source.Outputs[source.OutputIndex].Value); 2045Assert.Equal(IncrementalStepRunReason.Modified, source.Source.Outputs[source.OutputIndex].Reason); 2065var value = ((Compilation, ImmutableArray<AdditionalText>))source.Source.Outputs[source.OutputIndex].Value; 2068Assert.Equal(IncrementalStepRunReason.Unchanged, source.Source.Outputs[source.OutputIndex].Reason); 2091Assert.Equal(newCompilation, source.Source.Outputs[source.OutputIndex].Value); 2092Assert.Equal(IncrementalStepRunReason.Modified, source.Source.Outputs[source.OutputIndex].Reason); 2096Assert.Empty((ImmutableArray<AdditionalText>)source.Source.Outputs[source.OutputIndex].Value); 2097Assert.Equal(IncrementalStepRunReason.Unchanged, source.Source.Outputs[source.OutputIndex].Reason); 2224AssertEx.EqualOrDiff(generatedContent[i], trees[i].ToString()); 2367AssertEx.EqualOrDiff(generatedContent[i], trees[i].ToString()); 2720var consumedInput = input.Source.Outputs[input.OutputIndex]; 2736var consumedInput = input.Source.Outputs[input.OutputIndex]; 2752var consumedInput = input.Source.Outputs[input.OutputIndex]; 2773var consumedInput = input.Source.Outputs[input.OutputIndex]; 2789var consumedInput = input.Source.Outputs[input.OutputIndex]; 2805var consumedInput = input.Source.Outputs[input.OutputIndex]; 2829var consumedInput = input.Source.Outputs[input.OutputIndex]; 2845var consumedInput = input.Source.Outputs[input.OutputIndex]; 2861var consumedInput = input.Source.Outputs[input.OutputIndex]; 2910var consumedInput = input.Source.Outputs[input.OutputIndex]; 2927var consumedInput = input.Source.Outputs[input.OutputIndex]; 2948var consumedInput = input.Source.Outputs[input.OutputIndex]; 2965var consumedInput = input.Source.Outputs[input.OutputIndex]; 2990var consumedInput = input.Source.Outputs[input.OutputIndex]; 3007var consumedInput = input.Source.Outputs[input.OutputIndex]; 3032var consumedInput = input.Source.Outputs[input.OutputIndex]; 3049var consumedInput = input.Source.Outputs[input.OutputIndex];
SourceGeneration\StateTableTests.cs (40)
387Assert.Equal(1, source.Source.Outputs[source.OutputIndex].Value); 388Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason); 393Assert.Equal(2, source.Source.Outputs[source.OutputIndex].Value); 394Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason); 399Assert.Equal(3, source.Source.Outputs[source.OutputIndex].Value); 400Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason); 450Assert.Equal(1, source.Source.Outputs[source.OutputIndex].Value); 451Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 456Assert.Equal(2, source.Source.Outputs[source.OutputIndex].Value); 457Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 462Assert.Equal(3, source.Source.Outputs[source.OutputIndex].Value); 463Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 497Assert.Equal(1, source.Source.Outputs[source.OutputIndex].Value); 498Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 503Assert.Equal(2, source.Source.Outputs[source.OutputIndex].Value); 504Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 509Assert.Equal(3, source.Source.Outputs[source.OutputIndex].Value); 510Assert.Equal(IncrementalStepRunReason.Removed, source.Source.Outputs[source.OutputIndex].Reason); 564Assert.Equal(1, source.Source.Outputs[source.OutputIndex].Value); 565Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 570Assert.Equal(2, source.Source.Outputs[source.OutputIndex].Value); 571Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 576Assert.Equal(4, source.Source.Outputs[source.OutputIndex].Value); 577Assert.Equal(IncrementalStepRunReason.Modified, source.Source.Outputs[source.OutputIndex].Reason); 646Assert.Equal(1, source.Source.Outputs[source.OutputIndex].Value); 647Assert.Equal(IncrementalStepRunReason.New, source.Source.Outputs[source.OutputIndex].Reason); 681Assert.Equal(1, source.Source.Outputs[source.OutputIndex].Value); 682Assert.Equal(IncrementalStepRunReason.Cached, source.Source.Outputs[source.OutputIndex].Reason); 719Assert.Equal(value, source.Source.Outputs[source.OutputIndex].Value); 720Assert.Equal(IncrementalStepRunReason.Modified, source.Source.Outputs[source.OutputIndex].Reason); 758Assert.Equal(value, source.Source.Outputs[source.OutputIndex].Value); 759Assert.Equal(IncrementalStepRunReason.Modified, source.Source.Outputs[source.OutputIndex].Reason); 881Assert.Equal(IncrementalStepRunReason.Cached, step.Inputs[0].Source.Outputs[step.Inputs[0].OutputIndex].Reason); 887Assert.Equal(IncrementalStepRunReason.Removed, step.Inputs[0].Source.Outputs[step.Inputs[0].OutputIndex].Reason); 893Assert.Equal(IncrementalStepRunReason.Removed, step.Inputs[0].Source.Outputs[step.Inputs[0].OutputIndex].Reason); 899Assert.Equal(IncrementalStepRunReason.New, step.Inputs[0].Source.Outputs[step.Inputs[0].OutputIndex].Reason); 905Assert.Equal(IncrementalStepRunReason.New, step.Inputs[0].Source.Outputs[step.Inputs[0].OutputIndex].Reason); 911Assert.Equal(IncrementalStepRunReason.New, step.Inputs[0].Source.Outputs[step.Inputs[0].OutputIndex].Reason); 988Assert.Equal(IncrementalStepRunReason.Modified, input.Source.Outputs[input.OutputIndex].Reason); 1017Assert.Equal(IncrementalStepRunReason.Modified, input.Source.Outputs[input.OutputIndex].Reason);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (8)
Compilation\SemanticModelGetSemanticInfoTests.cs (1)
14736var tree = compilation.SyntaxTrees[i];
Symbols\CompilationCreationTests.cs (1)
44Assert.Equal(expectedSyntaxTrees[i], actualSyntaxTrees[i]);
Symbols\IndexerTests.cs (1)
216var parameter = parameters[i];
Symbols\Retargeting\RetargetingTests.cs (4)
701CheckParameters(source[i], retargeting[i]); 1206CheckSymbols(a[i], b[i], recurse);
Symbols\Source\DeclaringSyntaxNodeTests.cs (1)
129Assert.Same(expectedSyntaxNodes[i], declaringReferences[i].GetSyntax());
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (2)
IncrementalParsing\IncrementalParsingTests.cs (1)
120if (diffI < diffs.Length && diffs[diffI].IsKind(kind))
Parsing\ParsingTests.cs (1)
361stringBuilder.Append(tokens[i].Text);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (19)
CSharpTestBase.cs (7)
1651return new Tuple<TNode, SemanticModel>(node, compilation.GetSemanticModel(compilation.SyntaxTrees[treeIndex])); 1662return new Tuple<IList<TNode>, SemanticModel>(nodes, compilation.GetSemanticModel(compilation.SyntaxTrees[treeIndex])); 1671var tree = compilation.SyntaxTrees[treeIndex]; 1692var tree = compilation.SyntaxTrees[treeIndex]; 1968var typeRef = localInfos[i].Type; 1970result[i] = new ILVisualizer.LocalInfo(builderLocal.Name, typeRef, localInfos[i].IsPinned, localInfos[i].IsByRef);
Extensions.cs (10)
216m.Parameters.All(p => p.RefKind == RefKind.Out && p.Type.Equals(primaryConstructor.Parameters[p.Ordinal].Type, SymbolEqualityComparer.Default))); 241var nestedContainer = (NamespaceOrTypeSymbol)lastContainer.GetMember(parts[i]); 254return lastContainer.GetMembers(parts[parts.Length - 1]); 264var nestedContainer = (INamespaceOrTypeSymbol)lastContainer.GetMember(parts[i]); 277return lastContainer.GetMembers(parts[parts.Length - 1]); 405var arg = attr.CommonConstructorArguments[i]; 412var namedArg = attr.CommonNamedArguments[i]; 507if (!IsEqual(actArgs[i], expArgs[i])) 558var c = tc[i]; 699public static ITypeSymbol GetParameterType(this IMethodSymbol method, int index) => method.Parameters[index].Type;
FunctionPointerUtilities.cs (1)
244ITypeSymbol signatureParamType = signature.Parameters[i].Type;
TestAttributesVisitor.cs (1)
183printValue(builder, values[i]);
Microsoft.CodeAnalysis.CSharp.Workspaces (10)
Rename\CSharpRenameRewriterLanguageService.cs (1)
830var matchingParameterSymbol = methodSymbol.PartialImplementationPart.Parameters[renamedParameterSymbol.Ordinal];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\CodeStyle\TypeStyle\TypeStyleHelper.cs (1)
53var tupleElementType = tupleType.TupleElements[i].Type;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (1)
441var parameter = member.Parameters[index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (4)
1142var oldInterpolationPart = oldInterpolationOperation.Parts[i]; 1143var newInterpolationPart = newInterpolationOperation.Parts[i]; 1439var originalParameter = originalParameters[i]; 1440var rewrittenParameter = rewrittenParameters[i];
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
694DetermineTypeParameterMapping(inferredNamedType.TypeArguments[i], returnNamedType.TypeArguments[i], result); 777var parameter = parameterSet[index];
Microsoft.CodeAnalysis.Debugging.Package (9)
CustomDebugInfoReader.cs (9)
435var importString = importStrings[pos]; 455var importString = importStrings[pos]; 527return bytes[i] | (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24); 539return (short)(bytes[i] | (bytes[i + 1] << 8)); 551return bytes[i];
Microsoft.CodeAnalysis.EditorFeatures (6)
EditAndContinue\ActiveStatementTrackingService.cs (2)
271var oldSpan = oldSpans[i]; 272var newSpan = newSpans[i];
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (3)
390if (!replacements[i].Equals(firstDocumentReplacements.Item2[i])) 421if (documentNewText.ToString(replacements[i].NewSpan) != firstDocumentNewSpanText[i])
ReferenceHighlighting\NavigateToHighlightReferenceCommandHandler.cs (1)
108return orderedTagSpans[destIndex];
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (2)
ObsoleteSymbol\AbstractObsoleteSymbolTests.cs (1)
33var document = documents[i];
ReassignedVariable\AbstractReassignedVariableTests.cs (1)
32var document = documents[i];
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (9)
CodeFixes\ExtensionOrderingTests.cs (1)
147var nextCodeFixProvider = actualOrder[i];
Diagnostics\DiagnosticAnalyzerServiceTests.cs (1)
463analyzer = (AdditionalFileAnalyzer)analyzers[i];
InheritanceMargin\InheritanceMarginTests.cs (2)
120await VerifyInheritanceMemberAsync(testWorkspace, sortedExpectedItems[i], sortedActualItems[i]); 136await VerifyInheritanceTargetAsync(testWorkspace, expectedTargets[i], actualItem.TargetItems[i]);
StackTraceExplorer\StackTraceExplorerTests.cs (1)
70Assert.Equal(contents[i], frames[i].ToString());
Utilities\StackFrameUtils.cs (2)
135AssertEqual(expected[i], actual[i]);
ValueTracking\AbstractBaseValueTrackingTests.cs (2)
49ValidateItem(items[i], itemInfo[i].line, itemInfo[i].text); 62ValidateItem(children[i], childInfo[i].line, childInfo[i].text);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (3)
InlineHints\InlineHintsTag.cs (1)
227result.Add(taggedTexts[i]);
StringIndentation\StringIndentationTag.cs (2)
58if (!_provider.SpanEquals(this.OrderedHoleSpans[i], other.OrderedHoleSpans[i]))
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (5)
DkmUtilities.cs (1)
196var previousBlock = previousMetadataBlocks[index];
ImmutableArrayExtensions.cs (1)
16if (predicate(array[i], arg))
InstructionDecoder.cs (1)
86var parameter = parameters[i];
PDB\MethodDebugInfo.Native.cs (2)
714string? name = (i < names.Length) ? names[i] : null; 722builder.Add(symbolProvider.GetLocalVariable(name, i, localInfo[i], dynamicFlags, tupleElementNames));
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (4)
CSharp\MemberSignatureParser.cs (1)
47private Token CurrentToken => _tokens[_tokenIndex];
MetadataDecoder.cs (1)
151var name = typeParameters[index - containingArity];
VisualBasic\MemberSignatureParser.cs (2)
51private Token CurrentToken => _tokens[_tokenIndex]; 55return _tokens[_tokenIndex + offset];
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Debugger\Engine\DkmInspectionSession.cs (1)
92var item = _implementations[index];
Microsoft.CodeAnalysis.ExternalAccess.Razor (1)
RazorSpanMappingServiceWrapper.cs (1)
56var razorSpan = razorSpans[i];
Microsoft.CodeAnalysis.Features (153)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.AddConstructorParametersCodeAction.cs (1)
75var parameterName = _missingParameters[i].Name;
ChangeSignature\AbstractChangeSignatureService.cs (12)
485var decl = declarationParametersToPermute[i]; 560if (!arguments[i].IsNamed && removedParams && i >= updatedSignature.UpdatedConfiguration.ToListOfParameters().Length) 565if (!arguments[i].IsNamed || updatedSignature.UpdatedConfiguration.ToListOfParameters().Any(static (p, arg) => p.Name == arg.arguments[arg.i].GetName(), (arguments, i))) 567newArguments.Add(arguments[i]); 635parametersToPermute.Add(originalParameters[position]); 842parameters[indexInListOfPreexistingArguments].IsParams) 850var newArgument = CreateExplicitParamsArrayFromIndividualArguments(newArguments, indexInListOfPreexistingArguments, parameters[indexInListOfPreexistingArguments]); 851newArgument = AddNameToArgument(newArgument, parameters[indexInListOfPreexistingArguments].Name); 857newArgument = AddNameToArgument(newArgument, parameters[indexInListOfPreexistingArguments].Name); 884newArgument = AddNameToArgument(newArgument, parameters[indexInListOfPreexistingArguments].Name); 1007updatedNodeList.Add(permutedParamNodes[index].WithLeadingTrivia(content.GetLeadingTrivia()).WithTrailingTrivia(content.GetTrailingTrivia())); 1025extraNodeList.Add(permutedParamNodes[index]);
ChangeSignature\SignatureChange.cs (2)
112if (originalListWithoutRemovedOrAdded[i] != updatedListWithoutRemovedOrAdded[i])
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaBatchFixHelpers.cs (2)
59var originalpragmaAction = pragmaActions[i]; 60var diagnostic = diagnostics[i];
CodeFixes\Suppression\AbstractSuppressionCodeFixProvider.PragmaHelpers.cs (2)
81var trivia = triviaList[index]; 96? triviaList[index]
CodeLens\CodeLensReferencesService.cs (2)
298var part = parts[index]; 303switch (parts[index + 1].Kind)
CodeRefactorings\AddAwait\AbstractAddAwaitCodeRefactoringProvider.cs (1)
48var expression = expressions[i];
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (3)
141var namespaceName = semanticModel.GetRequiredDeclaredSymbol(originalNamespaceDeclarations[i], cancellationToken).ToDisplayString(); 157var namespaceToRename = namespaces[i]; 405builder.Add(CreateImport(generator, names[i], withFormatterAnnotation));
Completion\Providers\AbstractSymbolCompletionProvider.cs (1)
192var symbol = symbolList[index];
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
332var originalProperty = originalProperties[i];
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
317syntaxFacts.ConvertToSingleLine(expressions[index], useElasticTrivia: true).WithAdditionalAnnotations(Formatter.Annotation));
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (3)
680if (!comparer.Equals(fields1[i].Name, fields2[i].Name)) 860generator.IdentifierName(constructor.Parameters[index].Name),
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (10)
804var oldStatementSpan = oldActiveStatements[i].UnmappedSpan; 831if (TryGetTrackedStatement(newActiveStatementSpans, oldActiveStatements[i].Statement.Id, newText, newBody, out var trackedStatement, out var trackedStatementPart)) 861var ancestors = GetExceptionHandlingAncestors(newStatement, newBody.EncompassingAncestor, oldActiveStatements[i].Statement.IsNonLeaf); 870newActiveStatements[i] = GetActiveStatementWithSpan(oldActiveStatements[i], newBody.SyntaxTree, newStatementSpan, diagnostics, cancellationToken); 881newActiveStatements[i] = oldActiveStatements[i].Statement.WithSpan(default); 4604var newAttribute = newAttributes[i]; 6017index.Add(array[i].Key, i); 6172var oldCapture = oldCaptures[oldCaptureIndex]; 6191var newCapture = newCaptures[newCaptureIndex]; 6223var oldCapture = oldCaptures[oldCaptureIndex];
EditAndContinue\ActiveStatementsMap.cs (2)
319while (start > 0 && startPositionComparer(spans[start - 1], spanStart) == 0) 325while (end < spans.Length && startPositionComparer(spans[end], spanStart) == 0)
EditAndContinue\DebuggingSession.cs (1)
671var documentId = documentIds[i];
EditAndContinue\DocumentActiveStatementChanges.cs (2)
29Debug.Assert(oldSpans[i].ExceptionRegions.Spans.Length == newExceptionRegions[i].Length);
EditAndContinue\EditAndContinueDiagnosticDescriptors.cs (2)
180=> s_descriptors[GetDescriptorIndex(kind)]; 183=> s_descriptors[GetDescriptorIndex(errorCode)];
EditAndContinue\EditSession.cs (4)
1199var (_, oldActiveStatement, oldActiveStatementExceptionRegions) = oldActiveStatements[i]; 1200var newActiveStatement = newActiveStatements[i]; 1201var newActiveStatementExceptionRegions = newExceptionRegions[i]; 1259AddNonRemappableRegion(oldActiveStatementExceptionRegions.Spans[j], newActiveStatementExceptionRegions[j], isExceptionRegion: true);
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (1)
171var parameter = argIndex < parameters.Length ? parameters[argIndex.Value] : null;
EmbeddedLanguages\Json\JsonNodes.cs (3)
41return Sequence[index]; 155return Sequence[index - 1]; 314return Sequence[index - 3];
EmbeddedLanguages\Json\JsonParser.JsonNetSyntaxChecks.cs (2)
165var child = sequence[i]; 166var nextChild = sequence[i + 1];
EmbeddedLanguages\Json\JsonParser.StrictSyntaxChecker.cs (1)
133var child = sequence[i];
EmbeddedLanguages\StackFrame\StackFrameNodeDefinitions.cs (2)
339_ => ArrayRankSpecifiers[index - 1] 379return CommaTokens[index - 1];
ExtractMethod\MethodExtractor.Analyzer.cs (1)
436return variableInfo.SetItem(index, VariableInfo.CreateReturnValue(variableInfo[index]));
FindUsages\DefinitionsAndReferences.cs (1)
41var reference = references[i];
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (1)
204var parameterType = parameterTypes[i];
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (3)
422semanticModel, methodSymbol.Parameters[i], blockStatement, cancellationToken); 432semanticModel, methodSymbol.Parameters[i], blockStatement, cancellationToken); 436return statementIndex > 0 && blockStatement.Operations[statementIndex - 1] is { IsImplicit: false, Syntax: var priorSyntax }
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (5)
385var parameter = parameters[i]; 386var fieldOrProperty = fieldsOrProperties[i]; 594return statementIndex > 0 && blockStatement.Operations[statementIndex - 1] is { IsImplicit: false, Syntax: var priorSyntax } 654var target = targetTuple.Elements[i]; 655var value = valueTuple.Elements[i];
InitializeParameter\InitializeParameterHelpersCore.cs (2)
26siblings.Add((method.Parameters[i], before: true)); 31siblings.Add((method.Parameters[i], before: false));
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.cs (1)
92var structuralType = transitiveStructuralTypeReferences[i];
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
737parts.AddRange(TypeParameterName(typeParameters[i].Name));
MetadataAsSource\AbstractMetadataAsSourceService.DocCommentFormatter.cs (7)
59lineBuilder.Append(string.Format(s_labelFormat, parameterNames[i])); 63docCommentFormattingService.Format(docComment.GetParameterText(parameterNames[i])), 83lineBuilder.Append(string.Format(s_labelFormat, typeParameterNames[i])); 87docCommentFormattingService.Format(docComment.GetTypeParameterText(typeParameterNames[i])), 110var rawExceptionTexts = docComment.GetExceptionTexts(exceptionTypes[i]); 121lineBuilder.Append(string.Format(s_labelFormat, exceptionTypes[i])); 124AddWrappedTextFromRawText(docCommentFormattingService.Format(rawExceptionTexts[j]), formattedCommentLinesBuilder);
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (1)
232var (roslynKind, vsKind) = s_kindPairs[i];
Shared\Extensions\ISymbolExtensions_Sorting.cs (2)
75var xParam = xParameters[i]; 76var yParam = yParameters[i];
SignatureHelp\CommonSignatureHelpUtilities.cs (1)
40argumentIndex < argumentCount ? argumentNames[argumentIndex] : null,
Snippets\RoslynLSPSnippetConverter.cs (1)
89var placeholder = placeholders[i];
src\Analyzers\Core\Analyzers\Helpers\HashCodeAnalyzer\HashCodeAnalyzer.cs (1)
198var statement = statements[i];
src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchStatementHelpers.cs (1)
22if (HasDefaultCase(switchStatement.Cases[index]))
src\Analyzers\Core\Analyzers\SimplifyInterpolation\AbstractSimplifyInterpolationHelpers.cs (1)
133return IsInvariantCultureReference(invocation.Arguments[formatProviderArgumentIndex].Value)
src\Analyzers\Core\Analyzers\UseConditionalExpression\ForReturn\UseConditionalExpressionForReturnHelpers.cs (1)
59falseStatement = parentBlock.Operations[ifIndex + 1];
src\Analyzers\Core\Analyzers\UseThrowExpression\AbstractUseThrowExpressionDiagnosticAnalyzer.cs (3)
150statements[ifOperationIndex + 1].Syntax, 151statements[expressionStatementIndex - 1].Syntax); 178expressionStatement = containingBlock.Operations[i] as IExpressionStatementOperation;
src\Analyzers\Core\CodeFixes\AddExplicitCast\AbstractAddExplicitCastCodeFixProvider.cs (1)
202if (argumentName.Equals(parameters[j].Name))
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (2)
153var parameterType = parameters[parameterIndex].Type; 154if (parameters[parameterIndex].IsParams
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
493var parameter = method.Parameters[i];
src\Analyzers\Core\CodeFixes\AliasAmbiguousType\AbstractAliasAmbiguousTypeCodeFixProvider.cs (2)
92var t1NameSegment = t1NameSegments[i]; 93var t2NameSegment = t2NameSegments[i];
src\Analyzers\Core\CodeFixes\DocumentationComments\AbstractAddDocCommentNodesCodeFixProvider.cs (2)
68var parameterName = parameterNames[index]; 90nodeBeforeNewParamNode = GetParamNodeForParamName(paramNodes, parameterNames[index - 1]);
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (7)
258var ctorParameter = ctor.Parameters[i]; 259var result = SymbolEquivalenceComparer.Instance.Equals(ctorParameter.Type, ParameterTypes[i]) && 260ctorParameter.RefKind == _parameterRefKinds[i]; 278=> _arguments.IsDefault || index >= _arguments.Length ? string.Empty : _arguments[index].Name; 422var parameterName = parameterNames[i]; 423var parameterType = parameterTypes[i]; 424var argument = arguments[i];
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (2)
105var constructorParameter = constructorInCompilation.Parameters[i]; 109var expression = expressions[i];
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (6)
187if (typeArguments[i] != null) 189result[typeArguments[i]] = typeParameters[i]; 219refKind: modifiers[i], 221isOptional: optionality[i], 223name: names[i].BestNameForParameter));
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (1)
99(INamedTypeSymbol)symbol.ConstraintTypes[i], projects).ConfigureAwait(false);
src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (1)
222var parameter = containingMethod.Parameters[i];
src\Analyzers\Core\CodeFixes\ImplementInterface\AbstractImplementInterfaceCodeFixProvider.cs (2)
182var (typeA, membersA) = state.MembersWithoutExplicitOrImplicitImplementation[i]; 183var (typeB, membersB) = state.MembersWithoutExplicitImplementation[i];
src\Analyzers\Core\CodeFixes\MakeMemberStatic\AbstractMakeMemberStaticCodeFixProvider.cs (1)
37var declaration = diagnostics[i].Location.FindNode(cancellationToken);
src\Analyzers\Core\CodeFixes\MakeTypeAbstract\AbstractMakeTypeAbstractCodeFixProvider.cs (1)
37if (IsValidRefactoringContext(diagnostics[i].Location?.FindNode(cancellationToken), out var typeDeclaration))
src\Analyzers\Core\CodeFixes\UseConditionalExpression\ForAssignment\AbstractUseConditionalExpressionForAssignmentCodeFixProvider.cs (1)
198localDeclaration = parentBlock.Operations[ifIndex - 1] as IVariableDeclarationGroupOperation;
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (7)
510return TypeInfo.Create(methodContext.TypeParameters[methodTypeParameterIndex]); 552if (methodContext.TypeParameters[i].Name == typeParameterName) 554return TypeInfo.Create(methodContext.TypeArguments[i]); 564if (containingType.TypeParameters[i].Name == typeParameterName) 566return TypeInfo.Create(containingType.TypeArguments[i]); 784if (!ParameterMatches(symbolParameters[i], expectedParameters[i])) 848return typeParameters[index];
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (9)
435var importString = importStrings[pos]; 455var importString = importStrings[pos]; 527return bytes[i] | (bytes[i + 1] << 8) | (bytes[i + 2] << 16) | (bytes[i + 3] << 24); 539return (short)(bytes[i] | (bytes[i + 1] << 8)); 551return bytes[i];
StackTraceExplorer\AbstractStackTraceSymbolResolver.cs (1)
93var paramSymbol = parameters[i];
UseNamedArguments\AbstractUseNamedArgumentsCodeRefactoringProvider.cs (1)
157? WithName((TSimpleArgumentSyntax)argument.WithoutTrivia(), parameters[i].Name).WithTriviaFrom(argument)
Wrapping\BinaryExpression\AbstractBinaryExpressionWrapper.cs (1)
78var item = exprsAndOperators[i];
Wrapping\BinaryExpression\BinaryExpressionCodeActionComputer.cs (5)
95var left = _exprsAndOperators[i - 1].AsNode(); 96var opToken = _exprsAndOperators[i].AsToken(); 97var right = _exprsAndOperators[i + 1].AsNode(); 132_exprsAndOperators[i], SingleWhitespaceTrivia, 133NoTrivia, _exprsAndOperators[i + 1]));
Wrapping\ChainedExpression\ChainedExpressionCodeActionComputer.cs (4)
148var chunk = _chunks[i]; 160_chunks[i - 1].Last(), _newlineBeforeOperatorTrivia, 194result.Add(Edit.DeleteBetween(chunk[i - 1], chunk[i]));
Microsoft.CodeAnalysis.Features.Test.Utilities (9)
EditAndContinue\ActiveStatementsDescription.cs (3)
65var oldStatement = OldStatements[i]; 78? newExceptionRegionMarkers[ordinal].SelectAsArray(span => (SourceFileSpan)newTree.GetMappedLineSpan(span)) 114? exceptionRegionMarkers[ordinal].SelectAsArray(unmappedRegionSpan => (SourceFileSpan)tree.GetMappedLineSpan(unmappedRegionSpan))
EditAndContinue\EditAndContinueTestVerifier.cs (4)
86var activeStatement = actualNewActiveStatements[i]; 87AssertSpansEqual(description.NewMappedRegions[activeStatement.Id.Ordinal], actualNewExceptionRegions[i], newTree); 301var expectedSemanticEdit = expectedSemanticEdits[i]; 302var actualSemanticEdit = actualSemanticEdits[i];
EditAndContinue\SyntaxMapDescription.cs (1)
25return match.NewRoot.SyntaxTree.GetLineSpan(Spans[index].newSpan).StartLinePosition;
Snippets\AbstractSnippetProviderTests.cs (1)
101var expectedSpan = expectedSpans[j];
Microsoft.CodeAnalysis.InteractiveHost (3)
Interactive\Core\InteractiveHost.Service.cs (1)
779displayedDiagnostics.Add(diagnostics[i]);
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
252hashCode = unchecked((hashCode ^ data[i]) * Hash.FnvPrime);
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
603Add(items[i]);
Microsoft.CodeAnalysis.LanguageServer.Protocol (19)
Extensions\ProtocolConversions.cs (2)
418var mappedSpan = mappedResults.Value[i]; 419var textChange = textChanges[i];
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (1)
299var oldSpan = oldMemberSpans[memberId];
Handler\CodeLens\CodeLensHandler.cs (1)
95var member = members[i];
Handler\Completion\CompletionResultFactory.cs (8)
185var preferredKind = completionItemKinds[i]; 213var preferredTag = completionItemTags[i]; 441var xKind = x[i].Kind; 442var yKind = y[i].Kind; 448var xCharacters = x[i].Characters; 449var yCharacters = y[i].Characters; 457if (xCharacters[j] != yCharacters[j])
Handler\Configuration\DidChangeConfigurationNotificationHandler.cs (2)
92var valueFromClient = configurationsFromClient[i]; 93var (option, languageName) = _optionsAndLanguageNamesToRefresh[i];
Handler\InlayHint\InlayHintHandler.cs (2)
63var hint = hints[i]; 135result.Add(taggedTexts[i]);
Handler\InlayHint\InlayHintResolveHandler.cs (2)
67inlineHintToResolve = hints[resolveData.ListIndex]; 79return cacheEntry?.InlayHintMembers[resolveData.ListIndex];
Handler\SpellCheck\AbstractSpellCheckingHandler.cs (1)
188var span = spans[i];
Microsoft.CodeAnalysis.PooledObjects.Package (1)
ArrayBuilder.cs (1)
603Add(items[i]);
Microsoft.CodeAnalysis.Scripting (5)
ScriptExecutionState.cs (2)
95await precedingExecutors[executorIndex++](_submissionStates).ConfigureAwait(continueOnCapturedContext: false); 137Activator.CreateInstance(precedingExecutors[executorIndex++].GetMethodInfo().DeclaringType, submissionCtorArgs);
ScriptState.cs (2)
91return GetVariableMap().TryGetValue(name, out index) ? Variables[index] : null; 126map[Variables[i].Name] = i;
Utilities\ParameterValidationHelpers.cs (1)
26if (items[i] == null)
Microsoft.CodeAnalysis.Test.Utilities (47)
Compilation\ControlFlowGraphVerifier.cs (22)
94Assert.Equal(graph.Blocks[i].IsReachable, reachabilityVector[i]); 124var block = blocks[i]; 192var predecessorBranch = predecessors[predecessorIndex]; 197Assert.Same(blocks[predecessor.Ordinal], predecessor); 211if (predecessorIndex < predecessors.Length - 1 && predecessors[predecessorIndex + 1].Source == predecessor) 216predecessorBranch = predecessors[predecessorIndex]; 251Assert.Same(blocks[conditionalBranch.Destination.Ordinal], conditionalBranch.Destination); 290Assert.Same(blocks[nextBranch.Destination.Ordinal], nextBranch.Destination); 389BasicBlock block = blocks[i]; 412var operation = block.Operations[j]; 436if (blocks[i + 1].Predecessors.IsEmpty) 438adjustAndGetEntryState(entryStates, blocks[i + 1], currentState); 488lastOperation = blocks[i].BranchValue ?? blocks[i].Operations.LastOrDefault(); 739adjustAndGetEntryState(entryStates, blocks[region.EnclosingRegion.NestedRegions[1].FirstBlockOrdinal], state); 748adjustAndGetEntryState(entryStates, blocks[@finally.FirstBlockOrdinal], state); 1308for (var j = blocks[i].Operations.Length - 1; j >= 0; j--) 1310if (blocks[i].Operations[j] is IFlowCaptureOperation capture) 1323BasicBlock block = blocks[i]; 1518var method = region.LocalFunctions[i]; 1607ControlFlowRegion r = branch.EnteringRegions[j];
Compilation\OperationTreeVerifier.cs (2)
879Assert.Equal(argumentNames[i], operation.GetArgumentName(i)); 906Assert.Equal(argumentRefKinds[i], operation.GetArgumentRefKind(i));
Diagnostics\DiagnosticDescription.cs (1)
65string.Format(EnsureEnglishUICulture.PreferredOrNull, _originalFormatSpecifiers[i], o) :
Diagnostics\OptionsDiagnosticAnalyzer.cs (2)
57if (actual.AdditionalFiles[i].Path != expected.AdditionalFiles[i].Path)
Diagnostics\ThrowingDiagnosticAnalyzer.cs (1)
76var member = AllAnalyzerMemberNames[i];
InstrumentationChecker.cs (5)
66if (snippets[index] == null) 72output.Builder.AppendLine($" .True(\"{snippets[index]}\"){termination}"); 201if (snippets[index] == null) 207output.Builder.AppendLine($"{tab}{tab}{tab}{tab}True(\"{snippets[index]}\"){termination}"); 349var actualSpans = reader.GetSpans(reader.Methods[method - 1].Blob);
Metadata\AggregatedMetadataReader.cs (1)
37return getter(Readers[generation], genHandle);
Metadata\ILValidation.cs (3)
275while (offset < ilArray.Length && ilArray[offset] == 0) 290result.AppendFormat("<invalid byte 0x{0:X2} at offset {1}>", ilArray[offset], offset); 316while (offset < ilArray.Length && ilArray[offset] == 0)
Metadata\MetadataReaderUtils.cs (2)
255if (metadata[i + offset] != bytes[i])
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (8)
44if (!blocks[i].IsReachable) 46unreachableBlocksToVisit.Add(blocks[i]); 81var firstBlock = blocks[firstBlockOrdinal]; 97current = blocks[min]; 281var previousAnalysisData = analyzer.GetCurrentAnalysisData(blocks[@finally.FirstBlockOrdinal]); 327var currentAnalysisData = analyzer.GetCurrentAnalysisData(blocks[fromRegion.FirstBlockOrdinal]); 380var @catch = tryAndCatch.NestedRegions[i]; 389var entryBlock = blocks[@catch.FirstBlockOrdinal];
Microsoft.CodeAnalysis.UnitTests (5)
Collections\ImmutableListTestBase.cs (2)
489int min = inputData[sortedIndex]; 490int max = inputData[sortedIndex + sortedLength - 1];
Collections\TemporaryArrayTests.cs (1)
234Assert.Equal(array[i], sortedArray[i]);
Collections\TopologicalSortTests.cs (1)
218var n = sorted[i];
Text\StringTextTest.cs (1)
36byte b = checksum[i];
Microsoft.CodeAnalysis.VisualBasic (1)
BoundTree\BoundTreeRewriter.vb (1)
25Dim item As T = list.Item(i)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (24)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (24)
1849Assert.True(syntax.SpanStart = tpSymbol1.Locations.Item(0).SourceSpan.Start OrElse 1850syntax.SpanStart = tpSymbol1.Locations.Item(1).SourceSpan.Start, 1858Assert.True(syntax.SpanStart = tpSymbol2.Locations.Item(0).SourceSpan.Start OrElse 1859syntax.SpanStart = tpSymbol2.Locations.Item(1).SourceSpan.Start, 1867Assert.True(syntax.SpanStart = tpSymbol3.Locations.Item(0).SourceSpan.Start OrElse 1868syntax.SpanStart = tpSymbol3.Locations.Item(1).SourceSpan.Start, 1876Assert.True(syntax.SpanStart = tpSymbol4.Locations.Item(0).SourceSpan.Start OrElse 1877syntax.SpanStart = tpSymbol4.Locations.Item(1).SourceSpan.Start, 2022Assert.True(syntax.SpanStart = varSymbol1.Locations.Item(0).SourceSpan.Start OrElse 2023syntax.SpanStart = varSymbol1.Locations.Item(1).SourceSpan.Start, 2032Assert.True(syntax.SpanStart = varSymbol2.Locations.Item(0).SourceSpan.Start OrElse 2033syntax.SpanStart = varSymbol2.Locations.Item(1).SourceSpan.Start, 2042Assert.True(syntax.SpanStart = varSymbol3.Locations.Item(0).SourceSpan.Start OrElse 2043syntax.SpanStart = varSymbol3.Locations.Item(1).SourceSpan.Start, 2052Assert.True(syntax.SpanStart = varSymbol4.Locations.Item(0).SourceSpan.Start OrElse 2053syntax.SpanStart = varSymbol4.Locations.Item(1).SourceSpan.Start, 2062Assert.True(syntax.SpanStart = varSymbol5.Locations.Item(0).SourceSpan.Start OrElse 2063syntax.SpanStart = varSymbol5.Locations.Item(1).SourceSpan.Start, 2072Assert.True(syntax.SpanStart = varSymbol6.Locations.Item(0).SourceSpan.Start OrElse 2073syntax.SpanStart = varSymbol6.Locations.Item(1).SourceSpan.Start, 2083Assert.True(syntax.SpanStart = varSymbol7.Locations.Item(0).SourceSpan.Start OrElse 2084syntax.SpanStart = varSymbol7.Locations.Item(1).SourceSpan.Start, 2093Assert.True(syntax.SpanStart = varSymbol8.Locations.Item(0).SourceSpan.Start OrElse 2094syntax.SpanStart = varSymbol8.Locations.Item(1).SourceSpan.Start,
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
SemanticModelTestBase.vb (2)
90" Location1.SourceSpan.Start : " & tpSymbol.Locations.Item(0).SourceSpan.Start & 91" Location2.SourceSpan.Start : " & tpSymbol.Locations.Item(0).SourceSpan.Start
Microsoft.CodeAnalysis.Workspaces (142)
Differencing\LongestCommonImmutableArraySubsequence.cs (2)
20=> Equals(oldSequence[oldIndex], newSequence[newIndex]);
FindSymbols\FindReferences\Finders\MethodTypeParameterSymbolReferenceFinder.cs (2)
31return new([method.PartialDefinitionPart.TypeParameters[ordinal]]); 34return new([method.PartialImplementationPart.TypeParameters[ordinal]]);
FindSymbols\FindReferences\Finders\ParameterSymbolReferenceFinder.cs (8)
79symbols.Add(invokeMethod.Parameters[parameter.Ordinal]); 162if (!syntaxFacts.TextMatch(methodSymbol1.Parameters[i].Name, methodSymbol2.Parameters[i].Name)) 196results.Add(containingProperty.GetMethod.Parameters[ordinal]); 199results.Add(containingProperty.SetMethod.Parameters[ordinal]); 237results.Add(parameters.Value[ordinal]); 249results.Add(method.PartialDefinitionPart.Parameters[ordinal]); 252results.Add(method.PartialImplementationPart.Parameters[ordinal]);
FindSymbols\SymbolTree\SymbolTreeInfo.cs (12)
199var node = _nodes[index]; 226var node = _nodes[index]; 254while (startIndex > 0 && s_caseInsensitiveComparer.Equals(nodes[startIndex - 1].Name, name)) 258while (endIndex + 1 < nodes.Length && s_caseInsensitiveComparer.Equals(nodes[endIndex + 1].Name, name)) 279var comparison = s_caseInsensitiveComparer.Compare(nodes[mid].Name, name); 311tmp.Sort((a, b) => CompareNodes(unsortedNodes[a], unsortedNodes[b], unsortedNodes)); 330var n = unsortedNodes[i]; 401var node = _nodes[index]; 438_nodes[i].AssertEquivalentTo(other._nodes[i]); 486var node = nodes[derivedNameIndex];
LanguageServices\DeclaredSymbolFactoryService\ArityUtilities.cs (1)
20? s_aritySuffixesOneToNine[arity - 1]
LinkedFileDiffMerging\LinkedFileDiffMergingSession.cs (4)
153while (cumulativeChangeIndex < cumulativeChanges.Length && cumulativeChanges[cumulativeChangeIndex].Span.End < change.Span.Start) 156successfullyMergedChanges.Add(cumulativeChanges[cumulativeChangeIndex]); 162var cumulativeChange = cumulativeChanges[cumulativeChangeIndex]; 194successfullyMergedChanges.Add(cumulativeChanges[cumulativeChangeIndex]);
Log\AggregateLogger.cs (3)
121var logger = _loggers[i]; 135var logger = _loggers[i]; 149var logger = _loggers[i];
ReassignedVariable\AbstractReassignedVariableService.cs (4)
365var getParameter = property.GetMethod?.Parameters[parameter.Ordinal]; 366var setParameter = property.SetMethod?.Parameters[parameter.Ordinal]; 388var getParameter = property.GetMethod?.Parameters[parameter.Ordinal]; 389var setParameter = property.SetMethod?.Parameters[parameter.Ordinal];
Recommendations\AbstractRecommendationServiceRunner.cs (2)
229builder.Add(parameters[ordinalInLambda].Type); 263parameterType = method.Parameters[ordinalInInvocation].Type;
Rename\RenameUtilities.cs (1)
347return associatedPropertyOrEvent.Parameters[ordinal];
Shared\Extensions\IMethodSymbolExtensions.cs (2)
48if (!invoke.Parameters[i].Type.InheritsFromOrEquals(method.Parameters[i].Type))
Shared\Extensions\ISymbolExtensions.cs (3)
437var docId = typeArgs[index].GetDocumentationCommentId(); 529if (!left.Parameters[i].Type.Equals(right.Parameters[i].Type))
Shared\Extensions\SourceTextExtensions.cs (2)
324return _chunks[chunkIndex][chunkColumn]; 351var chunk = _chunks[chunkIndex];
Shared\Utilities\BloomFilter.cs (1)
354var hash = hashes[i];
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (20)
194builder.Add(map(items[i], i, arg)); 359builder[i] = await selector(array[i], cancellationToken).ConfigureAwait(false); 377builder[i] = await selector(array[i], arg, cancellationToken).ConfigureAwait(false); 438builder[i] = map(self[i], other[i]); 456builder.Add(map(self[i], other[i], i, arg)); 489var a = array[i]; 523builder.Add(array[j]); 551var a = array[i]; 567var a = array[i]; 583var a = array[i]; 599var a = array[i]; 615var a = array[i]; 1048if (predicate(items[i])) 1070sum += selector(items[i], i); 1215if (!predicate(array1[i], array2[i], arg)) 1233if (comparer.Compare(array[i - 1], array[i]) > 0)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
252hashCode = unchecked((hashCode ^ data[i]) * Hash.FnvPrime);
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (1)
82return _many[index];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
27return (number < numerals.Length) ? numerals[number] : number.ToString();
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (2)
345oldChange = oldChanges[oldIndex]; 360newChange = new UnadjustedNewChange(newChanges[newIndex]);
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
603Add(items[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (1)
316var (minValue, maxValue) = _numberRangePairs[i];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSeparatedSyntaxNodeList.cs (4)
45Debug.Assert(NodesAndTokens[i].IsNode); 46Debug.Assert(NodesAndTokens[i].Node is EmbeddedSyntaxNode<TSyntaxKind, TSyntaxNode>); 51Debug.Assert(!NodesAndTokens[i].IsNode); 67var nodeOrToken = NodesAndTokens[index * 2];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
38result.Add(array[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
382symbol = method.GetConstructedReducedFrom()!.Parameters[parameter.Ordinal + 1];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (8)
44if (!blocks[i].IsReachable) 46unreachableBlocksToVisit.Add(blocks[i]); 81var firstBlock = blocks[firstBlockOrdinal]; 97current = blocks[min]; 281var previousAnalysisData = analyzer.GetCurrentAnalysisData(blocks[@finally.FirstBlockOrdinal]); 327var currentAnalysisData = analyzer.GetCurrentAnalysisData(blocks[fromRegion.FirstBlockOrdinal]); 380var @catch = tryAndCatch.NestedRegions[i]; 389var entryBlock = blocks[@catch.FirstBlockOrdinal];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (2)
249foreach (var operation in cfg.Blocks[i].DescendantOperations()) 398var firstBasicBlockInOutermostRegion = ControlFlowGraph.Blocks[containingTryCatchFinallyRegion.FirstBlockOrdinal];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (2)
265=> index < values.Length ? values[index] : null; 285refKinds[i], parameters[i].RefKind, distinguishRefFromOut: false))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ParameterSymbolKey.cs (1)
98result.AddIfNotNull(parameters[ordinal]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (1)
402if (!signatureComparer.Equals(originalParameterTypes[i], parameters[i].Type))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TypeParameterOrdinalSymbolKey.cs (1)
26var typeParameter = method?.TypeParameters[ordinal];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKeyResolution.Enumeration.cs (2)
40if (_symbolKeyResolution.CandidateSymbols[_index] is TSymbol) 58return (TSymbol)_symbolKeyResolution.CandidateSymbols[_index];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (9)
342if (!SymbolsAreCompatibleCore(originalSymbolInfo.CandidateSymbols[i], newSymbolInfo.CandidateSymbols[i], performEquivalenceCheck, requireNonNullSymbols)) 791if (!SymbolsAreCompatible(originalLocalVariables[i].Type, newLocalVariables[i].Type)) 1117var argument = specifiedArguments[i]; 1147specifiedParameters1.Add(signature1Parameters[i]); 1148specifiedParameters2.Add(signature2Parameters[i]); 1162var parameter1 = signature1Parameters[i]; 1168var parameter2 = signature2Parameters[i];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\IAsyncEnumerableExtensions.cs (1)
63tasks[i] = ProcessAsync(streams[i], channel.Writer, cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SignatureComparer.cs (2)
212var typeParameter1 = method1.TypeParameters[i]; 213var typeParameter2 = method2.TypeParameters[i];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (2)
134return _equivalenceVisitors[visitorIndex]; 141return _getHashCodeVisitors[visitorIndex];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (10)
85if (!AreEquivalent(x[i], y[i], equivalentTypesWithDifferingAssemblies)) 433var xElement = xElements[i]; 434var yElement = yElements[i]; 450var xElement = xElements[i]; 451var yElement = yElements[i]; 477if (!symbolEquivalenceComparer.ParameterEquivalenceComparer.Equals(xParameters[i], yParameters[i], equivalentTypesWithDifferingAssemblies, compareParameterName, isParameterNameCaseSensitive)) 502if (!AreEquivalent(xTypeArguments[i], yTypeArguments[i], equivalentTypesWithDifferingAssemblies))
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IMethodSymbolExtensions.cs (4)
59mapping[method.TypeParameters[i]] = updatedTypeParameters[i]; 113var typeParameter = typeParameters[i]; 119newNames[i],
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\IParameterSymbolExtensions.cs (1)
17result.Add(parameters[i].RenameParameter(parameterNames[i]));
Workspace\Host\DocumentService\AbstractSpanMappingService.cs (4)
39var newText = textChanges[i].NewText; 40if (!mappedSpanResults[i].IsDefault && newText != null) 42var newTextChange = new TextChange(mappedSpanResults[i].Span, newText); 43mappedFilePathAndTextChange.Add((mappedSpanResults[i].FilePath, newTextChange));
Workspace\ProjectSystem\ProjectSystemProjectFactory.cs (1)
652var convertedReference = referenceInfo.ConvertedProjectReferences[i];
Workspace\Solution\ChecksumsAndIds.cs (2)
57=> (_checksumsAndIds.Checksums.Children[_index], _checksumsAndIds.Ids[_index]); 122_checksumsAndIds.Ids[_index]);
Workspace\Solution\ProjectState.cs (1)
1079finalVersion = finalVersion.GetNewerVersion(await newDocuments[i].GetTextVersionAsync(cancellationToken).ConfigureAwait(false));
Workspace\Solution\SolutionCompilationState.RootedSymbolSet.cs (3)
128while (index > 0 && secondarySymbols[index - 1].hashCode == symbolHash) 132while (index < secondarySymbols.Length && secondarySymbols[index].hashCode == symbolHash) 134var cached = secondarySymbols[index];
Workspace\Solution\SolutionCompilationState.TranslationAction_Actions.cs (4)
36var newState = _newStates[i]; 37var oldState = _oldStates[i]; 104generatorDriver = generatorDriver.ReplaceAdditionalText(_oldStates[i].AdditionalText, _newStates[i].AdditionalText);
Workspace\Solution\StateChecksums.cs (1)
181var id = FrozenSourceGeneratedDocuments.Value.Ids[i];
Microsoft.CodeAnalysis.Workspaces.MSBuild (2)
MSBuild\MSBuildProjectLoader.Worker_ResolveReferences.cs (2)
72var filePath = GetFilePath(metadataReferences[index]); 169var reference = _metadataReferences[index];
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (25)
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (20)
194builder.Add(map(items[i], i, arg)); 359builder[i] = await selector(array[i], cancellationToken).ConfigureAwait(false); 377builder[i] = await selector(array[i], arg, cancellationToken).ConfigureAwait(false); 438builder[i] = map(self[i], other[i]); 456builder.Add(map(self[i], other[i], i, arg)); 489var a = array[i]; 523builder.Add(array[j]); 551var a = array[i]; 567var a = array[i]; 583var a = array[i]; 599var a = array[i]; 615var a = array[i]; 1048if (predicate(items[i])) 1070sum += selector(items[i], i); 1215if (!predicate(array1[i], array2[i], arg)) 1233if (comparer.Compare(array[i - 1], array[i]) > 0)
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
252hashCode = unchecked((hashCode ^ data[i]) * Hash.FnvPrime);
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (1)
82return _many[index];
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
27return (number < numerals.Length) ? numerals[number] : number.ToString();
src\Dependencies\PooledObjects\ArrayBuilder.cs (1)
603Add(items[i]);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ImmutableArrayExtensions.cs (1)
38result.Add(array[i]);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
src\Workspaces\Core\MSBuild.BuildHost\Rpc\RpcServer.cs (1)
135arguments[i] = request.Parameters[i].ToObject(methodParameters[i].ParameterType);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (1)
Formatting\FormattingTestBase.cs (1)
110var span = inputSpans[i];
Microsoft.DotNet.SignTool (3)
src\ByteSequenceComparer.cs (2)
32if (x[i] != y[i])
src\Hash.cs (1)
213hashCode = unchecked((hashCode ^ data[i]) * Hash.FnvPrime);
Microsoft.Extensions.Options.SourceGeneration (7)
Parser.cs (7)
502bool lastParameterDeclaredWithParamsKeyword = parameters.Length > 0 && parameters[parameters.Length - 1].IsParams; 508TypedConstant argument = arguments[i]; 524bool isParams = lastParameterDeclaredWithParamsKeyword && namedArgument.Key == parameters[parameters.Length - 1].Name; 654if (constructorParameters[i].Name == "type") 656argumentValue = attribute.ConstructorArguments[i].Value; 788sb.Append(GetArgumentExpression(value[i].Type!, value[i].Value));
Microsoft.Gen.Logging (1)
Parsing\Parser.TagProvider.cs (1)
142if (!method.Parameters[i].IsOptional)
Microsoft.Interop.ComInterfaceGenerator (11)
Analyzers\RuntimeComApiUsageWithSourceGeneratedComAnalyzer.cs (1)
208var type = invocation.TargetMethod.TypeArguments[ordinal];
ComClassGenerator.cs (1)
121string ifaceName = implementedInterfaces[i];
ComInterfaceGenerator.cs (9)
294if (returnSwappedSignatureElements[i].IsManagedReturnPosition) 296if (returnSwappedSignatureElements[i].ManagedType == SpecialTypeInfo.Void) 304if ((returnSwappedSignatureElements[i].ManagedType is SpecialTypeInfo { SpecialType: SpecialType.System_Int32 or SpecialType.System_Enum } or EnumTypeInfo 305&& returnSwappedSignatureElements[i].MarshallingAttributeInfo.Equals(NoMarshallingInfo.Instance)) 306|| (IsHResultLikeType(returnSwappedSignatureElements[i].ManagedType))) 312var managedSignatureAsNativeOut = returnSwappedSignatureElements[i] with 438while (methodIndex < methods.Length && methods[methodIndex].OwningInterface == iface) 440var method = methods[methodIndex]; 462methodList.Add(methods[methodIndex++]);
Microsoft.Interop.LibraryImportGenerator (6)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (2)
956ITypeSymbol expectedUnmanagedCollectionElementType = typeArguments[typeArguments.Length - 1]; 1244ITypeSymbol expectedUnmanagedCollectionElementType = typeArguments[typeArguments.Length - 1];
Analyzers\CustomMarshallerAttributeFixer.cs (4)
311returnType: gen.TypeExpression(spanOfT.Construct(typeParameters[typeParameters.Length - 1])), 327returnType: gen.TypeExpression(readOnlySpanOfT.Construct(typeParameters[typeParameters.Length - 1])), 481returnType: gen.TypeExpression(spanOfT.Construct(typeParameters[typeParameters.Length - 1])), 495returnType: gen.TypeExpression(readOnlySpanOfT.Construct(typeParameters[typeParameters.Length - 1])),
Microsoft.Interop.SourceGeneration (13)
IncrementalValuesProviderExtensions.cs (2)
26builder.Add((data.Left[i], data.Right[i]));
MarshallerShape.cs (2)
241if (currentType.TypeParameters[i].HasUnmanagedTypeConstraint 242&& SymbolEqualityComparer.Default.Equals(currentType.TypeArguments[i], typeArgument))
MethodSignatureDiagnosticLocations.cs (1)
65{ ManagedIndex: >= 0 and int index, InstanceIdentifier: string identifier } => (ManagedParameterLocations[index], identifier),
MethodSignatureElementInfoProvider.cs (3)
27public string FindNameForParamIndex(int paramIndex) => paramIndex >= _method.Parameters.Length ? string.Empty : _method.Parameters[paramIndex].Name; 44IParameterSymbol param = _method.Parameters[i]; 67IParameterSymbol param = _method.Parameters[paramIndex];
SequenceEqualImmutableArray.cs (1)
30public T this[int i] { get => Array[i]; }
SignatureContext.cs (1)
111IParameterSymbol param = method.Parameters[i];
SyntaxExtensions.cs (2)
55nestedStatement = fixedStatements[i].AddStatementWithoutEmptyStatements(WrapStatementInBlock(nestedStatement)); 59nestedStatement = fixedStatements[i].AddStatementWithoutEmptyStatements(nestedStatement);
TypePositionInfo.cs (1)
113return methodSymbol.Parameters[info.ManagedIndex].Locations[0];
Microsoft.ML.Data (34)
DataLoadSave\Binary\Codecs.cs (1)
812writer.Write(_type.Dimensions[i]);
Prediction\Calibrator.cs (21)
1984_host.Assert(values.Length == 0 || (0 <= values[0] && values[values.Length - 1] <= 1)); 2071_host.Assert(Mins[i] <= Maxes[i]); 2072_host.Assert(Mins[i] > maxPrev); 2073_host.Assert(Values[i] > valuePrev || Values[i] == valuePrev && i == 0); 2074valuePrev = Values[i]; 2075maxPrev = Maxes[i]; 2076ctx.Writer.Write(Mins[i]); 2077ctx.Writer.Write(Maxes[i]); 2078ctx.Writer.Write(Values[i]); 2107if (score > Maxes[p - 1]) 2109return Values[p - 1]; 2117if (score >= Mins[pos]) 2118return Values[pos]; 2120float t = (score - Maxes[pos - 1]) / (Mins[pos] - Maxes[pos - 1]); 2121return Values[pos - 1] + t * (Values[pos] - Values[pos - 1]);
Transforms\Normalizer.cs (12)
495public IColumnFunction this[int index] => _infos[index].ColumnFunction; 521return Columns[index].ModelParameters; 695ColumnOptions.SaveType(ctx, Columns[iinfo].InputType); 697ctx.SaveSubModel(dir, Columns[iinfo].ColumnFunction.Save); 737result[i] = new DataViewSchema.DetachedColumn(_parent.Columns[i].Name, _parent.Columns[i].InputType, MakeMetadata(i)); 743var colInfo = _parent.Columns[iinfo]; 759return _parent.Columns[iinfo].ColumnFunction.GetGetter(input, ColMapNewToOld[iinfo]); 768var info = _parent.Columns[iinfo]; 793var info = _parent.Columns[iinfo]; 817Contracts.Assert(_parent.Columns[iinfo] == info); 827Contracts.Assert(_parent.Columns[iinfo] == info);
Microsoft.ML.DataView (4)
VectorType.cs (4)
98size = checked(size * dims[i]); 135if (Dimensions[i] != tmp.Dimensions[i]) 151hash = Hashing.CombineHash(hash, Dimensions[i].GetHashCode());
Microsoft.ML.InternalCodeAnalyzer (2)
ContractsCheckAnalyzer.cs (2)
120if (parameters[p].Name == nameColonText) 223var parameter = parameters[i];
Microsoft.ML.OnnxConverter (1)
OnnxUtils.cs (1)
375dimsLocal.Add(vec.Dimensions[i]);
Microsoft.ML.Samples (2)
Dynamic\WithOnFitDelegate.cs (2)
68var upperBounds = string.Join(", ", binningParam.UpperBounds[i]); 70$"Bin {i}: Density = {binningParam.Density[i]}, " +
Microsoft.ML.Tests (9)
Scenarios\Api\CookbookSamples\CookbookSamplesDynamicApi.cs (3)
126var upperBounds = string.Join(", ", binningParam.UpperBounds[i]); 128$"Bin {i}: Density = {binningParam.Density[i]}, " + 363Console.WriteLine($"Feature {i}: Difference in RMS - {featureImportance[i].RootMeanSquaredError.Mean}");
TrainerEstimators\CalibratorEstimators.cs (3)
137var probability = calibratedData.RowView[i].Values[6]; 276Assert.True((float)oldCalibratedData.RowView[i].Values[5].Value == (float)newCalibratedData.RowView[i].Values[5].Value);
Transformers\NormalizerTests.cs (3)
966Assert.NotEqual(0f, transformParams.Mean[i]); 967Assert.NotEqual(0f, transformParams.StandardDeviation[i]); 971Assert.NotEqual(0f, noCdfParams.Scale[i]);
Microsoft.ML.Transforms (41)
PermutationFeatureImportanceExtensions.cs (1)
718output.Add(name, permutationFeatureImportance[i]);
Text\NgramHashingTransformer.cs (26)
204if (_columns[i].MaximumNumberOfInverts == -1) 207invertHashMaxCount = _columns[i].MaximumNumberOfInverts; 212for (int j = 0; j < _columns[i].InputColumnNamesArray.Length; j++) 214if (!input.Schema.TryGetColumnIndex(_columns[i].InputColumnNamesArray[j], out int srcCol)) 215throw Host.ExceptSchemaMismatch(nameof(input), "input", _columns[i].InputColumnNamesArray[j]); 218throw Host.ExceptSchemaMismatch(nameof(input), "input", _columns[i].InputColumnNamesArray[j], NgramHashingEstimator.ExpectedColumnType, columnType.ToString()); 392_srcIndices[i] = new int[_parent._columns[i].InputColumnNamesArray.Length]; 393_srcTypes[i] = new DataViewType[_parent._columns[i].InputColumnNamesArray.Length]; 394for (int j = 0; j < _parent._columns[i].InputColumnNamesArray.Length; j++) 396var srcName = _parent._columns[i].InputColumnNamesArray[j]; 407_types[i] = new VectorDataViewType(NumberDataViewType.Single, 1 << _parent._columns[i].NumberOfBits); 413uint mask = (1U << _parent._columns[iinfo].NumberOfBits) - 1; 414int ngramLength = _parent._columns[iinfo].NgramLength; 415bool rehash = _parent._columns[iinfo].RehashUnigrams; 416bool ordered = _parent._columns[iinfo].UseOrderedHashing; 417bool all = _parent._columns[iinfo].UseAllLengths; 418uint seed = _parent._columns[iinfo].Seed; 569var bldr = new NgramBufferBuilder(_parent._columns[iinfo].NgramLength, _parent._columns[iinfo].SkipLength, 612result[i] = new DataViewSchema.DetachedColumn(_parent._columns[i].Name, _types[i], builder.ToAnnotations()); 670_srcIndices[i] = new int[_parent._columns[i].InputColumnNamesArray.Length]; 671for (int j = 0; j < _parent._columns[i].InputColumnNamesArray.Length; j++) 673var srcName = _parent._columns[i].InputColumnNamesArray[j]; 793srcNames[i] = _parent._columns[iinfo].InputColumnNamesArray[i]; 8181 << _parent._columns[iinfo].NumberOfBits, _invertHashMaxCounts[iinfo], 851Contracts.Assert(vec.Length == 1 << _parent._columns[iinfo].NumberOfBits);
Text\NgramTransform.cs (14)
257GetNgramIdFinderAdd(env, counts[iinfo], columns[iinfo].MaximumNgramsCounts, ngramMaps[iinfo], transformInfos[iinfo].RequireIdf)); 281if (transformInfos[iinfo].RequireIdf) 285if (transformInfos[iinfo].RequireIdf) 313int ngramLength = transformInfos[iinfo].NgramLength; 315transformInfos[iinfo].NonEmptyLevels[i] = counts[iinfo][i] > 0; 467_transformInfos[i].Save(ctx); 543uint[] ngram = new uint[_parent._transformInfos[iinfo].NgramLength]; 559var transformInfo = _parent._transformInfos[iinfo]; 662Host.Assert(lim <= Utils.Size(_parent._transformInfos[iinfo].NonEmptyLevels)); 664if (!_parent._transformInfos[iinfo].NonEmptyLevels[lim - 1]) 678var bldr = new NgramBufferBuilder(_parent._transformInfos[iinfo].NgramLength, _parent._transformInfos[iinfo].SkipLength, 685switch (_parent._transformInfos[iinfo].Weighting) 776var transformInfo = _parent._transformInfos[iinfo];
Microsoft.ML.Vision (1)
DnnRetrainTransform.cs (1)
249colTypeDims[indexLocal + 1] = vecType.Dimensions[indexLocal];
Microsoft.VisualStudio.LanguageServices (11)
CodeDefinitionWindow\VisualStudioCodeDefinitionWindowService.cs (1)
108return _locations[index];
DocumentOutline\DocumentOutlineViewModel_Utilities.cs (2)
119var currentParent = allSymbols[start]; 129var nextSymbol = allSymbols[newStart];
EditorConfigSettings\Common\SettingsEntriesSnapshotBase.cs (1)
36result = _data[index];
EditorConfigSettings\NamingStyle\ViewModel\ColumnViewModels\NamingStylesSeverityViewModel.cs (1)
29SelectedSeverityValue = Severities[selectedSeverityIndex];
FindReferences\TableEntriesSnapshot.cs (3)
40content = _entries[index]; 44return _entries[index].TryGetValue(keyName, out content); 50return _entries[index].TryCreateColumnContent(columnName, out content);
Library\VsNavInfo\NavInfo.cs (2)
103if (isCanonical && baseNodes[i].ListType == _LIB_LISTTYPE.LLT_HIERARCHY) 108builder.Add(baseNodes[i]);
Library\VsNavInfo\NavInfoNodeEnum.cs (1)
31rgelt[i] = _nodes[_index];
Microsoft.VisualStudio.LanguageServices.CSharp (1)
ObjectBrowser\DescriptionBuilder.cs (1)
429var current = parameters[i];
Roslyn.Test.PdbUtilities (4)
Reader\PdbValidation.cs (4)
571var codeViewEntry = entries[entryIndex++]; 609var entry = entries[entryIndex++]; 619var entry = entries[entryIndex++]; 631var entry = entries[entryIndex++];
Roslyn.VisualStudio.Next.UnitTests (4)
Remote\SerializationValidator.cs (1)
67public T this[int index] => Children[index];
Services\ServiceHubServicesTests.cs (3)
447sourceTexts = values[i]; 481var localDoc = localGeneratedDocs[i]; 482var remoteDoc = remoteGeneratedDocs[i];
SemanticSearch.BuildTask (3)
GenerateFilteredReferenceAssembliesTask.cs (2)
349=> (symbolIndex < symbols.Length && symbols[symbolIndex].MetadataToken == MetadataTokens.GetToken(handle)) ? symbols[symbolIndex++] : null;
src\Compilers\Core\Portable\InternalUtilities\Hash.cs (1)
252hashCode = unchecked((hashCode ^ data[i]) * Hash.FnvPrime);
System.Collections.Immutable (17)
System\Collections\Frozen\FrozenSet.cs (1)
319actualValue = Items[index];
System\Collections\Immutable\ImmutableArray.cs (2)
291array[i] = selector(items[i]); 325array[i] = selector(items[i + start]);
System\Collections\Immutable\ImmutableArray_1.cs (3)
30return self[index]; 91return self[index]; 1361return self[index];
System\Linq\ImmutableArrayExtensions.cs (11)
203if (!comparer.Equals(immutableArray[i], item)) 237if (!predicate(immutableArray[i], items[i])) 262result = func(result, immutableArray[i]); 309return immutableArray[index]; 323return immutableArray[index]; 400? immutableArray[immutableArray.Length - 1] 414if (predicate(immutableArray[i])) 416return immutableArray[i]; 445if (predicate(immutableArray[i])) 447return immutableArray[i];
System.Formats.Nrbf (1)
System\Formats\Nrbf\SerializationRecord.cs (1)
138if (!Matches(genericTypes[i], genericNames[i]))
System.Reflection.Metadata (36)
System\Reflection\Metadata\Ecma335\MetadataAggregator.cs (7)
271Debug.Assert(sizes[generation] == size); 278while (generation < sizes.Length && sizes[generation] == size); 291int relativeHeapOffset = (handle.Type == HandleType.Guid || generation == 0) ? heapOffset : heapOffset - sizes[generation - 1]; 304Debug.Assert(sizes[generation].AggregateInserts == rowId); 308while (generation > 0 && sizes[generation - 1].AggregateInserts == rowId) 327sizes[generation - 1].AggregateInserts + 328sizes[generation].Updates;
System\Reflection\Metadata\Ecma335\MetadataBuilder.Heaps.cs (1)
176internal static int SerializeHandle(ImmutableArray<int> map, StringHandle handle) => map[handle.GetWriterVirtualIndex()];
System\Reflection\Metadata\Ecma335\MetadataSizes.cs (2)
411return BitArithmetic.Align(HeapSizes[i], StreamAlignment); 454if (rowCounts[i] > 0)
System\Reflection\Metadata\Ecma335\PortablePdbBuilder.cs (2)
83if (typeSystemRowCounts[i] == 0) 88if ((unchecked((uint)typeSystemRowCounts[i]) & ~TokenTypeIds.RIDMask) != 0)
System\Reflection\Metadata\Internal\MetadataWriterUtilities.cs (1)
96int rowCount = rowCounts[i];
System\Reflection\PortableExecutable\PEBuilder.cs (6)
242builder.WriteUInt32((uint)(codeSectionIndex != -1 ? sections[codeSectionIndex].RelativeVirtualAddress : 0)); 248builder.WriteUInt32((uint)(dataSectionIndex != -1 ? sections[dataSectionIndex].RelativeVirtualAddress : 0)); 271var lastSection = sections[sections.Length - 1]; 396if ((sections[i].Characteristics & characteristics) == characteristics) 410if ((sections[i].Characteristics & characteristics) == characteristics) 412result += sections[i].SizeOfRawData;
System\Reflection\PortableExecutable\PEHeaders.cs (11)
331int relativeOffset = directory.RelativeVirtualAddress - _sectionHeaders[sectionIndex].VirtualAddress; 332if (!canCrossSectionBoundary && directory.Size > _sectionHeaders[sectionIndex].VirtualSize - relativeOffset) 337offset = _isLoadedImage ? directory.RelativeVirtualAddress : _sectionHeaders[sectionIndex].PointerToRawData + relativeOffset; 353if (_sectionHeaders[i].VirtualAddress <= relativeVirtualAddress && 354relativeVirtualAddress < _sectionHeaders[i].VirtualAddress + _sectionHeaders[i].VirtualSize) 367if (SectionHeaders[i].Name.Equals(name, StringComparison.Ordinal)) 390start = SectionHeaders[cormeta].VirtualAddress; 391size = SectionHeaders[cormeta].VirtualSize; 395start = SectionHeaders[cormeta].PointerToRawData; 396size = SectionHeaders[cormeta].SizeOfRawData;
System\Reflection\PortableExecutable\PEReader.cs (6)
402PEHeaders.SectionHeaders[index].VirtualAddress, 403PEHeaders.SectionHeaders[index].VirtualSize); 417PEHeaders.SectionHeaders[index].VirtualSize, 418PEHeaders.SectionHeaders[index].SizeOfRawData); 420newBlock = peImage.GetMemoryBlock(PEHeaders.SectionHeaders[index].PointerToRawData, size); 497int relativeOffset = relativeVirtualAddress - PEHeaders.SectionHeaders[sectionIndex].VirtualAddress;
System.Reflection.MetadataLoadContext (18)
System\Reflection\TypeLoading\Events\Ecma\EcmaEvent.cs (2)
71MethodDefinition def = others[i].GetMethodDefinition(reader); 74MethodInfo methodInfo = others[i].ToMethod(GetRoDeclaringType(), GetRoDeclaringType());
System\Reflection\TypeLoading\General\Ecma\EcmaSignatureTypeProviderForToString.cs (2)
48sb.Append(typeArguments[i]); 69sb.Append(signature.ParameterTypes[i]);
System\Reflection\TypeLoading\General\Ecma\EcmaWrappedTypeProvider.cs (1)
47filteredTypeArguments = filteredTypeArguments.Add(typeArguments[i].SkipTypeWrappers());
System\Reflection\TypeLoading\MethodBase\Ecma\EcmaMethodBody.cs (8)
45RoType localType = sig[i]; 67EntityHandle catchTypeHandle = regions[i].CatchType; 71flags: regions[i].Kind.ToExceptionHandlingClauseOptions(), 72filterOffset: regions[i].FilterOffset, 73tryOffset: regions[i].TryOffset, 74tryLength: regions[i].TryLength, 75handlerOffset: regions[i].HandlerOffset, 76handlerLength: regions[i].HandlerLength
System\Reflection\TypeLoading\MethodBase\Ecma\EcmaMethodDecoder.cs (3)
82Type parameterType = position == -1 ? sig.ReturnType : sig.ParameterTypes[position]; 88Type parameterType = position == -1 ? sig.ReturnType : sig.ParameterTypes[position]; 104results[position] = sig.ParameterTypes[position];
System\Reflection\TypeLoading\Properties\Ecma\EcmaProperty.cs (1)
91sb.Append(sig.ParameterTypes[i]);
System\Reflection\TypeLoading\Types\RoFunctionPointerType.cs (1)
41_parameterTypes[i] = sigParameterTypes[i];
System.Text.Json.SourceGeneration (1)
JsonSourceGenerator.Parser.cs (1)
1468IParameterSymbol parameterInfo = constructor.Parameters[i];
System.Text.RegularExpressions.Generator (5)
RegexGenerator.cs (4)
372bool areEqual = left[i] is { } leftElem 373? leftElem.Equals(right[i]) 374: right[i] is null; 389hash = (hash, obj[i]).GetHashCode();
UpgradeToGeneratedRegexAnalyzer.cs (1)
164IArgumentOperation argument = arguments[i];