115 references to Indexer
Microsoft.CodeAnalysis.CodeStyle (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamespaceOrTypeSymbolExtensions.cs (1)
29: symbol.GetMembers(WellKnownMemberNames.Indexer).OfType<IPropertySymbol>().Where(p => p.IsIndexer);
Microsoft.CodeAnalysis.CSharp (13)
Binder\Binder_Crefs.cs (2)
197ImmutableArray<Symbol> sortedSymbols = ComputeSortedCrefMembers(syntax, containerOpt, WellKnownMemberNames.Indexer, memberNameText: WellKnownMemberNames.Indexer, arity, syntax.Parameters != null, diagnostics);
Binder\Binder_Expressions.cs (2)
9588this.LookupMembersWithFallback(lookupResult, expr.Type, WellKnownMemberNames.Indexer, arity: 0, useSiteInfo: ref useSiteInfo, options: lookupOptions); 10019WellKnownMemberNames.Indexer,
Binder\BinderFactory.BinderFactoryVisitor.cs (1)
496return ExplicitInterfaceHelpers.GetMemberName(outerBinder, explicitInterfaceSpecifierSyntax, WellKnownMemberNames.Indexer);
Compilation\CSharpSemanticModel.cs (2)
4094AppendSymbolsWithNameAndArity(symbols, WellKnownMemberNames.Indexer, 0, binder, type, LookupOptions.MustBeInstance); 4114Debug.Assert(symbol.IsIndexer(), "Only indexers can have name " + WellKnownMemberNames.Indexer);
Compilation\SyntaxTreeSemanticModel.cs (1)
1641return GetDeclarationName(declaration, indexerDecl.ExplicitInterfaceSpecifier, WellKnownMemberNames.Indexer);
Declarations\DeclarationTreeBuilder.cs (1)
1195set.Add(WellKnownMemberNames.Indexer);
Symbols\Metadata\PE\PEPropertySymbol.cs (1)
420get { return this.IsIndexer ? WellKnownMemberNames.Indexer : _name; }
Symbols\NamedTypeSymbol.cs (1)
308ImmutableArray<Symbol> candidates = GetSimpleNonTypeMembers(WellKnownMemberNames.Indexer);
Symbols\Source\SourcePropertySymbolBase.cs (2)
174_name = ExplicitInterfaceHelpers.GetMemberName(WellKnownMemberNames.Indexer, _explicitInterfaceType, aliasQualifierOpt); 241string interfacePropertyName = IsIndexer ? WellKnownMemberNames.Indexer : ((PropertyDeclarationSyntax)syntax).Identifier.ValueText;
Microsoft.CodeAnalysis.CSharp.CodeStyle (1)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (1)
128=> type.GetMembers(WellKnownMemberNames.Indexer)
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
SymbolKey\SymbolKeyCompilationsTests.cs (2)
547var originalSymbols = typeSym1.GetMembers(WellKnownMemberNames.Indexer); 550var newSymbols = typeSym2.GetMembers(WellKnownMemberNames.Indexer);
SymbolKey\SymbolKeyMetadataVsSourceTests.cs (1)
86var member05 = (typesym.GetMembers(WellKnownMemberNames.Indexer).Single() as IPropertySymbol).Type;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
BreakingChanges.cs (1)
166Assert.Equal(Microsoft.CodeAnalysis.WellKnownMemberNames.Indexer, indexer.Name);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (47)
Attributes\AttributeTests.cs (2)
5425var idxsym = typesym.GetMember(WellKnownMemberNames.Indexer) as PropertySymbol; 8643var indexer = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>("IA").GetMember<PropertySymbol>(WellKnownMemberNames.Indexer);
RefStructInterfacesTests.cs (22)
402PropertySymbol propertySymbol = m.GlobalNamespace.GetMember<PropertySymbol>("I." + WellKnownMemberNames.Indexer); 434PropertySymbol propertySymbol = m.GlobalNamespace.GetMember<PropertySymbol>("I." + WellKnownMemberNames.Indexer); 468PropertySymbol propertySymbol = comp.GetMember<PropertySymbol>("I." + WellKnownMemberNames.Indexer); 493PropertySymbol propertySymbol = comp.GetMember<PropertySymbol>("I." + WellKnownMemberNames.Indexer); 520PropertySymbol propertySymbol = m.GlobalNamespace.GetMember<PropertySymbol>("I." + WellKnownMemberNames.Indexer); 558PropertySymbol propertySymbol = m.GlobalNamespace.GetMember<PropertySymbol>("I." + WellKnownMemberNames.Indexer); 598PropertySymbol propertySymbol = comp.GetMember<PropertySymbol>("I." + WellKnownMemberNames.Indexer); 626PropertySymbol propertySymbol = comp.GetMember<PropertySymbol>("I." + WellKnownMemberNames.Indexer); 1635var p = comp1.GetMember<PropertySymbol>("I." + WellKnownMemberNames.Indexer); 1695PropertySymbol propertySymbol = comp2.GetMember<PropertySymbol>("C." + WellKnownMemberNames.Indexer); 1751PropertySymbol propertySymbol = comp3.GetMember<PropertySymbol>("C.I." + WellKnownMemberNames.Indexer); 1797PropertySymbol c1P = m.GlobalNamespace.GetMember<PropertySymbol>("C1." + WellKnownMemberNames.Indexer); 1800PropertySymbol c2P = m.GlobalNamespace.GetMember<PropertySymbol>("C2.I." + (m is PEModuleSymbol ? "Item" : WellKnownMemberNames.Indexer)); 1803PropertySymbol c3P = m.GlobalNamespace.GetMember<PropertySymbol>("C3." + WellKnownMemberNames.Indexer); 1863PropertySymbol propertySymbol = comp5.GetMember<PropertySymbol>("C.I." + WellKnownMemberNames.Indexer); 1885PropertySymbol propertySymbol = m.GlobalNamespace.GetMember<PropertySymbol>("C.I." + (m is PEModuleSymbol ? "Item" : WellKnownMemberNames.Indexer)); 1922PropertySymbol propertySymbol = m.GlobalNamespace.GetMember<PropertySymbol>("C." + WellKnownMemberNames.Indexer); 1975PropertySymbol propertySymbol = m.GlobalNamespace.GetMember<PropertySymbol>("C.I." + (m is PEModuleSymbol ? "Item" : WellKnownMemberNames.Indexer)); 2032PropertySymbol propertySymbol = m.GlobalNamespace.GetMember<PropertySymbol>("C." + WellKnownMemberNames.Indexer); 2052PropertySymbol propertySymbol = m.GlobalNamespace.GetMember<PropertySymbol>("C.I." + (m is PEModuleSymbol ? "Item" : WellKnownMemberNames.Indexer)); 2151PropertySymbol propertySymbol = comp7.GetMember<PropertySymbol>("C." + WellKnownMemberNames.Indexer); 2185PropertySymbol propertySymbol = comp8.GetMember<PropertySymbol>("C.I." + WellKnownMemberNames.Indexer);
Semantics\ParamsCollectionTests.cs (23)
9129VerifyParameterRefSafetyScope(template, memberName: "Test." + WellKnownMemberNames.Indexer); 9152VerifyParameterRefSafetyScope(template, memberName: "Test." + WellKnownMemberNames.Indexer); 9177VerifyParameterRefSafetyScope(template, memberName: "Test." + WellKnownMemberNames.Indexer); 10929var test1 = comp.GetMember<PropertySymbol>("Params1." + WellKnownMemberNames.Indexer).Parameters.Last(); 10930var test2 = comp.GetMember<PropertySymbol>("Params2." + WellKnownMemberNames.Indexer).Parameters.Last(); 11077var test1 = comp.GetMember<PropertySymbol>("Params1." + WellKnownMemberNames.Indexer).Parameters.Last(); 11078var test2 = comp.GetMember<PropertySymbol>("Params2." + WellKnownMemberNames.Indexer).Parameters.Last(); 11225var test1 = comp.GetMember<PropertySymbol>("Params1." + WellKnownMemberNames.Indexer).Parameters.Last(); 11226var test2 = comp.GetMember<PropertySymbol>("Params2." + WellKnownMemberNames.Indexer).Parameters.Last(); 11367var test1 = comp.GetMember<PropertySymbol>("Params1." + WellKnownMemberNames.Indexer).Parameters.Last(); 11368var test2 = comp.GetMember<PropertySymbol>("Params2." + WellKnownMemberNames.Indexer).Parameters.Last(); 11515var test1 = comp.GetMember<PropertySymbol>("Params1." + WellKnownMemberNames.Indexer).Parameters.Last(); 11516var test2 = comp.GetMember<PropertySymbol>("Params2." + WellKnownMemberNames.Indexer).Parameters.Last(); 11662var test1 = comp.GetMember<PropertySymbol>("Params1." + WellKnownMemberNames.Indexer).Parameters.Last(); 11663var test2 = comp.GetMember<PropertySymbol>("Params2." + WellKnownMemberNames.Indexer).Parameters.Last(); 11809var test1 = comp.GetMember<PropertySymbol>("Params1." + WellKnownMemberNames.Indexer).Parameters.Last(); 11810var test2 = comp.GetMember<PropertySymbol>("Params2." + WellKnownMemberNames.Indexer).Parameters.Last(); 11950var test1 = comp.GetMember<PropertySymbol>("Params1." + WellKnownMemberNames.Indexer).Parameters.Last(); 11951var test2 = comp.GetMember<PropertySymbol>("Params2." + WellKnownMemberNames.Indexer).Parameters.Last(); 12189var test1 = comp.GetMember<PropertySymbol>("Params1." + WellKnownMemberNames.Indexer).Parameters.Last(); 12190var test2 = comp.GetMember<PropertySymbol>("Params2." + WellKnownMemberNames.Indexer).Parameters.Last(); 12322var test1 = comp.GetMember<PropertySymbol>("Params1." + WellKnownMemberNames.Indexer).Parameters.Last(); 12439var test1 = comp.GetMember<PropertySymbol>("Params1." + WellKnownMemberNames.Indexer).Parameters.Last();
Microsoft.CodeAnalysis.CSharp.Features (4)
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (1)
194var indexers = semanticModel.LookupSymbols(position, expressionType, WellKnownMemberNames.Indexer).OfType<IPropertySymbol>();
SignatureHelp\ElementAccessExpressionSignatureHelpProvider.cs (2)
219indexers = semanticModel.LookupSymbols(position, expressionType, WellKnownMemberNames.Indexer) 268if (indexer.Name != WellKnownMemberNames.Indexer)
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\Helpers.cs (1)
128=> type.GetMembers(WellKnownMemberNames.Indexer)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (4)
Semantics\ArglistTests.cs (4)
1254var indexer = comp.GlobalNamespace.GetMember<NamedTypeSymbol>("A").GetMember<PropertySymbol>(WellKnownMemberNames.Indexer); 1280var indexer = comp.GlobalNamespace.GetMember<NamedTypeSymbol>("A").GetMember<PropertySymbol>(WellKnownMemberNames.Indexer); 1306var indexer = comp.GlobalNamespace.GetMember<NamedTypeSymbol>("A").GetMember<PropertySymbol>(WellKnownMemberNames.Indexer); 1332var indexer = comp.GlobalNamespace.GetMember<NamedTypeSymbol>("A").GetMember<PropertySymbol>(WellKnownMemberNames.Indexer);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (39)
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (3)
341Assert.Equal(WellKnownMemberNames.Indexer, propertySymbol.Name); 479Assert.Equal(WellKnownMemberNames.Indexer, symbol.Name); 548Assert.Equal(WellKnownMemberNames.Indexer, symbol.Name);
Symbols\IndexerTests.cs (24)
326Assert.Equal(WellKnownMemberNames.Indexer, classIndexer.Name); 327Assert.Equal(WellKnownMemberNames.Indexer, interface1Indexer.Name); 328Assert.Equal(WellKnownMemberNames.Indexer, interface2Indexer.Name); 408Assert.Equal(WellKnownMemberNames.Indexer, classIndexer.Name); 409Assert.Equal(WellKnownMemberNames.Indexer, interface1Indexer.Name); 410Assert.Equal(WellKnownMemberNames.Indexer, interface2Indexer.Name); 618Assert.Equal(WellKnownMemberNames.Indexer, derivedIndexer.Name); 619Assert.Equal(WellKnownMemberNames.Indexer, baseIndexer.Name); 675Assert.Equal(WellKnownMemberNames.Indexer, derivedIndexer.Name); 676Assert.Equal(WellKnownMemberNames.Indexer, baseIndexer.Name); 743Assert.Equal(WellKnownMemberNames.Indexer, derivedIndexer.Name); 744Assert.Equal(WellKnownMemberNames.Indexer, baseIndexers[0].Name); 745Assert.Equal(WellKnownMemberNames.Indexer, baseIndexers[1].Name); 814Assert.Equal(WellKnownMemberNames.Indexer, derivedIndexer.Name); 815Assert.Equal(WellKnownMemberNames.Indexer, baseIndexers[0].Name); 816Assert.Equal(WellKnownMemberNames.Indexer, baseIndexers[1].Name); 1436Assert.Equal(WellKnownMemberNames.Indexer, indexer.Name); 2404var indexer = type01.GetMembers(WellKnownMemberNames.Indexer).Single() as PropertySymbol; 2837var idxSymbol = typeSymbol.GetMember<PropertySymbol>(WellKnownMemberNames.Indexer); 2847Assert.Equal(WellKnownMemberNames.Indexer, idxSymbol2.Symbol.Name); 2864var unsubstitutedIndexer = unsubstitutedType.GetMember<SourcePropertySymbol>(WellKnownMemberNames.Indexer); 2866Assert.Equal(WellKnownMemberNames.Indexer, unsubstitutedIndexer.Name); 2870var substitutedIndexer = substitutedType.GetMember<SubstitutedPropertySymbol>(WellKnownMemberNames.Indexer); 2872Assert.Equal(WellKnownMemberNames.Indexer, substitutedIndexer.Name);
Symbols\OverriddenOrHiddenMembersTests.cs (4)
2618var indexerA = global.GetMember<NamedTypeSymbol>("A").GetMember<PropertySymbol>(WellKnownMemberNames.Indexer); 2619var indexerB = global.GetMember<NamedTypeSymbol>("B").GetMember<PropertySymbol>(WellKnownMemberNames.Indexer); 2620var indexerC = global.GetMember<NamedTypeSymbol>("C").GetMember<PropertySymbol>(WellKnownMemberNames.Indexer); 2621var indexerD = global.GetMember<NamedTypeSymbol>("D").GetMember<PropertySymbol>(WellKnownMemberNames.Indexer);
Symbols\Source\CustomModifierCopyTests.cs (6)
1775var baseIndexer = baseType.GetMember<PropertySymbol>(WellKnownMemberNames.Indexer); 1779var derivedIndexer = derivedType.GetMember<PropertySymbol>(WellKnownMemberNames.Indexer); 1892var baseIndexer = baseType.GetMember<PropertySymbol>(WellKnownMemberNames.Indexer); 1896var derivedIndexer = derivedType.GetMember<PropertySymbol>(WellKnownMemberNames.Indexer); 1989var interfaceIndexer = interfaceType.GetMember<PropertySymbol>(WellKnownMemberNames.Indexer); 2091var interfaceIndexer = interfaceType.GetMember<PropertySymbol>(WellKnownMemberNames.Indexer);
Symbols\SymbolErrorTests.cs (1)
4925var indexer = compilation.GlobalNamespace.GetMember<NamedTypeSymbol>("A").GetProperty("IA." + WellKnownMemberNames.Indexer);
Symbols\TypeTests.cs (1)
1533mem = topType.GetMembers(WellKnownMemberNames.Indexer).Single();
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
SymbolUtilities.cs (1)
63T member = type.GetMembers(WellKnownMemberNames.Indexer).Where(i => i.MetadataName == name).Single() as T;
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamespaceOrTypeSymbolExtensions.cs (1)
29: symbol.GetMembers(WellKnownMemberNames.Indexer).OfType<IPropertySymbol>().Where(p => p.IsIndexer);