2 implementations of IArrayTypeSymbol
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\ArrayTypeSymbol.cs (1)
12internal sealed class ArrayTypeSymbol : TypeSymbol, IArrayTypeSymbol
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\ArrayTypeSymbol.vb (1)
21Implements IArrayTypeSymbol, IArrayTypeSymbolInternal
307 references to IArrayTypeSymbol
ConfigurationSchemaGenerator (5)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (4)
235if (type is IArrayTypeSymbol { ElementType.SpecialType: SpecialType.System_Byte }) 339IArrayTypeSymbol typeSymbol = (IArrayTypeSymbol)typeParseInfo.TypeSymbol; 557if (type is IArrayTypeSymbol arrayTypeSymbol)
RuntimeSource\Configuration.Binder\Parser\Extensions.cs (1)
94if (type is IArrayTypeSymbol arrayType)
Microsoft.AspNetCore.App.Analyzers (2)
RouteHandlers\DisallowNonParsableComplexTypesOnParameters.cs (1)
121if (parameterSymbol.Type is IArrayTypeSymbol arrayTypeSymbol)
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
24if (unwrapArray && typeSymbol is IArrayTypeSymbol arrayTypeSymbol)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (1)
src\Shared\RoslynUtils\SymbolExtensions.cs (1)
24if (unwrapArray && typeSymbol is IArrayTypeSymbol arrayTypeSymbol)
Microsoft.CodeAnalysis (9)
Compilation\Compilation.cs (4)
1076public IArrayTypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank = 1, NullableAnnotation elementNullableAnnotation = NullableAnnotation.None) 1086public IArrayTypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank) 1091protected abstract IArrayTypeSymbol CommonCreateArrayTypeSymbol(ITypeSymbol elementType, int rank, NullableAnnotation elementNullableAnnotation); 1708s = ((IArrayTypeSymbol)s).ElementType;
DocumentationCommentId.cs (1)
622public override bool VisitArrayType(IArrayTypeSymbol symbol)
Symbols\IArrayTypeSymbol.cs (1)
62bool Equals(IArrayTypeSymbol? other);
Symbols\SymbolVisitor.cs (1)
23public virtual void VisitArrayType(IArrayTypeSymbol symbol)
Symbols\SymbolVisitor`1.cs (1)
26public virtual TResult? VisitArrayType(IArrayTypeSymbol symbol)
Symbols\SymbolVisitor`2.cs (1)
31public virtual TResult VisitArrayType(IArrayTypeSymbol symbol, TArgument argument)
Microsoft.CodeAnalysis.CodeStyle (31)
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
187return argsArgumentType is IArrayTypeSymbol arrayType && arrayType.ElementType.IsReferenceType;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
28public override bool VisitArrayType(IArrayTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (1)
99return IsSymbolAccessibleCore(((IArrayTypeSymbol)symbol).ElementType, within, null, out failedThroughTypeCheck);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
22public override ITypeSymbol VisitArrayType(IArrayTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (1)
27public override void VisitArrayType(IArrayTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (5)
317IArrayTypeSymbol a => ContainsAnonymousType(a.ElementType), 344case IArrayTypeSymbol arrayType: 556if (t1 is IArrayTypeSymbol arr1) 558var arr2 = (IArrayTypeSymbol)t2;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
21public override Accessibility VisitArrayType(IArrayTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
95public override ITypeSymbol VisitArrayType(IArrayTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
23public override ITypeSymbol VisitArrayType(IArrayTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
22public override ITypeSymbol VisitArrayType(IArrayTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ArrayTypeSymbolKey.cs (4)
9private sealed class ArrayTypeSymbolKey : AbstractSymbolKey<IArrayTypeSymbol> 13public sealed override void Create(IArrayTypeSymbol symbol, SymbolKeyWriter visitor) 20SymbolKeyReader reader, IArrayTypeSymbol? contextualSymbol, out string? failureReason) 31using var result = PooledArrayBuilder<IArrayTypeSymbol>.GetInstance(elementTypeResolution.SymbolCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (3)
24/// <item>Two <see cref="IArrayTypeSymbol"/>s are the "same" if they have 25/// the "same" <see cref="IArrayTypeSymbol.ElementType"/> and 26/// equal <see cref="IArrayTypeSymbol.Rank"/>.</item>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
326public override void VisitArrayType(IArrayTypeSymbol arrayTypeSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
50return AreArrayAndReadOnlySpanEquivalent((IArrayTypeSymbol)x, (INamedTypeSymbol)y, equivalentTypesWithDifferingAssemblies); 54return AreArrayAndReadOnlySpanEquivalent((IArrayTypeSymbol)y, (INamedTypeSymbol)x, equivalentTypesWithDifferingAssemblies); 64private bool AreArrayAndReadOnlySpanEquivalent(IArrayTypeSymbol array, INamedTypeSymbol readOnlySpanType, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 116SymbolKind.ArrayType => ArrayTypesAreEquivalent((IArrayTypeSymbol)x, (IArrayTypeSymbol)y, equivalentTypesWithDifferingAssemblies), 139private bool ArrayTypesAreEquivalent(IArrayTypeSymbol x, IArrayTypeSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
59SymbolKind.ArrayType => CombineHashCodes((IArrayTypeSymbol)x, currentHash), 78private int CombineHashCodes(IArrayTypeSymbol x, int currentHash)
Microsoft.CodeAnalysis.CodeStyle.Fixes (9)
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (1)
155&& parameterType is IArrayTypeSymbol paramsType
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
521if (parameter.IsParams && parameter.Type is IArrayTypeSymbol arrayType)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (2)
367var arrayType = (IArrayTypeSymbol)type;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (1)
47public override ValueTask VisitArrayType(IArrayTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
357public static IArrayTypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank = 1, NullableAnnotation nullableAnnotation = NullableAnnotation.None)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (2)
10internal sealed class CodeGenerationArrayTypeSymbol(ITypeSymbol elementType, int rank, NullableAnnotation nullableAnnotation) : CodeGenerationTypeSymbol(null, null, default, Accessibility.NotApplicable, default, string.Empty, SpecialType.None, nullableAnnotation), IArrayTypeSymbol 67public bool Equals(IArrayTypeSymbol? other)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
98if (parameterSymbol.Type is IArrayTypeSymbol arrayTypeSymbol)
Microsoft.CodeAnalysis.CSharp (19)
Compilation\CSharpCompilation.cs (1)
4004protected override IArrayTypeSymbol CommonCreateArrayTypeSymbol(ITypeSymbol elementType, int rank, CodeAnalysis.NullableAnnotation elementNullableAnnotation)
SymbolDisplay\SymbolDisplayVisitor.Types.cs (6)
17public override void VisitArrayType(IArrayTypeSymbol symbol) 23private void VisitArrayTypeWithoutNullability(IArrayTypeSymbol symbol) 51underlyingType = ((IArrayTypeSymbol)underlyingType).ElementType; 57var arrayType = symbol; 66arrayType = arrayType.ElementType as IArrayTypeSymbol; 103private void AddArrayRank(IArrayTypeSymbol symbol)
Symbols\PublicModel\ArrayTypeSymbol.cs (9)
35int IArrayTypeSymbol.Rank => _underlying.Rank; 37bool IArrayTypeSymbol.IsSZArray => _underlying.IsSZArray; 39ImmutableArray<int> IArrayTypeSymbol.LowerBounds => _underlying.LowerBounds; 41ImmutableArray<int> IArrayTypeSymbol.Sizes => _underlying.Sizes; 43ITypeSymbol IArrayTypeSymbol.ElementType 56CodeAnalysis.NullableAnnotation IArrayTypeSymbol.ElementNullableAnnotation 64ImmutableArray<CustomModifier> IArrayTypeSymbol.CustomModifiers => _underlying.ElementTypeWithAnnotations.CustomModifiers; 66bool IArrayTypeSymbol.Equals(IArrayTypeSymbol? other)
Symbols\SymbolExtensions.cs (2)
665internal static IArrayTypeSymbol? GetPublicSymbol(this ArrayTypeSymbol? symbol) 667return symbol.GetPublicSymbol<IArrayTypeSymbol>();
Symbols\Synthesized\SynthesizedSubmissionConstructor.cs (1)
24var submissionArrayType = compilation.CreateArrayTypeSymbol(compilation.GetSpecialType(SpecialType.System_Object));
Microsoft.CodeAnalysis.CSharp.CodeStyle (6)
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (4)
202if (type is IArrayTypeSymbol arrayType && 259if (type is IArrayTypeSymbol) 295if (type is IArrayTypeSymbol) 1057if (originalCreateMethod.Parameters is [{ IsParams: true, Type: IArrayTypeSymbol { ElementType: ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } } }])
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
78if (arrayCreationOperation.Type is not IArrayTypeSymbol { ElementType.SpecialType: SpecialType.System_Byte })
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (1)
115if (type is IArrayTypeSymbol arrayType)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (14)
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (1)
59else if (arity == 0 && type is IArrayTypeSymbol arrayType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (4)
58public override TypeSyntax VisitArrayType(IArrayTypeSymbol symbol) 64while (underlyingType is IArrayTypeSymbol innerArray) 91var arrayType = symbol; 97arrayType = arrayType.ElementType as IArrayTypeSymbol;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (9)
682DetermineTypeParameterMapping(((IArrayTypeSymbol)inferredType).ElementType, ((IArrayTypeSymbol)returnType).ElementType, result); 818return outerTypes.Where(o => o.InferredType is IArrayTypeSymbol); 844currentTypes = currentTypes.Select(t => t.InferredType).OfType<IArrayTypeSymbol>() 1349var elementTypes = arrayTypes.OfType<IArrayTypeSymbol>().Select(a => new TypeInferenceInfo(a.ElementType)).Where(IsUsableTypeFunc); 1373if (types.Any(t => t is IArrayTypeSymbol)) 1375return types.OfType<IArrayTypeSymbol>().Select(t => new TypeInferenceInfo(t.ElementType)); 1383if (types.Any(t => t is IArrayTypeSymbol)) 1385return types.OfType<IArrayTypeSymbol>().Select(t => new TypeInferenceInfo(t.ElementType));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (3)
CodeGen\CodeGenTupleTest.cs (3)
14298var m3TupleArray = (IArrayTypeSymbol)test.GetMember<IMethodSymbol>("M3").ReturnType; 14308m3TupleArray = (IArrayTypeSymbol)((IMethodSymbol)symbolInfo.Symbol).ReturnType;
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (2)
Emit\EditAndContinue\SymbolMatcherTests.cs (2)
346var member = compilation1.CreateArrayTypeSymbol(elementType); 377var member = compilation1.CreateArrayTypeSymbol(elementType);
Microsoft.CodeAnalysis.CSharp.Features (10)
Completion\CompletionProviders\CSharpSuggestionModeCompletionProvider.cs (1)
195typeSymbol = ((IArrayTypeSymbol)typeInferenceInfo.InferredType).ElementType;
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.cs (1)
117if (type is IArrayTypeSymbol arrayType)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
110if (isParams && type is IArrayTypeSymbol arrayType)
SignatureHelp\LightweightOverloadResolution.cs (1)
125&& type is IArrayTypeSymbol arrayType
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (4)
202if (type is IArrayTypeSymbol arrayType && 259if (type is IArrayTypeSymbol) 295if (type is IArrayTypeSymbol) 1057if (originalCreateMethod.Parameters is [{ IsParams: true, Type: IArrayTypeSymbol { ElementType: ITypeParameterSymbol { TypeParameterKind: TypeParameterKind.Method } } }])
src\Analyzers\CSharp\Analyzers\UseUtf8StringLiteral\UseUtf8StringLiteralDiagnosticAnalyzer.cs (1)
78if (arrayCreationOperation.Type is not IArrayTypeSymbol { ElementType.SpecialType: SpecialType.System_Byte })
src\Analyzers\CSharp\CodeFixes\Iterator\CSharpChangeToIEnumerableCodeFixProvider.cs (1)
59else if (arity == 0 && type is IArrayTypeSymbol arrayType)
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (5)
Semantics\MultiDimensionalArrayTests.cs (4)
1681var a1 = (IArrayTypeSymbol)p.GetMember<MethodSymbol>("Test1").GetAttributes().Single().ConstructorArguments.Single().Value; 1686var a2 = (IArrayTypeSymbol)p.GetMember<MethodSymbol>("Test2").GetAttributes().Single().ConstructorArguments.Single().Value;
Semantics\RefLocalsAndReturnsTests.cs (1)
4755Assert.Equal(SpecialType.System_Int32, ((IArrayTypeSymbol)model.GetTypeInfo(left).Type).ElementType.SpecialType);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (25)
Compilation\CompilationAPITests.cs (1)
2463var arrayType = comp.CreateArrayTypeSymbol(elementType);
Compilation\GetSemanticInfoTests.cs (2)
1918var arrayType = (IArrayTypeSymbol)bindInfo.Symbol;
Compilation\SemanticModelAPITests.cs (1)
708Assert.Equal(compilation.GetSpecialType(SpecialType.System_String), (info.Symbol as IArrayTypeSymbol).ElementType);
Compilation\SemanticModelGetSemanticInfoTests.cs (1)
6229Assert.Equal(SpecialType.System_String, ((IArrayTypeSymbol)semanticInfo.Type).ElementType.SpecialType);
Compilation\SymbolVisitorTests.cs (3)
50public override void VisitArrayType(IArrayTypeSymbol symbol) 220public override string VisitArrayType(IArrayTypeSymbol symbol) 479public override int VisitArrayType(IArrayTypeSymbol symbol, StringBuilder argument)
Symbols\Source\NullablePublicAPITests.cs (17)
56var arrayTypes = arrayAccesses.Select(arr => model.GetTypeInfoAndVerifyIOperation(arr.Expression).Type).Cast<IArrayTypeSymbol>().ToList(); 696var array = (IArrayTypeSymbol)method.ReturnType; 5257var type = (IArrayTypeSymbol)typeInfo.ConvertedType; 5280var type = (IArrayTypeSymbol)typeInfo.ConvertedType; 5312var type = (IArrayTypeSymbol)typeInfo.ConvertedType; 5335var type = (IArrayTypeSymbol)typeInfo.ConvertedType; 5357var type = (IArrayTypeSymbol)typeInfo.ConvertedType; 5405var type = (IArrayTypeSymbol)typeInfo.ConvertedType; 5462var type = (IArrayTypeSymbol)typeInfo.ConvertedType;
Microsoft.CodeAnalysis.CSharp.Workspaces (14)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.State.cs (1)
115if (type is IArrayTypeSymbol arrayType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (4)
58public override TypeSyntax VisitArrayType(IArrayTypeSymbol symbol) 64while (underlyingType is IArrayTypeSymbol innerArray) 91var arrayType = symbol; 97arrayType = arrayType.ElementType as IArrayTypeSymbol;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (9)
682DetermineTypeParameterMapping(((IArrayTypeSymbol)inferredType).ElementType, ((IArrayTypeSymbol)returnType).ElementType, result); 818return outerTypes.Where(o => o.InferredType is IArrayTypeSymbol); 844currentTypes = currentTypes.Select(t => t.InferredType).OfType<IArrayTypeSymbol>() 1349var elementTypes = arrayTypes.OfType<IArrayTypeSymbol>().Select(a => new TypeInferenceInfo(a.ElementType)).Where(IsUsableTypeFunc); 1373if (types.Any(t => t is IArrayTypeSymbol)) 1375return types.OfType<IArrayTypeSymbol>().Select(t => new TypeInferenceInfo(t.ElementType)); 1383if (types.Any(t => t is IArrayTypeSymbol)) 1385return types.OfType<IArrayTypeSymbol>().Select(t => new TypeInferenceInfo(t.ElementType));
Microsoft.CodeAnalysis.CSharp.Workspaces.UnitTests (1)
CodeGeneration\SyntaxGeneratorTests.cs (1)
318var arrayType = _emptyCompilation.CreateArrayTypeSymbol(_emptyCompilation.GetSpecialType(SpecialType.System_Int32));
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (1)
AbstractTypeParameterChecker.cs (1)
49public sealed override void VisitArrayType(IArrayTypeSymbol symbol)
Microsoft.CodeAnalysis.Features (23)
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (2)
60var isArray = type is IArrayTypeSymbol; 61while (type is IArrayTypeSymbol arrayType)
Completion\Providers\ImportCompletionProvider\ExtensionMethodImportCompletionHelper.SymbolComputer.cs (2)
529case IArrayTypeSymbol arrayType: 531while (elementType is IArrayTypeSymbol symbol)
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
216if (collectionType is IArrayTypeSymbol array)
ConvertForToForEach\AbstractConvertForToForEachCodeRefactoringProvider.cs (2)
249if (collectionType is IArrayTypeSymbol arrayType) 504if (collectionType is IArrayTypeSymbol arrayType)
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
84if (lastArgumentType is IArrayTypeSymbol)
ExtractMethod\MethodExtractor.TypeParameterCollector.cs (1)
43public override void VisitArrayType(IArrayTypeSymbol arrayTypeSymbol)
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (1)
503&& parameterSymbol.Type is IArrayTypeSymbol paramArrayParameter
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.StructuralTypeCollectorVisitor.cs (1)
26public override void VisitArrayType(IArrayTypeSymbol symbol)
QuickInfo\CommonSemanticQuickInfoProvider.ErrorVisitor.cs (1)
26public override bool VisitArrayType(IArrayTypeSymbol symbol)
RQName\RQNodeBuilder.cs (1)
279else if (symbol is IArrayTypeSymbol arrayType)
Shared\Extensions\ISymbolExtensions_Sorting.cs (1)
46IArrayTypeSymbol arrayType => GetNamedType(arrayType.ElementType),
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
187return argsArgumentType is IArrayTypeSymbol arrayType && arrayType.ElementType.IsReferenceType;
src\Analyzers\Core\CodeFixes\AddExplicitCast\Fixer.cs (1)
155&& parameterType is IArrayTypeSymbol paramsType
src\Analyzers\Core\CodeFixes\AddParameter\AbstractAddParameterCodeFixProvider.cs (1)
521if (parameter.IsParams && parameter.Type is IArrayTypeSymbol arrayType)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (2)
367var arrayType = (IArrayTypeSymbol)type;
src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\TypeParameterSubstitution.cs (1)
47public override ValueTask VisitArrayType(IArrayTypeSymbol symbol)
StackTraceExplorer\AbstractStackTraceSymbolResolver.cs (3)
41if (type is IArrayTypeSymbol arrayType) 57if (currentType is not IArrayTypeSymbol currentArrayType) 72if (currentType is IArrayTypeSymbol)
Microsoft.CodeAnalysis.Test.Utilities (1)
Diagnostics\EmptyArrayAnalyzer.cs (1)
73var elementType = (arrayCreation as IArrayTypeSymbol)?.ElementType;
Microsoft.CodeAnalysis.VisualBasic (15)
Compilation\VisualBasicCompilation.vb (1)
2847Protected Overrides Function CommonCreateArrayTypeSymbol(elementType As ITypeSymbol, rank As Integer, elementNullableAnnotation As NullableAnnotation) As IArrayTypeSymbol
SymbolDisplay\SymbolDisplayVisitor.Types.vb (5)
10Public Overrides Sub VisitArrayType(symbol As IArrayTypeSymbol) 31underlyingNonArrayType = DirectCast(underlyingNonArrayType, IArrayTypeSymbol).ElementType 36Dim arrayType As IArrayTypeSymbol = symbol 41arrayType = TryCast(arrayType.ElementType, IArrayTypeSymbol) 45Private Sub AddArrayRank(symbol As IArrayTypeSymbol)
Symbols\ArrayTypeSymbol.vb (9)
400Private ReadOnly Property IArrayTypeSymbol_ElementType As ITypeSymbol Implements IArrayTypeSymbol.ElementType 412Private ReadOnly Property IArrayTypeSymbol_ElementNullableAnnotation As NullableAnnotation Implements IArrayTypeSymbol.ElementNullableAnnotation 418Private ReadOnly Property IArrayTypeSymbol_Rank As Integer Implements IArrayTypeSymbol.Rank 424Private ReadOnly Property IArrayTypeSymbol_IsSZArray As Boolean Implements IArrayTypeSymbol.IsSZArray, IArrayTypeSymbolInternal.IsSZArray 430Private ReadOnly Property IArrayTypeSymbol_Sizes As ImmutableArray(Of Integer) Implements IArrayTypeSymbol.Sizes 436Private ReadOnly Property IArrayTypeSymbol_LowerBounds As ImmutableArray(Of Integer) Implements IArrayTypeSymbol.LowerBounds 442Private ReadOnly Property IArrayTypeSymbol_CustomModifiers As ImmutableArray(Of CustomModifier) Implements IArrayTypeSymbol.CustomModifiers 448Private Function IArrayTypeSymbol_Equals(symbol As IArrayTypeSymbol) As Boolean Implements IArrayTypeSymbol.Equals
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\CastAnalyzer.vb (2)
38If parameter?.IsParams = True AndAlso TypeOf parameter.Type Is IArrayTypeSymbol Then 39Dim parameterType = DirectCast(parameter.Type, IArrayTypeSymbol)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (11)
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (1)
139Dim paramsType = TryCast(parameterType, IArrayTypeSymbol)
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateMethodService.vb (1)
104If TypeOf nameSemanticInfo.Type IsNot IArrayTypeSymbol Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (1)
44Dim arrayType = DirectCast(parameter.Type, IArrayTypeSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (3)
41Public Overrides Function VisitArrayType(symbol As IArrayTypeSymbol) As TypeSyntax 44underlyingNonArrayType = (DirectCast(underlyingNonArrayType, IArrayTypeSymbol)).ElementType 54arrayType = TryCast(arrayType.ElementType, IArrayTypeSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (5)
281If TypeOf expressionType.Type Is IArrayTypeSymbol Then 407Return outerTypes.Where(Function(c) TypeOf c.InferredType Is IArrayTypeSymbol) _ 408.Select(Function(c) New TypeInferenceInfo(DirectCast(c.InferredType, IArrayTypeSymbol).ElementType)) 421currentTypes = currentTypes.WhereAsArray(Function(c) TypeOf c.InferredType Is IArrayTypeSymbol). 422SelectAsArray(Function(c) New TypeInferenceInfo(DirectCast(c.InferredType, IArrayTypeSymbol).ElementType))
Microsoft.CodeAnalysis.VisualBasic.Features (3)
src\Analyzers\VisualBasic\CodeFixes\AddExplicitCast\VisualBasicAddExplicitCastCodeFixProvider.vb (1)
139Dim paramsType = TryCast(parameterType, IArrayTypeSymbol)
src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateMethodService.vb (1)
104If TypeOf nameSemanticInfo.Type IsNot IArrayTypeSymbol Then
UseAutoProperty\VisualBasicUseAutoPropertyCodeFixProvider.vb (1)
79Dim arrayType = TryCast(semanticsModel.GetDeclaredSymbol(propertyDeclaration, cancellationToken).Type, IArrayTypeSymbol)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (19)
Semantics\MultiDimensionalTest.vb (19)
872Dim szArray = DirectCast(m2.Parameters.First().Type, IArrayTypeSymbol) 879Dim mdArray = DirectCast(m2.Parameters.Last().Type, IArrayTypeSymbol) 2136Dim array = DirectCast(Test.GetMember(Of MethodSymbol)("Test1").ReturnType, IArrayTypeSymbol) 2143array = DirectCast(Test.GetMember(Of MethodSymbol)("Test2").ReturnType, IArrayTypeSymbol) 2150array = DirectCast(Test.GetMember(Of MethodSymbol)("Test3").ReturnType, IArrayTypeSymbol) 2157array = DirectCast(Test.GetMember(Of MethodSymbol)("Test4").ReturnType, IArrayTypeSymbol) 2164array = DirectCast(Test.GetMember(Of MethodSymbol)("Test5").ReturnType, IArrayTypeSymbol) 2171array = DirectCast(Test.GetMember(Of MethodSymbol)("Test6").ReturnType, IArrayTypeSymbol) 2178array = DirectCast(Test.GetMember(Of MethodSymbol)("Test7").ReturnType, IArrayTypeSymbol) 2185array = DirectCast(Test.GetMember(Of MethodSymbol)("Test8").ReturnType, IArrayTypeSymbol) 2192array = DirectCast(Test.GetMember(Of MethodSymbol)("Test9").ReturnType, IArrayTypeSymbol) 2199array = DirectCast(Test.GetMember(Of MethodSymbol)("Test10").ReturnType, IArrayTypeSymbol) 2206array = DirectCast(Test.GetMember(Of MethodSymbol)("Test11").ReturnType, IArrayTypeSymbol) 2213array = DirectCast(Test.GetMember(Of MethodSymbol)("Test12").ReturnType, IArrayTypeSymbol) 2220array = DirectCast(Test.GetMember(Of MethodSymbol)("Test13").ReturnType, IArrayTypeSymbol) 2227array = DirectCast(Test.GetMember(Of MethodSymbol)("Test14").ReturnType, IArrayTypeSymbol) 2234array = DirectCast(Test.GetMember(Of MethodSymbol)("Test15").ReturnType, IArrayTypeSymbol) 2241array = DirectCast(Test.GetMember(Of MethodSymbol)("Test16").ReturnType, IArrayTypeSymbol) 2248array = DirectCast(Test.GetMember(Of MethodSymbol)("Test17").ReturnType, IArrayTypeSymbol)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (12)
Recommendations\VisualBasicRecommendationServiceRunner.vb (1)
222If container Is Nothing AndAlso TypeOf (leftHandTypeInfo.ConvertedType) Is IArrayTypeSymbol Then
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Utilities\CastAnalyzer.vb (2)
38If parameter?.IsParams = True AndAlso TypeOf parameter.Type Is IArrayTypeSymbol Then 39Dim parameterType = DirectCast(parameter.Type, IArrayTypeSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ParameterGenerator.vb (1)
44Dim arrayType = DirectCast(parameter.Type, IArrayTypeSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (3)
41Public Overrides Function VisitArrayType(symbol As IArrayTypeSymbol) As TypeSyntax 44underlyingNonArrayType = (DirectCast(underlyingNonArrayType, IArrayTypeSymbol)).ElementType 54arrayType = TryCast(arrayType.ElementType, IArrayTypeSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (5)
281If TypeOf expressionType.Type Is IArrayTypeSymbol Then 407Return outerTypes.Where(Function(c) TypeOf c.InferredType Is IArrayTypeSymbol) _ 408.Select(Function(c) New TypeInferenceInfo(DirectCast(c.InferredType, IArrayTypeSymbol).ElementType)) 421currentTypes = currentTypes.WhereAsArray(Function(c) TypeOf c.InferredType Is IArrayTypeSymbol). 422SelectAsArray(Function(c) New TypeInferenceInfo(DirectCast(c.InferredType, IArrayTypeSymbol).ElementType))
Microsoft.CodeAnalysis.Workspaces (36)
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.UnderlyingNamedTypeVisitor.cs (1)
19public override INamedTypeSymbol? VisitArrayType(IArrayTypeSymbol symbol)
Recommendations\AbstractRecommendationServiceRunner.cs (1)
249if (method.Parameters.LastOrDefault()?.Type is IArrayTypeSymbol arrayType)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
28public override bool VisitArrayType(IArrayTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (1)
99return IsSymbolAccessibleCore(((IArrayTypeSymbol)symbol).ElementType, within, null, out failedThroughTypeCheck);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.AnonymousTypeRemover.cs (1)
22public override ITypeSymbol VisitArrayType(IArrayTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.CollectTypeParameterSymbolsVisitor.cs (1)
27public override void VisitArrayType(IArrayTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (5)
317IArrayTypeSymbol a => ContainsAnonymousType(a.ElementType), 344case IArrayTypeSymbol arrayType: 556if (t1 is IArrayTypeSymbol arr1) 558var arr2 = (IArrayTypeSymbol)t2;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.MinimalAccessibilityVisitor.cs (1)
21public override Accessibility VisitArrayType(IArrayTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (1)
95public override ITypeSymbol VisitArrayType(IArrayTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnavailableTypeParameterRemover.cs (1)
23public override ITypeSymbol VisitArrayType(IArrayTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.UnnamedErrorTypeRemover.cs (1)
22public override ITypeSymbol VisitArrayType(IArrayTypeSymbol symbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.ArrayTypeSymbolKey.cs (4)
9private sealed class ArrayTypeSymbolKey : AbstractSymbolKey<IArrayTypeSymbol> 13public sealed override void Create(IArrayTypeSymbol symbol, SymbolKeyWriter visitor) 20SymbolKeyReader reader, IArrayTypeSymbol? contextualSymbol, out string? failureReason) 31using var result = PooledArrayBuilder<IArrayTypeSymbol>.GetInstance(elementTypeResolution.SymbolCount);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (3)
24/// <item>Two <see cref="IArrayTypeSymbol"/>s are the "same" if they have 25/// the "same" <see cref="IArrayTypeSymbol.ElementType"/> and 26/// equal <see cref="IArrayTypeSymbol.Rank"/>.</item>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
326public override void VisitArrayType(IArrayTypeSymbol arrayTypeSymbol)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
50return AreArrayAndReadOnlySpanEquivalent((IArrayTypeSymbol)x, (INamedTypeSymbol)y, equivalentTypesWithDifferingAssemblies); 54return AreArrayAndReadOnlySpanEquivalent((IArrayTypeSymbol)y, (INamedTypeSymbol)x, equivalentTypesWithDifferingAssemblies); 64private bool AreArrayAndReadOnlySpanEquivalent(IArrayTypeSymbol array, INamedTypeSymbol readOnlySpanType, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies) 116SymbolKind.ArrayType => ArrayTypesAreEquivalent((IArrayTypeSymbol)x, (IArrayTypeSymbol)y, equivalentTypesWithDifferingAssemblies), 139private bool ArrayTypesAreEquivalent(IArrayTypeSymbol x, IArrayTypeSymbol y, Dictionary<INamedTypeSymbol, INamedTypeSymbol>? equivalentTypesWithDifferingAssemblies)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (2)
59SymbolKind.ArrayType => CombineHashCodes((IArrayTypeSymbol)x, currentHash), 78private int CombineHashCodes(IArrayTypeSymbol x, int currentHash)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (1)
357public static IArrayTypeSymbol CreateArrayTypeSymbol(ITypeSymbol elementType, int rank = 1, NullableAnnotation nullableAnnotation = NullableAnnotation.None)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (2)
10internal sealed class CodeGenerationArrayTypeSymbol(ITypeSymbol elementType, int rank, NullableAnnotation nullableAnnotation) : CodeGenerationTypeSymbol(null, null, default, Accessibility.NotApplicable, default, string.Empty, SpecialType.None, nullableAnnotation), IArrayTypeSymbol 67public bool Equals(IArrayTypeSymbol? other)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\LanguageServices\TypeInferenceService\AbstractTypeInferenceService.AbstractTypeInferrer.cs (1)
98if (parameterSymbol.Type is IArrayTypeSymbol arrayTypeSymbol)
Microsoft.Extensions.Options.SourceGeneration (1)
Parser.cs (1)
231else if (type is IArrayTypeSymbol ats)
Microsoft.Interop.JavaScript.JSImportGenerator (1)
JSManagedTypeInfo.cs (1)
110case IArrayTypeSymbol { IsSZArray: true, ElementType: ITypeSymbol elementType }:
Microsoft.Interop.SourceGeneration (8)
ArrayMarshallingInfoProvider.cs (2)
26public bool CanProvideMarshallingInfoForType(ITypeSymbol type) => type is IArrayTypeSymbol { IsSZArray: true }; 36ITypeSymbol elementType = ((IArrayTypeSymbol)type).ElementType;
CustomMarshallingInfoHelper.cs (1)
42if (type is IArrayTypeSymbol arrayManagedType)
ManagedTypeInfo.cs (1)
60if (type.TypeKind == TypeKind.Array && type is IArrayTypeSymbol { IsSZArray: true } arraySymbol)
ManualTypeMarshallingHelper.cs (3)
366if (innerType is IArrayTypeSymbol array) 394IArrayTypeSymbol arrayType = (IArrayTypeSymbol)wrapperType;
MarshalAsWithCustomMarshallersParser.cs (1)
53if (type is not IArrayTypeSymbol { ElementType: ITypeSymbol elementType })
Microsoft.VisualStudio.LanguageServices (6)
Library\VsNavInfo\NavInfoFactory.cs (1)
87typeSymbol = ((IArrayTypeSymbol)typeSymbol).ElementType;
Progression\GraphNodeIdCreation.cs (3)
123if (symbol is IArrayTypeSymbol arrayType) 236private static async Task<GraphNodeId> GetPartialForArrayTypeAsync(IArrayTypeSymbol arrayType, GraphNodeIdName nodeName, Solution solution, CancellationToken cancellationToken) 277symbol = ((IArrayTypeSymbol)symbol).ElementType;
ProjectSystem\AbstractEntryPointFinder.cs (2)
57if (parameter.Type is IArrayTypeSymbol) 59var elementType = ((IArrayTypeSymbol)parameter.Type).ElementType;
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
GlyphExtensionsTests.cs (1)
214var arrayTypeMock = symbolMock.As<IArrayTypeSymbol>();
Microsoft.VisualStudio.LanguageServices.VisualBasic (5)
Help\VisualBasicHelpContextService.vb (2)
93If TypeOf symbolType Is IArrayTypeSymbol Then 94symbolType = DirectCast(symbolType, IArrayTypeSymbol).ElementType
Help\VisualBasicHelpContextService.Visitor.vb (3)
873Dim symbolType = TryCast(info.Symbol.GetSymbolType(), IArrayTypeSymbol) 875While symbolType.ElementType IsNot Nothing AndAlso TypeOf symbolType.ElementType Is IArrayTypeSymbol 876symbolType = DirectCast(symbolType.ElementType, IArrayTypeSymbol)
System.Text.Json.SourceGeneration (6)
Helpers\KnownTypeSymbols.cs (2)
151public IArrayTypeSymbol? ByteArrayType => _ByteArrayType.HasValue 155private Option<IArrayTypeSymbol?> _ByteArrayType;
Helpers\RoslynExtensions.cs (1)
53if (type is IArrayTypeSymbol arrayType)
JsonSourceGenerator.Parser.cs (3)
785if (type is IArrayTypeSymbol arraySymbol) 1686if (type is IArrayTypeSymbol arrayType) 1792type is IArrayTypeSymbol { Rank: > 1 };