5 implementations of Arity
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
75public abstract int Arity { get; }
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\NamedTypeSymbol.cs (1)
24int INamedTypeSymbol.Arity
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
66public int Arity => _symbol.Arity;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\NamedTypeSymbol.vb (1)
1315Private ReadOnly Property INamedTypeSymbol_Arity As Integer Implements INamedTypeSymbol.Arity
Microsoft.CodeAnalysis.Workspaces (1)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationAbstractNamedTypeSymbol.cs (1)
75public abstract int Arity { get; }
111 references to Arity
Microsoft.AspNetCore.SignalR.Client.SourceGenerator (7)
HubClientProxyGenerator.Parser.cs (1)
301if (!(member.ReturnsVoid || member.ReturnType is INamedTypeSymbol { Arity: 0, Name: "Task" }))
HubServerProxyGenerator.Parser.cs (6)
278if (member.ReturnType is INamedTypeSymbol { Arity: 1 } rtype) 283if (member.ReturnType is INamedTypeSymbol { Arity: 1, Name: "Task" } a 284&& a.TypeArguments[0] is INamedTypeSymbol { Arity: 1, Name: "ChannelReader" } b) 289else if (member.ReturnType is INamedTypeSymbol { Arity: 1, Name: "IAsyncEnumerable" } c) 312case INamedTypeSymbol { Arity: 1, Name: "ChannelReader" }: 315case INamedTypeSymbol { Arity: 1, Name: "IAsyncEnumerable" }:
Microsoft.CodeAnalysis (8)
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
825((INamedTypeSymbol)s).Arity == arity);
DocumentationCommentId.cs (2)
1172if (namedType.Arity == arity) 1194if (symbol.Kind == SymbolKind.Namespace || (symbol.Kind == SymbolKind.NamedType && ((INamedTypeSymbol)symbol).Arity == 0))
SymbolDisplay\AbstractSymbolDisplayVisitor_Minimal.cs (3)
28ISymbol? normalSymbol = SingleSymbolWithArity(normalSymbols, symbol.Arity); 45ISymbol? typeOnlySymbol = SingleSymbolWithArity(typeOnlySymbols, symbol.Arity); 71arity = ((INamedTypeSymbol)candidate).Arity;
Symbols\ISymbolExtensions.cs (2)
128Arity: 0, 152if (scopeType is not INamedTypeSymbol { Name: WellKnownMemberNames.LockScopeTypeName, Arity: 0, IsValueType: true, IsRefLikeType: true, DeclaredAccessibility: Accessibility.Public } ||
Microsoft.CodeAnalysis.CodeStyle (12)
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
85if (linqMethodSymbol.Parameters is [_, { Type: INamedTypeSymbol { Arity: 2 } }])
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
825((INamedTypeSymbol)s).Arity == arity);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (1)
118if (method.ReturnType is not INamedTypeSymbol { Arity: 0 })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
352SymbolKind.NamedType => ((INamedTypeSymbol)symbol).Arity,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
83symbol = updatedContainingType.GetTypeMembers(symbol.Name, symbol.Arity).First(m => m.TypeKind == symbol.TypeKind);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
45/// equal <see cref="INamedTypeSymbol.Arity"/> and
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ErrorTypeSymbolKey.cs (1)
36visitor.WriteInteger(symbol.Arity);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (2)
21visitor.WriteInteger(symbol.Arity); 118if (errorType.Name != name || errorType.Arity != arity)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (2)
358x.Arity != y.Arity ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
173Hash.Combine(x.Arity,
Microsoft.CodeAnalysis.CSharp (6)
SymbolDisplay\SymbolDisplayVisitor.Types.cs (6)
390Debug.Assert(symbol.Arity > 0); 392MetadataHelpers.GetAritySuffix(symbol.Arity))); 395else if (symbol.Arity > 0 && Format.GenericsOptions.IncludesOption(SymbolDisplayGenericsOptions.IncludeTypeParameters)) 401for (int i = 0; i < symbol.Arity - 1; i++) 492if (currentUnderlying.Arity <= 1) 497while (currentUnderlying.Arity == NamedTypeSymbol.ValueTupleRestPosition)
Microsoft.CodeAnalysis.CSharp.CodeStyle (2)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForLocalFunctionHelper.cs (1)
63namedType.Arity != 0;
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForMethodsHelper.cs (1)
61return method.ReturnType is INamedTypeSymbol namedType && namedType.Arity != 0;
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (1)
114_importedTypes.Add((type.Name, type.Arity), ns);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1034INamedTypeSymbol nt => nt.Arity > 0,
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (2)
CodeGen\CodeGenLocalFunctionTests.cs (2)
3170Assert.Equal(0, gooFrame.Arity); 3171Assert.Equal(1, barFrame.Arity);
Microsoft.CodeAnalysis.CSharp.Features (2)
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForLocalFunctionHelper.cs (1)
63namedType.Arity != 0;
src\Analyzers\CSharp\Analyzers\UseExpressionBody\Helpers\UseExpressionBodyForMethodsHelper.cs (1)
61return method.ReturnType is INamedTypeSymbol namedType && namedType.Arity != 0;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (10)
Compilation\GetSemanticInfoTests.cs (1)
1893Assert.Equal(3, type.Arity);
Compilation\SemanticModelAPITests.cs (2)
4502Assert.Equal(2, type.Arity); 4580Assert.Equal(2, type.Arity);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (2)
944Assert.Equal(1, structSymbol.Arity); 965Assert.Equal(2, itfcSymbol.Arity);
Symbols\AnonymousTypesSemanticsTests.cs (2)
1974ITypeSymbol[] args = new ITypeSymbol[namedType.Arity]; 1975for (int i = 0; i < namedType.Arity; i++)
Symbols\Source\ClsComplianceTests.cs (2)
3172if (type.Arity > 0) 3174type = type.Construct(ArrayBuilder<TypeSymbol>.GetInstance(type.Arity, intType).ToImmutableAndFree());
Symbols\Source\DelegateTests.cs (1)
135Assert.Equal(0, v.Arity); // number of type parameters
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Editing\CSharpImportAdder.cs (1)
114_importedTypes.Add((type.Name, type.Arity), ns);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (1)
1034INamedTypeSymbol nt => nt.Arity > 0,
Microsoft.CodeAnalysis.Features (10)
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionService.cs (3)
308if (type.Arity == 0) 314var newBestGenericOverload = BestGenericOverload == null || type.Arity < BestGenericOverload.Arity
Completion\Providers\ImportCompletionProvider\TypeImportCompletionCacheEntry.cs (2)
184var isGeneric = symbol.Arity > 0; 199symbol.Arity,
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
66public int Arity => _symbol.Arity;
Shared\Extensions\ISymbolExtensions_Sorting.cs (2)
127return xNamedType.Arity - yNamedType.Arity;
src\Analyzers\Core\Analyzers\SimplifyLinqExpression\AbstractSimplifyLinqExpressionDiagnosticAnalyzer.cs (1)
85if (linqMethodSymbol.Parameters is [_, { Type: INamedTypeSymbol { Arity: 2 } }])
src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (1)
825((INamedTypeSymbol)s).Arity == arity);
Microsoft.CodeAnalysis.VisualBasic (7)
SymbolDisplay\SymbolDisplayVisitor.Types.vb (6)
281Debug.Assert(symbol.Arity > 0) 283MetadataHelpers.GenericTypeNameManglingChar & symbol.Arity.ToString(), False)) 285ElseIf symbol.Arity > 0 AndAlso Format.GenericsOptions.IncludesOption(SymbolDisplayGenericsOptions.IncludeTypeParameters) AndAlso Not skipTypeArguments Then 291While i < symbol.Arity - 1 349If currentUnderlying.Arity = 1 Then 353While currentUnderlying.Arity = TupleTypeSymbol.RestPosition
Symbols\NamedTypeSymbol.vb (1)
1315Private ReadOnly Property INamedTypeSymbol_Arity As Integer Implements INamedTypeSymbol.Arity
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (9)
Compilation\CompilationAPITests.vb (3)
397Assert.Equal(1, comp.GetTypeByMetadataName("A.B.G`1").Arity) 398Assert.Equal(2, comp.GetTypeByMetadataName("A.B.G`1+Q`2").Arity) 399Assert.Equal(2, comp.GetTypeByMetadataName("A.B.G`2").Arity)
Compilation\SemanticModelGetDeclaredSymbolAPITests.vb (6)
684Assert.Equal(0, typeSymbol.Arity) 691Assert.Equal(0, typeSymbol2.Arity) 698Assert.Equal(0, typeSymbol3.Arity) 706Assert.Equal(0, typeSymbol4.Arity) 715Assert.Equal(1, typeSymbol5.Arity) 725Assert.Equal(0, typeSymbol6.Arity)
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (6)
SymbolsTests\Source\BindingsTests.vb (6)
360Assert.Equal(0, typeSymbol.Arity) 367Assert.Equal(0, typeSymbol2.Arity) 374Assert.Equal(0, typeSymbol3.Arity) 382Assert.Equal(0, typeSymbol4.Arity) 391Assert.Equal(1, typeSymbol5.Arity) 400Assert.Equal(0, typeSymbol6.Arity)
Microsoft.CodeAnalysis.Workspaces (15)
FindSymbols\FindReferences\Finders\ConstructorSymbolReferenceFinder.cs (2)
30return GetAllMatchingGlobalAliasNamesAsync(project, containingType.Name, containingType.Arity, cancellationToken); 110foreach (var localAlias in state.Cache.SyntaxTreeIndex.GetAliases(containingTypeName, containingType.Arity))
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (2)
24return GetAllMatchingGlobalAliasNamesAsync(project, symbol.Name, symbol.Arity, cancellationToken); 153foreach (var localAlias in state.Cache.SyntaxTreeIndex.GetAliases(namedType.Name, namedType.Arity))
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (1)
118if (method.ReturnType is not INamedTypeSymbol { Arity: 0 })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.cs (1)
352SymbolKind.NamedType => ((INamedTypeSymbol)symbol).Arity,
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
83symbol = updatedContainingType.GetTypeMembers(symbol.Name, symbol.Arity).First(m => m.TypeKind == symbol.TypeKind);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
45/// equal <see cref="INamedTypeSymbol.Arity"/> and
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ErrorTypeSymbolKey.cs (1)
36visitor.WriteInteger(symbol.Arity);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamedTypeSymbolKey.cs (2)
21visitor.WriteInteger(symbol.Arity); 118if (errorType.Name != name || errorType.Arity != arity)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (2)
358x.Arity != y.Arity ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
173Hash.Combine(x.Arity,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamespaceOrTypeSymbol.cs (1)
43=> GetTypeMembers(name).WhereAsArray(n => n.Arity == arity);
Microsoft.Gen.Metrics (1)
Parser.cs (1)
581if (returnType is INamedTypeSymbol { Arity: > 0 })
Microsoft.Gen.MetricsReports (1)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
581if (returnType is INamedTypeSymbol { Arity: > 0 })
Microsoft.Interop.SourceGeneration (2)
CustomMarshallingInfoHelper.cs (1)
48if (entryPointType.Arity != 2)
TypeSymbolExtensions.cs (1)
250currentType = currentType.GetTypeMembers(originalNestedType.Name, originalNestedType.Arity).First();
Microsoft.VisualStudio.LanguageServices (3)
Progression\GraphNodeIdCreation.cs (3)
156if (namedType.ContainingType == null && Equals(namedType.ConstructedFrom, namedType) && namedType.Arity == 0) 176if (namedType.Arity > 0) 178partials.Add(GraphNodeId.GetPartial(CodeGraphNodeIdName.GenericParameterCountIdentifier, namedType.Arity.ToString()));
Microsoft.VisualStudio.LanguageServices.CSharp (2)
CodeModel\CSharpCodeModelService_Prototype.cs (2)
588if (includeGenerics && namedType.Arity > 0) 591builder.Append(',', namedType.Arity - 1);
System.Text.Json.SourceGeneration (2)
Helpers\RoslynExtensions.cs (2)
87type = namedType = containingType.GetTypeMembers().First(t => t.Name == namedType.Name && t.Arity == namedType.Arity);