3079 references to TypeKind
Aspire.Hosting.Integration.Analyzers (2)
AspireExportAnalyzer.cs (2)
934if (type.TypeKind == TypeKind.Enum) 1260return namedType.TypeKind == TypeKind.Delegate;
ConfigurationSchemaGenerator (8)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (7)
69type.TypeKind is TypeKind.TypeParameter or TypeKind.Pointer or TypeKind.Error || 192else if (type.TypeKind is TypeKind.Array) 602if (!(typeSymbol.IsAbstract || typeSymbol.TypeKind is TypeKind.Interface)) 841if (typeArg.TypeKind is TypeKind.TypeParameter or TypeKind.Error ||
RuntimeSource\SourceGenerators\TypeRef.cs (1)
33public TypeKind TypeKind { get; }
GenerateDocumentationAndConfigFiles (120)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
520=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
113if (type1.TypeKind == TypeKind.TypeParameter && 114type2.TypeKind == TypeKind.TypeParameter &&
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (5)
48case TypeKind.Class: 49if (type.TypeKind == TypeKind.Interface) 56case TypeKind.Interface: 71if (!baseTypesOnly && candidateBaseType.TypeKind == TypeKind.Interface) 86if (checkTypeParameterConstraints && symbol.TypeKind == TypeKind.TypeParameter)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
412namedType.TypeKind != TypeKind.Interface ||
src\roslyn\src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (6)
42if (containingType.TypeKind == TypeKind.Class) 143if (containingType.TypeKind == TypeKind.Class) 195if (containingType.TypeKind == TypeKind.Class) 242if (containingType.TypeKind == TypeKind.Class) 290if (containingType.TypeKind == TypeKind.Class) 355if (containingType.TypeKind == TypeKind.Class)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\CollectionExpressionUtilities.cs (1)
112if (!(namedType.TypeKind == TypeKind.Struct && noArgConstructor.IsImplicitlyDeclared))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
147if (type.TypeKind == TypeKind.Array && typeArguments.IsEmpty)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (13)
104private static readonly SymbolKindOrTypeKind s_class = new(TypeKind.Class); 105private static readonly SymbolKindOrTypeKind s_struct = new(TypeKind.Struct); 106private static readonly SymbolKindOrTypeKind s_interface = new(TypeKind.Interface); 107private static readonly SymbolKindOrTypeKind s_enum = new(TypeKind.Enum); 113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 329case TypeKind.Class: 332case TypeKind.Struct: 335case TypeKind.Interface: 338case TypeKind.Enum: 341case TypeKind.Delegate: 344case TypeKind.Module: 347case TypeKind.Pointer: 350case TypeKind.TypeParameter:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
66if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (20)
62new SymbolKindOrTypeKind(TypeKind.Class), 63new SymbolKindOrTypeKind(TypeKind.Struct), 64new SymbolKindOrTypeKind(TypeKind.Interface), 65new SymbolKindOrTypeKind(TypeKind.Delegate), 66new SymbolKindOrTypeKind(TypeKind.Enum), 67new SymbolKindOrTypeKind(TypeKind.Module), 68new SymbolKindOrTypeKind(TypeKind.Pointer), 75new SymbolKindOrTypeKind(TypeKind.TypeParameter), 293foreach (var typeKindElement in symbolKindListElement.Elements(nameof(TypeKind))) 344public SymbolKindOrTypeKind(TypeKind typeKind) 355public TypeKind? TypeKind => (_category == SymbolCategory.Type) ? (TypeKind)_kind : null; 362SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind, 371SymbolCategory.Type => new XElement(nameof(TypeKind), GetTypeKindString((TypeKind)_kind)), 376private static string GetTypeKindString(TypeKind typeKind) 383CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct), 433=> new((TypeKind)Enum.Parse(typeof(TypeKind), typeKindElement.Value)); 441public static implicit operator SymbolKindOrTypeKind(TypeKind symbolKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
407if (namedTypeSymbol.TypeKind == TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
22var isError = symbol.TupleUnderlyingType!.TypeKind == TypeKind.Error;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (10)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface 555TypeKind: TypeKind.Class or TypeKind.Struct
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (9)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } && 187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 226=> symbol is ITypeSymbol { TypeKind: TypeKind.Error }; 229=> symbol is ITypeSymbol { TypeKind: TypeKind.Module }; 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface }; 271=> symbol is { Kind: SymbolKind.Field, ContainingType.TypeKind: TypeKind.Enum }; 284=> symbol is { ContainingType.TypeKind: TypeKind.Module }; 308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 730if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (12)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract; 78=> symbol?.TypeKind == TypeKind.Module; 81=> symbol?.TypeKind == TypeKind.Interface; 84=> symbol?.TypeKind == TypeKind.Delegate; 87=> symbol?.TypeKind == TypeKind.FunctionPointer; 90=> symbol?.TypeKind == TypeKind.Struct; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes(); 262case TypeKind.Array: 263case TypeKind.Delegate: 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (3)
257private static TypeKind GetTypeKind(INamedTypeSymbol x) 261TypeKind.Module => TypeKind.Class,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
284var xTypeKind = GetTypeKind(x); 285var yTypeKind = GetTypeKind(y); 287if (xTypeKind == TypeKind.Error || 288yTypeKind == TypeKind.Error) 305var typeKind1 = GetTypeKind(type1); 308var typeKind2 = GetTypeKind(type2); 513if (x.TypeKind == TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (1)
37if (typeSymbol.TypeKind != TypeKind.Enum)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
152if (namedType.TypeKind != TypeKind.Enum)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (3)
418TypeKind typeKind, string name, 437bool isRecord, TypeKind typeKind, string name, 488typeKind: TypeKind.Delegate,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (2)
43public override TypeKind TypeKind => TypeKind.Array;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructedNamedTypeSymbol.cs (1)
93public override TypeKind TypeKind => _constructedFrom.TypeKind;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
29TypeKind typeKind, 63public override TypeKind TypeKind { get; } 95return this.TypeKind == TypeKind.Delegate
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPointerTypeSymbol.cs (2)
19public override TypeKind TypeKind => TypeKind.Pointer;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (2)
60public override TypeKind TypeKind => TypeKind.TypeParameter;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (3)
25public abstract TypeKind TypeKind { get; } 37public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
124member.ContainingType is { TypeKind: TypeKind.Interface } interfaceBeingImplemented)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
518if (containingType?.TypeKind == TypeKind.Struct)
ILLink.RoslynAnalyzer (12)
DataFlow\LocalDataFlowAnalysis.cs (1)
86if (Context.OwningSymbol is INamedTypeSymbol { TypeKind: TypeKind.Delegate })
ISymbolExtensions.cs (1)
193return typeSymbol.TypeKind == TypeKind.Interface;
RequiresAnalyzerBase.cs (1)
190if (typeSymbol.TypeKind != TypeKind.Class || typeSymbol.BaseType == null)
TrimAnalysis\HandleCallAction.cs (1)
166else if (staticType.IsSealed || staticType.IsTypeOf("System", "Delegate") || staticType.TypeKind == TypeKind.Array)
TrimAnalysis\SingleValueExtensions.cs (6)
21TypeKind.TypeParameter => 25TypeKind.Error => new SystemTypeValue(new TypeProxy(type)), 26TypeKind.Class or TypeKind.Enum or TypeKind.Interface or TypeKind.Struct =>
TrimAnalysis\TrimAnalysisVisitor.cs (2)
202(operation.Type?.TypeKind == TypeKind.Enum || operation.Type?.SpecialType == SpecialType.System_Int32)) 523else if (operation.Type?.TypeKind == TypeKind.Enum && constantValue is int enumConstantValue)
Microsoft.Analyzers.Extra (3)
CallAnalysis\Arrays.cs (2)
108if (keyType.TypeKind == TypeKind.Enum 112if (keyType.TypeKind == TypeKind.Enum)
CallAnalysis\CallAnalyzer.Handlers.cs (1)
42if (type.TypeKind == TypeKind.Interface)
Microsoft.Analyzers.Local (2)
ApiLifecycle\AssemblyAnalysis.cs (1)
195if (type.TypeKind != TypeKind.Delegate)
CallAnalysis\CallAnalyzer.Handlers.cs (1)
42if (type.TypeKind == TypeKind.Interface)
Microsoft.AspNetCore.App.Analyzers (5)
src\aspnetcore\src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
107if (source.TypeKind == TypeKind.Interface)
src\aspnetcore\src\Shared\Roslyn\MvcFacts.cs (1)
17if (type.TypeKind != TypeKind.Class)
src\aspnetcore\src\Shared\RoslynUtils\ParsabilityHelper.cs (1)
26if (typeSymbol.TypeKind == TypeKind.Enum)
src\aspnetcore\src\Shared\RoslynUtils\SymbolExtensions.cs (2)
311return typeSymbol.TypeKind == TypeKind.Enum; 321if (underlyingType?.TypeKind == TypeKind.Enum)
Microsoft.AspNetCore.App.SourceGenerators (1)
PublicTopLevelProgramGenerator.cs (1)
32TypeKind: TypeKind.Class,
Microsoft.AspNetCore.Mvc.Analyzers (6)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (2)
26if (typeCache.PageModelAttribute == null || typeCache.PageModelAttribute.TypeKind == TypeKind.Error) 77return type.TypeKind == TypeKind.Class &&
src\aspnetcore\src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
107if (source.TypeKind == TypeKind.Interface)
src\aspnetcore\src\Shared\Roslyn\MvcFacts.cs (1)
17if (type.TypeKind != TypeKind.Class)
TagHelpersInCodeBlocksAnalyzer.cs (1)
175return typeSymbol != null && typeSymbol.TypeKind != TypeKind.Error;
TopLevelParameterNameAnalyzer.cs (1)
301return typeSymbol != null && typeSymbol.TypeKind != TypeKind.Error;
Microsoft.AspNetCore.Mvc.Api.Analyzers (4)
ApiControllerFacts.cs (1)
18if (method.ReturnsVoid || method.ReturnType.TypeKind == TypeKind.Error)
ApiControllerSymbolCache.cs (1)
129return typeSymbol != null && typeSymbol.TypeKind != TypeKind.Error;
src\aspnetcore\src\Shared\Roslyn\CodeAnalysisExtensions.cs (1)
107if (source.TypeKind == TypeKind.Interface)
src\aspnetcore\src\Shared\Roslyn\MvcFacts.cs (1)
17if (type.TypeKind != TypeKind.Class)
Microsoft.AspNetCore.OpenApi.SourceGenerators (4)
Helpers\ISymbolExtensions.cs (1)
171return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } &&
XmlCommentGenerator.Parser.cs (1)
127symbol is not INamedTypeSymbol { TypeKind: TypeKind.Class, IsStatic: true })
XmlComments\XmlComment.InheritDoc.cs (2)
297if (typeSymbol.TypeKind == TypeKind.Class) 303else if (typeSymbol.TypeKind == TypeKind.Interface)
Microsoft.CodeAnalysis (23)
Compilation\Expression.cs (1)
41if (type.TypeKind == TypeKind.Enum)
Emit\EditAndContinue\DefinitionMap.cs (1)
660if (displayClass.TypeKind == TypeKind.Struct)
MetadataReader\MetadataDecoder.cs (7)
400Debug.Assert(!refersToNoPiaLocalType || generic.TypeKind == TypeKind.Error); 1022value = (type.IsReferenceType || type.TypeKind == TypeKind.Pointer || type.TypeKind == TypeKind.FunctionPointer) ? ConstantValue.Null : ConstantValue.Bad; 1549return (type.TypeKind == TypeKind.Enum) ? TypedConstantKind.Enum : TypedConstantKind.Primitive; 2144if (type.TypeKind == TypeKind.Error) 2149Debug.Assert(type.TypeKind == TypeKind.Array); 2155if (type.TypeKind == TypeKind.Error)
Operations\CommonConversion.cs (1)
90ContainingType: { TypeKind: TypeKind.Interface, Name: WellKnownMemberNames.UnionMembersInterfaceName, Arity: 0, ContainingType.IsUnion: true }
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (2)
142if (type.TypeKind == TypeKind.Enum) 185if (typeSymbol.TypeKind != TypeKind.Enum)
Symbols\INamedTypeSymbolInternal.cs (3)
36if (type.TypeKind == TypeKind.Enum) 75case TypeKind.Enum: 77case TypeKind.Struct:
Symbols\ITypeSymbol.cs (1)
26TypeKind TypeKind { get; }
Symbols\ITypeSymbolInternal.cs (1)
14TypeKind TypeKind { get; }
Symbols\TypedConstant.cs (4)
143if (_type!.SpecialType == specialType || (_type.TypeKind == TypeKind.Enum && specialType == SpecialType.System_Enum)) 182case TypeKind.Array: 184case TypeKind.Enum: 186case TypeKind.Error:
Symbols\TypeKind.cs (2)
102internal const TypeKind FunctionType = (TypeKind)255;
Microsoft.CodeAnalysis.Analyzers (132)
MetaAnalyzers\ClassIsNotDiagnosticAnalyzer.cs (1)
51if (namedType.TypeKind == TypeKind.Class &&
MetaAnalyzers\CompareSymbolsCorrectlyAnalyzer.cs (1)
297operation.Type.TypeKind == TypeKind.Class &&
MetaAnalyzers\DiagnosticAnalyzerAPIUsageAnalyzer.cs (1)
262usedType.TypeKind != TypeKind.Error)
MetaAnalyzers\RegisterActionAnalyzer.cs (2)
401typeArgument.TypeKind != TypeKind.TypeParameter && 402typeArgument.TypeKind != TypeKind.Error &&
src\roslyn\src\RoslynAnalyzers\Microsoft.CodeAnalysis.BannedApiAnalyzers\Core\SymbolIsBannedAnalyzerBase.cs (2)
391if (typeArgument.TypeKind != TypeKind.TypeParameter && 392typeArgument.TypeKind != TypeKind.Error &&
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (5)
134case TypeKind.Class: 135case TypeKind.Interface: 146case TypeKind.Struct: 147case TypeKind.Enum: 148case TypeKind.Delegate:
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
520=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
113if (type1.TypeKind == TypeKind.TypeParameter && 114type2.TypeKind == TypeKind.TypeParameter &&
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (5)
48case TypeKind.Class: 49if (type.TypeKind == TypeKind.Interface) 56case TypeKind.Interface: 71if (!baseTypesOnly && candidateBaseType.TypeKind == TypeKind.Interface) 86if (checkTypeParameterConstraints && symbol.TypeKind == TypeKind.TypeParameter)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
412namedType.TypeKind != TypeKind.Interface ||
src\roslyn\src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (6)
42if (containingType.TypeKind == TypeKind.Class) 143if (containingType.TypeKind == TypeKind.Class) 195if (containingType.TypeKind == TypeKind.Class) 242if (containingType.TypeKind == TypeKind.Class) 290if (containingType.TypeKind == TypeKind.Class) 355if (containingType.TypeKind == TypeKind.Class)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\CollectionExpressionUtilities.cs (1)
112if (!(namedType.TypeKind == TypeKind.Struct && noArgConstructor.IsImplicitlyDeclared))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
147if (type.TypeKind == TypeKind.Array && typeArguments.IsEmpty)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (13)
104private static readonly SymbolKindOrTypeKind s_class = new(TypeKind.Class); 105private static readonly SymbolKindOrTypeKind s_struct = new(TypeKind.Struct); 106private static readonly SymbolKindOrTypeKind s_interface = new(TypeKind.Interface); 107private static readonly SymbolKindOrTypeKind s_enum = new(TypeKind.Enum); 113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 329case TypeKind.Class: 332case TypeKind.Struct: 335case TypeKind.Interface: 338case TypeKind.Enum: 341case TypeKind.Delegate: 344case TypeKind.Module: 347case TypeKind.Pointer: 350case TypeKind.TypeParameter:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
66if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (20)
62new SymbolKindOrTypeKind(TypeKind.Class), 63new SymbolKindOrTypeKind(TypeKind.Struct), 64new SymbolKindOrTypeKind(TypeKind.Interface), 65new SymbolKindOrTypeKind(TypeKind.Delegate), 66new SymbolKindOrTypeKind(TypeKind.Enum), 67new SymbolKindOrTypeKind(TypeKind.Module), 68new SymbolKindOrTypeKind(TypeKind.Pointer), 75new SymbolKindOrTypeKind(TypeKind.TypeParameter), 293foreach (var typeKindElement in symbolKindListElement.Elements(nameof(TypeKind))) 344public SymbolKindOrTypeKind(TypeKind typeKind) 355public TypeKind? TypeKind => (_category == SymbolCategory.Type) ? (TypeKind)_kind : null; 362SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind, 371SymbolCategory.Type => new XElement(nameof(TypeKind), GetTypeKindString((TypeKind)_kind)), 376private static string GetTypeKindString(TypeKind typeKind) 383CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct), 433=> new((TypeKind)Enum.Parse(typeof(TypeKind), typeKindElement.Value)); 441public static implicit operator SymbolKindOrTypeKind(TypeKind symbolKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
407if (namedTypeSymbol.TypeKind == TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
22var isError = symbol.TupleUnderlyingType!.TypeKind == TypeKind.Error;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (10)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface 555TypeKind: TypeKind.Class or TypeKind.Struct
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (9)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } && 187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 226=> symbol is ITypeSymbol { TypeKind: TypeKind.Error }; 229=> symbol is ITypeSymbol { TypeKind: TypeKind.Module }; 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface }; 271=> symbol is { Kind: SymbolKind.Field, ContainingType.TypeKind: TypeKind.Enum }; 284=> symbol is { ContainingType.TypeKind: TypeKind.Module }; 308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 730if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (12)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract; 78=> symbol?.TypeKind == TypeKind.Module; 81=> symbol?.TypeKind == TypeKind.Interface; 84=> symbol?.TypeKind == TypeKind.Delegate; 87=> symbol?.TypeKind == TypeKind.FunctionPointer; 90=> symbol?.TypeKind == TypeKind.Struct; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes(); 262case TypeKind.Array: 263case TypeKind.Delegate: 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (3)
257private static TypeKind GetTypeKind(INamedTypeSymbol x) 261TypeKind.Module => TypeKind.Class,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
284var xTypeKind = GetTypeKind(x); 285var yTypeKind = GetTypeKind(y); 287if (xTypeKind == TypeKind.Error || 288yTypeKind == TypeKind.Error) 305var typeKind1 = GetTypeKind(type1); 308var typeKind2 = GetTypeKind(type2); 513if (x.TypeKind == TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (1)
37if (typeSymbol.TypeKind != TypeKind.Enum)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
152if (namedType.TypeKind != TypeKind.Enum)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (3)
418TypeKind typeKind, string name, 437bool isRecord, TypeKind typeKind, string name, 488typeKind: TypeKind.Delegate,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (2)
43public override TypeKind TypeKind => TypeKind.Array;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructedNamedTypeSymbol.cs (1)
93public override TypeKind TypeKind => _constructedFrom.TypeKind;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
29TypeKind typeKind, 63public override TypeKind TypeKind { get; } 95return this.TypeKind == TypeKind.Delegate
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPointerTypeSymbol.cs (2)
19public override TypeKind TypeKind => TypeKind.Pointer;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (2)
60public override TypeKind TypeKind => TypeKind.TypeParameter;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (3)
25public abstract TypeKind TypeKind { get; } 37public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
124member.ContainingType is { TypeKind: TypeKind.Interface } interfaceBeingImplemented)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
518if (containingType?.TypeKind == TypeKind.Struct)
Microsoft.CodeAnalysis.AnalyzerUtilities (105)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (5)
134case TypeKind.Class: 135case TypeKind.Interface: 146case TypeKind.Struct: 147case TypeKind.Enum: 148case TypeKind.Delegate:
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
520=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
113if (type1.TypeKind == TypeKind.TypeParameter && 114type2.TypeKind == TypeKind.TypeParameter &&
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (5)
48case TypeKind.Class: 49if (type.TypeKind == TypeKind.Interface) 56case TypeKind.Interface: 71if (!baseTypesOnly && candidateBaseType.TypeKind == TypeKind.Interface) 86if (checkTypeParameterConstraints && symbol.TypeKind == TypeKind.TypeParameter)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
412namedType.TypeKind != TypeKind.Interface ||
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (1)
37Debug.Assert(CollectionNamedTypes.All(ct => ct.TypeKind == TypeKind.Interface));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataSymbolMap.cs (1)
124if (namedTypeSymbol.TypeKind == TypeKind.Interface
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (4)
1349static bool IsInterfaceOrTypeParameter(ITypeSymbol? type) => type?.TypeKind is TypeKind.Interface or TypeKind.TypeParameter; 2404if (argument.Parameter?.Type.TypeKind == TypeKind.Delegate || 2411if (argument.Parameter.Type.TypeKind == TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\CollectionExpressionUtilities.cs (1)
112if (!(namedType.TypeKind == TypeKind.Struct && noArgConstructor.IsImplicitlyDeclared))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
147if (type.TypeKind == TypeKind.Array && typeArguments.IsEmpty)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (13)
104private static readonly SymbolKindOrTypeKind s_class = new(TypeKind.Class); 105private static readonly SymbolKindOrTypeKind s_struct = new(TypeKind.Struct); 106private static readonly SymbolKindOrTypeKind s_interface = new(TypeKind.Interface); 107private static readonly SymbolKindOrTypeKind s_enum = new(TypeKind.Enum); 113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 329case TypeKind.Class: 332case TypeKind.Struct: 335case TypeKind.Interface: 338case TypeKind.Enum: 341case TypeKind.Delegate: 344case TypeKind.Module: 347case TypeKind.Pointer: 350case TypeKind.TypeParameter:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
66if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (20)
62new SymbolKindOrTypeKind(TypeKind.Class), 63new SymbolKindOrTypeKind(TypeKind.Struct), 64new SymbolKindOrTypeKind(TypeKind.Interface), 65new SymbolKindOrTypeKind(TypeKind.Delegate), 66new SymbolKindOrTypeKind(TypeKind.Enum), 67new SymbolKindOrTypeKind(TypeKind.Module), 68new SymbolKindOrTypeKind(TypeKind.Pointer), 75new SymbolKindOrTypeKind(TypeKind.TypeParameter), 293foreach (var typeKindElement in symbolKindListElement.Elements(nameof(TypeKind))) 344public SymbolKindOrTypeKind(TypeKind typeKind) 355public TypeKind? TypeKind => (_category == SymbolCategory.Type) ? (TypeKind)_kind : null; 362SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind, 371SymbolCategory.Type => new XElement(nameof(TypeKind), GetTypeKindString((TypeKind)_kind)), 376private static string GetTypeKindString(TypeKind typeKind) 383CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct), 433=> new((TypeKind)Enum.Parse(typeof(TypeKind), typeKindElement.Value)); 441public static implicit operator SymbolKindOrTypeKind(TypeKind symbolKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
407if (namedTypeSymbol.TypeKind == TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
22var isError = symbol.TupleUnderlyingType!.TypeKind == TypeKind.Error;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (10)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface 555TypeKind: TypeKind.Class or TypeKind.Struct
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (9)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } && 187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 226=> symbol is ITypeSymbol { TypeKind: TypeKind.Error }; 229=> symbol is ITypeSymbol { TypeKind: TypeKind.Module }; 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface }; 271=> symbol is { Kind: SymbolKind.Field, ContainingType.TypeKind: TypeKind.Enum }; 284=> symbol is { ContainingType.TypeKind: TypeKind.Module }; 308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 730if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (12)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract; 78=> symbol?.TypeKind == TypeKind.Module; 81=> symbol?.TypeKind == TypeKind.Interface; 84=> symbol?.TypeKind == TypeKind.Delegate; 87=> symbol?.TypeKind == TypeKind.FunctionPointer; 90=> symbol?.TypeKind == TypeKind.Struct; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes(); 262case TypeKind.Array: 263case TypeKind.Delegate: 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (3)
257private static TypeKind GetTypeKind(INamedTypeSymbol x) 261TypeKind.Module => TypeKind.Class,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
284var xTypeKind = GetTypeKind(x); 285var yTypeKind = GetTypeKind(y); 287if (xTypeKind == TypeKind.Error || 288yTypeKind == TypeKind.Error) 305var typeKind1 = GetTypeKind(type1); 308var typeKind2 = GetTypeKind(type2); 513if (x.TypeKind == TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
Microsoft.CodeAnalysis.CodeStyle (93)
src\roslyn\src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (2)
90if (typeWithoutNullable.TypeKind == TypeKind.Enum) 122if (type.RemoveNullableIfPresent()?.TypeKind != TypeKind.Enum)
src\roslyn\src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchExpressionHelpers.cs (1)
27if (switchExpressionType?.TypeKind == TypeKind.Enum)
src\roslyn\src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchStatementHelpers.cs (1)
68if (switchExpressionType?.TypeKind == TypeKind.Enum)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
183if (value.Type.TypeKind == TypeKind.Dynamic)
src\roslyn\src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (3)
177if (namedType.TypeKind is not TypeKind.Class and not TypeKind.Struct and not TypeKind.Module)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\CollectionExpressionUtilities.cs (1)
112if (!(namedType.TypeKind == TypeKind.Struct && noArgConstructor.IsImplicitlyDeclared))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
147if (type.TypeKind == TypeKind.Array && typeArguments.IsEmpty)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (13)
104private static readonly SymbolKindOrTypeKind s_class = new(TypeKind.Class); 105private static readonly SymbolKindOrTypeKind s_struct = new(TypeKind.Struct); 106private static readonly SymbolKindOrTypeKind s_interface = new(TypeKind.Interface); 107private static readonly SymbolKindOrTypeKind s_enum = new(TypeKind.Enum); 113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 329case TypeKind.Class: 332case TypeKind.Struct: 335case TypeKind.Interface: 338case TypeKind.Enum: 341case TypeKind.Delegate: 344case TypeKind.Module: 347case TypeKind.Pointer: 350case TypeKind.TypeParameter:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
66if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (20)
62new SymbolKindOrTypeKind(TypeKind.Class), 63new SymbolKindOrTypeKind(TypeKind.Struct), 64new SymbolKindOrTypeKind(TypeKind.Interface), 65new SymbolKindOrTypeKind(TypeKind.Delegate), 66new SymbolKindOrTypeKind(TypeKind.Enum), 67new SymbolKindOrTypeKind(TypeKind.Module), 68new SymbolKindOrTypeKind(TypeKind.Pointer), 75new SymbolKindOrTypeKind(TypeKind.TypeParameter), 293foreach (var typeKindElement in symbolKindListElement.Elements(nameof(TypeKind))) 344public SymbolKindOrTypeKind(TypeKind typeKind) 355public TypeKind? TypeKind => (_category == SymbolCategory.Type) ? (TypeKind)_kind : null; 362SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind, 371SymbolCategory.Type => new XElement(nameof(TypeKind), GetTypeKindString((TypeKind)_kind)), 376private static string GetTypeKindString(TypeKind typeKind) 383CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct), 433=> new((TypeKind)Enum.Parse(typeof(TypeKind), typeKindElement.Value)); 441public static implicit operator SymbolKindOrTypeKind(TypeKind symbolKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
407if (namedTypeSymbol.TypeKind == TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
22var isError = symbol.TupleUnderlyingType!.TypeKind == TypeKind.Error;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (10)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface 555TypeKind: TypeKind.Class or TypeKind.Struct
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (9)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } && 187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 226=> symbol is ITypeSymbol { TypeKind: TypeKind.Error }; 229=> symbol is ITypeSymbol { TypeKind: TypeKind.Module }; 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface }; 271=> symbol is { Kind: SymbolKind.Field, ContainingType.TypeKind: TypeKind.Enum }; 284=> symbol is { ContainingType.TypeKind: TypeKind.Module }; 308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 730if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (12)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract; 78=> symbol?.TypeKind == TypeKind.Module; 81=> symbol?.TypeKind == TypeKind.Interface; 84=> symbol?.TypeKind == TypeKind.Delegate; 87=> symbol?.TypeKind == TypeKind.FunctionPointer; 90=> symbol?.TypeKind == TypeKind.Struct; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes(); 262case TypeKind.Array: 263case TypeKind.Delegate: 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (3)
257private static TypeKind GetTypeKind(INamedTypeSymbol x) 261TypeKind.Module => TypeKind.Class,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
284var xTypeKind = GetTypeKind(x); 285var yTypeKind = GetTypeKind(y); 287if (xTypeKind == TypeKind.Error || 288yTypeKind == TypeKind.Error) 305var typeKind1 = GetTypeKind(type1); 308var typeKind2 = GetTypeKind(type2); 513if (x.TypeKind == TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
Microsoft.CodeAnalysis.CodeStyle.Fixes (60)
src\roslyn\src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (1)
50if (symbol.ContainingType?.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (4)
403return TypeToGenerateIn?.TypeKind is (TypeKind?)TypeKind.Class or (TypeKind?)TypeKind.Struct;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.State.cs (2)
58baseType.TypeKind == TypeKind.Error) 108if (classType.TypeKind == TypeKind.Struct)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (11)
19protected static readonly ISet<TypeKind> EnumType = new HashSet<TypeKind> { TypeKind.Enum }; 20protected static readonly ISet<TypeKind> ClassInterfaceModuleStructTypes = new HashSet<TypeKind> 22TypeKind.Class, 23TypeKind.Module, 24TypeKind.Struct, 25TypeKind.Interface 31ISet<TypeKind> typeKinds) 42if (typeToGenerateIn.TypeKind == TypeKind.Interface && isStatic)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.cs (2)
24protected abstract bool TryInitializeImplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, [NotNullWhen(true)] out IMethodSymbol? methodSymbol, [NotNullWhen(true)] out INamedTypeSymbol? typeToGenerateIn); 25protected abstract bool TryInitializeExplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, [NotNullWhen(true)] out IMethodSymbol? methodSymbol, [NotNullWhen(true)] out INamedTypeSymbol? typeToGenerateIn);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (2)
59var classTypes = constraints.Where(ts => ts.TypeKind == TypeKind.Class).ToList(); 60var nonClassTypes = constraints.Where(ts => ts.TypeKind != TypeKind.Class).ToList();
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (2)
76generateMethodBodies: _state.TypeToGenerateIn.TypeKind != TypeKind.Interface)), 92generateMethodBodies: _state.TypeToGenerateIn.TypeKind != TypeKind.Interface,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
47state.TypeToGenerateIn.TypeKind != TypeKind.Interface &&
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (2)
193return isAbstract || State.TypeToGenerateIn.TypeKind == TypeKind.Interface || throwStatement == null 225if (State.TypeToGenerateIn.TypeKind != TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (1)
73generateMethodBodies: TypeToGenerateIn.TypeKind != TypeKind.Interface,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (2)
118return _state.TypeToGenerateIn.TypeKind != TypeKind.Interface && _refKind != RefKind.None 125if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (3)
98if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface && state.IsStatic) 108var isOnlyReadAndIsInInterface = state.TypeToGenerateIn.TypeKind == TypeKind.Interface && !state.IsWrittenTo; 142if (state.TypeToGenerateIn.TypeKind != TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
86if (this.TypeToGenerateIn.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (2)
226if (state.ClassOrStructType.TypeKind != TypeKind.Class) 249if (idisposable?.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
272var condition1 = typeParameter.ConstraintTypes.Count(t => t.TypeKind == TypeKind.Class) >= 2;
src\roslyn\src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
40type.TypeKind == TypeKind.Class && type.IsSealed && !type.IsStatic)
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (2)
195conversion.Type.TypeKind != TypeKind.Error) 199if (conversion.Operand.Type == null || conversion.Operand.Type.TypeKind != TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (1)
37if (typeSymbol.TypeKind != TypeKind.Enum)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
152if (namedType.TypeKind != TypeKind.Enum)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (3)
418TypeKind typeKind, string name, 437bool isRecord, TypeKind typeKind, string name, 488typeKind: TypeKind.Delegate,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (2)
43public override TypeKind TypeKind => TypeKind.Array;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructedNamedTypeSymbol.cs (1)
93public override TypeKind TypeKind => _constructedFrom.TypeKind;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
29TypeKind typeKind, 63public override TypeKind TypeKind { get; } 95return this.TypeKind == TypeKind.Delegate
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPointerTypeSymbol.cs (2)
19public override TypeKind TypeKind => TypeKind.Pointer;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (2)
60public override TypeKind TypeKind => TypeKind.TypeParameter;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (3)
25public abstract TypeKind TypeKind { get; } 37public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
124member.ContainingType is { TypeKind: TypeKind.Interface } interfaceBeingImplemented)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
518if (containingType?.TypeKind == TypeKind.Struct)
Microsoft.CodeAnalysis.CSharp (784)
Binder\Binder_Attributes.cs (2)
58if (boundTypeSymbol.TypeKind != TypeKind.Error) 736parameter.Type.TypeKind == TypeKind.Array &&
Binder\Binder_Constraints.cs (14)
505type.TypeKind == TypeKind.Class) 585case TypeKind.Error: 586case TypeKind.TypeParameter: 589case TypeKind.Interface: 592case TypeKind.Dynamic: 597case TypeKind.Class: 600goto case TypeKind.Struct; 610case TypeKind.Delegate: 611case TypeKind.Enum: 612case TypeKind.Struct: 617case TypeKind.Array: 618case TypeKind.Pointer: 619case TypeKind.FunctionPointer: 624case TypeKind.Submission:
Binder\Binder_Conversions.cs (26)
858case TypeKind.Enum: 859case TypeKind.Struct: 860case TypeKind.Class when !type.IsAnonymousType: // We don't want to enable object creation with unspeakable types 862case TypeKind.TypeParameter: 864case TypeKind.Delegate: 866case TypeKind.Interface: 868case TypeKind.Array: 869case TypeKind.Class: 870case TypeKind.Dynamic: 872goto case TypeKind.Error; 873case TypeKind.Pointer: 874case TypeKind.FunctionPointer: 876goto case TypeKind.Error; 877case TypeKind.Error: 3526Debug.Assert(delegateType is NamedTypeSymbol { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: { HasUseSiteError: false } } 3527|| delegateType.TypeKind == TypeKind.FunctionPointer, 3643static bool hasConversion(TypeKind targetKind, Conversions conversions, TypeSymbol source, TypeSymbol destination, 3664return targetKind == TypeKind.FunctionPointer 3669static ErrorCode getMethodMismatchErrorCode(TypeKind type) 3672TypeKind.Delegate => ErrorCode.ERR_MethDelegateMismatch, 3673TypeKind.FunctionPointer => ErrorCode.ERR_MethFuncPtrMismatch, 3677static ErrorCode getRefMismatchErrorCode(TypeKind type) 3680TypeKind.Delegate => ErrorCode.ERR_DelegateRefMismatch, 3681TypeKind.FunctionPointer => ErrorCode.ERR_FuncPtrRefMismatch, 3717Debug.Assert(Conversions.IsAssignableFromMulticastDelegate(delegateOrFuncPtrType, ref discardedUseSiteInfo) || delegateOrFuncPtrType.TypeKind == TypeKind.Delegate || delegateOrFuncPtrType.TypeKind == TypeKind.FunctionPointer);
Binder\Binder_Crefs.cs (12)
755case TypeKind.Array: 757case TypeKind.Pointer: 759case TypeKind.FunctionPointer: 775case TypeKind.Delegate: 776case TypeKind.Class: 777case TypeKind.Interface: 778case TypeKind.Struct: 779case TypeKind.Enum: 780case TypeKind.Error: 796case TypeKind.Dynamic: 797case TypeKind.TypeParameter: 1195Debug.Assert(type.TypeKind != TypeKind.Error || typeSyntax.ContainsDiagnostics || !typeSyntax.SyntaxTree.ReportDocumentationCommentDiagnostics(), "Why wasn't there a diagnostic?");
Binder\Binder_Expressions.cs (39)
2444if (this.ContainingType.TypeKind == TypeKind.Submission 2448if (memberDeclaringType.TypeKind == TypeKind.Submission) 2899if (targetType.TypeKind != TypeKind.Delegate || 2952TypeKind.FunctionPointer => ErrorCode.ERR_MethFuncPtrMismatch, 2953TypeKind.Delegate => ErrorCode.ERR_CannotConvertAddressOfToDelegate, 4919if ((containingType.TypeKind == TypeKind.Enum || containingType.TypeKind == TypeKind.Struct) && initializerArgumentListOpt == null) 4970else if (initializerArgumentListOpt != null && containingType.TypeKind == TypeKind.Struct) 5296case TypeKind.Struct: 5297case TypeKind.Class: 5298case TypeKind.Enum: 5299case TypeKind.Error: 5302case TypeKind.Delegate: 5305case TypeKind.Interface: 5308case TypeKind.TypeParameter: 5311case TypeKind.Pointer: 5312case TypeKind.FunctionPointer: 5315goto case TypeKind.Class; 5317case TypeKind.Submission: 5319case TypeKind.Dynamic: 5321case TypeKind.Array: 5325goto case TypeKind.Class; 5462if (arg.Type is { TypeKind: TypeKind.Dynamic }) 5623else if (argument.Type.TypeKind == TypeKind.Delegate) 5723Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 7116Debug.Assert(coClassType.TypeKind == TypeKind.Class || coClassType.TypeKind == TypeKind.Error); 7497if (type.TypeKind == TypeKind.Enum) 8114if (leftType.TypeKind == TypeKind.TypeParameter) 9337if (receiverOpt is not BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } }) 9935case TypeKind.Array: 9938case TypeKind.Dynamic: 9941case TypeKind.Pointer: 9944case TypeKind.Class: 9945case TypeKind.Struct: 9946case TypeKind.Interface: 9947case TypeKind.TypeParameter: 9950case TypeKind.Submission: // script class is synthesized and should not be used as a type of an indexer expression:
Binder\Binder_InterpolatedString.cs (2)
397if (value.Type?.TypeKind == TypeKind.Dynamic) 433&& unconvertedInterpolatedString.Parts.All(p => p is not BoundStringInsert { Value.Type.TypeKind: TypeKind.Dynamic });
Binder\Binder_Lookup.cs (24)
228case TypeKind.TypeParameter: 232case TypeKind.Interface: 236case TypeKind.Class: 237case TypeKind.Struct: 238case TypeKind.Enum: 239case TypeKind.Delegate: 240case TypeKind.Array: 241case TypeKind.Dynamic: 242case TypeKind.Submission: 246case TypeKind.Error: 250case TypeKind.Pointer: 251case TypeKind.FunctionPointer: 252case TypeKind.Extension: 256case TypeKind.Unknown: 852Debug.Assert(!type.IsInterfaceType() && type.TypeKind != TypeKind.TypeParameter); 1917case TypeKind.TypeParameter: 1921case TypeKind.Interface: 1925case TypeKind.Class: 1926case TypeKind.Struct: 1927case TypeKind.Enum: 1928case TypeKind.Delegate: 1929case TypeKind.Array: 1930case TypeKind.Dynamic: 1931case TypeKind.Submission:
Binder\Binder_Operators.cs (15)
1041leftType?.TypeKind == TypeKind.FunctionPointer && rightType?.TypeKind == TypeKind.FunctionPointer) 1309(object?)left.Type != null && left.Type.TypeKind == TypeKind.Delegate) 4839return targetType.TypeKind == TypeKind.Error; 4948var targetTypeKind = targetType.TypeKind; 4991if (targetTypeKind == TypeKind.Dynamic) 5001if (inputType.TypeKind == TypeKind.Dynamic) 5375var targetTypeKind = targetType.TypeKind; 5408if (operand.HasAnyErrors || targetTypeKind == TypeKind.Error) 5424if (targetTypeKind == TypeKind.TypeParameter) 5428else if (targetTypeKind == TypeKind.Pointer || targetTypeKind == TypeKind.FunctionPointer) 5479var operandTypeKind = operandType.TypeKind; 5489if (operandTypeKind == TypeKind.Dynamic) 5496if (targetTypeKind == TypeKind.Dynamic)
Binder\Binder_Patterns.cs (2)
1864if (iTupleType.TypeKind != TypeKind.Interface) 2413if (unionMatchingInputType is not null && (unionMatchingInputType.TypeKind != TypeKind.Struct || unionMatchingInputType.IsNullableType()))
Binder\Binder_Query.cs (1)
968if (ultimateReceiver.Type.TypeKind == TypeKind.TypeParameter)
Binder\Binder_QueryErrors.cs (1)
82if (instanceType.TypeKind == TypeKind.Array || name == "Cast" && HasCastToQueryProvider(instanceType, ref useSiteInfo))
Binder\Binder_Statements.cs (6)
2355if (targetType.TypeKind == TypeKind.Error) 2415if (targetType.TypeKind == TypeKind.TypeParameter) 2514case TypeKind.FunctionPointer when fromAddressOf: 2517case TypeKind.FunctionPointer: 2520case TypeKind.Delegate when fromAddressOf: 2523case TypeKind.Delegate:
Binder\ForEachLoopBinder.cs (7)
1650case TypeKind.Class: 1651case TypeKind.Struct: 1652case TypeKind.Interface: 1653case TypeKind.TypeParameter: // Not specifically mentioned in the spec, but consistent with Dev10. 1654case TypeKind.Dynamic: // Not specifically mentioned in the spec, but consistent with Dev10. 1657case TypeKind.Submission: 1844if (type.TypeKind == TypeKind.TypeParameter)
Binder\PatternExplainer.cs (1)
788if (type is NamedTypeSymbol { TypeKind: TypeKind.Enum } e)
Binder\Semantics\AccessCheck.cs (3)
368if (containingType.TypeKind == TypeKind.Submission) 430if (originalContainingType.TypeKind == TypeKind.Submission) 700: containingType.TypeKind == TypeKind.Struct ? ErrorCode.ERR_ProtectedInStruct
Binder\Semantics\Conversions\Conversions.cs (1)
537if (spanType.TypeKind == TypeKind.Struct && spanType.IsRefLikeType)
Binder\Semantics\Conversions\ConversionsBase.cs (7)
2195if (otherType.TypeKind == TypeKind.Enum) 2672case TypeKind.Class: 2681case TypeKind.Interface: 2686case TypeKind.Delegate: 2691case TypeKind.TypeParameter: 2694case TypeKind.Array: 3330if ((source.TypeKind == TypeKind.TypeParameter) &&
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (1)
266if (op.ReturnsVoid || op.ParameterCount != 1 || op.ReturnType.TypeKind == TypeKind.Error)
Binder\Semantics\Operators\OperatorFacts.cs (4)
21case TypeKind.Struct: 22case TypeKind.Class: 23case TypeKind.TypeParameter: 24case TypeKind.Interface:
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (15)
506if (type.TypeKind != TypeKind.TypeParameter) return false; 1890if (source.TypeKind == TypeKind.Pointer && target.TypeKind == TypeKind.Pointer) 2263if (target.TypeKind != TypeKind.Class) 2282if (source.TypeKind == TypeKind.Class) 2286else if (source.TypeKind == TypeKind.TypeParameter) 2324case TypeKind.Struct: 2325case TypeKind.Class: 2326case TypeKind.Interface: 2330case TypeKind.TypeParameter: 2660if (source.TypeKind != TypeKind.Class || target.TypeKind != TypeKind.Class) 2701case TypeKind.Struct: 2702case TypeKind.Class: 2703case TypeKind.Interface:
Binder\Semantics\OverloadResolution\OverloadResolution.cs (3)
2505if (m1.Member.ContainingType.TypeKind == TypeKind.Submission && m2.Member.ContainingType.TypeKind == TypeKind.Submission) 2825if (t1.TypeKind == TypeKind.Pointer)
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (2)
1261else if (argument.Kind == BoundKind.MethodGroup && parameterType.TypeKind == TypeKind.Delegate && 1266else if (argument.Kind == BoundKind.MethodGroup && parameterType.TypeKind == TypeKind.FunctionPointer)
BoundTree\BoundDagTest.cs (1)
113var typeName = b.Type.TypeKind == TypeKind.Error ? "<error type>" : b.Type.ToString();
CodeGen\EmitAddress.cs (3)
420Debug.Assert(arrayAccess.Type.TypeKind == TypeKind.TypeParameter, "constrained call should only be used with type parameter types"); 530Debug.Assert(receiverType.TypeKind == TypeKind.TypeParameter || receiverType.IsValueType); 537return receiverType.TypeKind == TypeKind.TypeParameter && addressKind != AddressKind.Constrained;
CodeGen\EmitConversion.cs (1)
362if (receiver is not BoundTypeExpression { Type: { TypeKind: TypeKind.TypeParameter } })
CodeGen\EmitExpression.cs (7)
443(receiverType.IsReferenceType && receiverType.TypeKind == TypeKind.TypeParameter) || 820Debug.Assert(thisType.TypeKind != TypeKind.TypeParameter); 1097if (elementType.TypeKind == TypeKind.TypeParameter) 2691if (left.Kind == BoundKind.ArrayAccess && left.Type.TypeKind == TypeKind.TypeParameter && !left.Type.IsValueType) 3528if (type is { TypeKind: TypeKind.TypeParameter } && constantValue.IsNull) 4150Debug.Assert(load.Type is { TypeKind: TypeKind.FunctionPointer }); 4156if (load.ConstrainedToTypeOpt is not { TypeKind: TypeKind.TypeParameter })
CodeGen\EmitStackAllocInitializer.cs (1)
27var elementType = (type.TypeKind == TypeKind.Pointer
CodeGen\EmitStatement.cs (1)
180if (exprType?.TypeKind == TypeKind.TypeParameter)
Compilation\CSharpCompilation.cs (9)
2032if (mainType is null || mainType.IsGenericType || (mainType.TypeKind != TypeKind.Class && mainType.TypeKind != TypeKind.Struct && !mainType.IsInterface)) 2350if (firstType.TypeKind != TypeKind.Array) 4467if (csharpReturnType.TypeKind is TypeKind.Dynamic || 4468csharpLeftType.TypeKind is TypeKind.Dynamic || 4469csharpRightType.TypeKind is TypeKind.Dynamic) 4511if (csharpLeftType.TypeKind is TypeKind.Delegate && 4693if (csharpReturnType.TypeKind is TypeKind.Dynamic || 4694csharpOperandType.TypeKind is TypeKind.Dynamic)
Compilation\CSharpSemanticModel.cs (3)
550if (varTypeInfo.Type is { TypeKind: not TypeKind.Error }) 992if (varTypeInfo.Type is { TypeKind: not TypeKind.Error }) 2253else if (boundExpr is BoundConversion { ConversionKind: ConversionKind.MethodGroup, Conversion: var exprConversion, Type: { TypeKind: TypeKind.FunctionPointer }, SymbolOpt: var symbol })
Compiler\ClsComplianceChecker.cs (22)
254if (symbol.TypeKind == TypeKind.Delegate) 285if (paramType.TypeKind == TypeKind.Array || 474if (type.TypeKind == TypeKind.Delegate) 605if (argument.TypeInternal.TypeKind == TypeKind.Array) 621if (argument.TypeInternal.TypeKind == TypeKind.Array) 639if (type.TypeKind == TypeKind.Array) 738System.Diagnostics.Debug.Assert(method.ContainingType.TypeKind == TypeKind.Delegate); 985case TypeKind.Array: 987case TypeKind.Dynamic: 992case TypeKind.Pointer: 993case TypeKind.FunctionPointer: 995case TypeKind.Error: 996case TypeKind.TypeParameter: 1000case TypeKind.Class: 1001case TypeKind.Struct: 1002case TypeKind.Interface: 1003case TypeKind.Delegate: 1004case TypeKind.Enum: 1005case TypeKind.Submission: 1032if (type.TypeKind == TypeKind.Error) 1372TypeKind typeKind = xType.TypeKind; 1378if (typeKind == TypeKind.Array)
Compiler\MethodCompiler.cs (3)
643containingType is { IsImplicitlyDeclared: false, TypeKind: TypeKind.Class or TypeKind.Struct or TypeKind.Interface } &&
Emitter\Model\MethodSymbolAdapter.cs (1)
635return this.IsExtern || (object)ContainingType != null && ContainingType.TypeKind == TypeKind.Delegate;
Emitter\Model\NamedTypeSymbolAdapter.cs (3)
45get { return AdaptedNamedTypeSymbol.TypeKind == TypeKind.Enum; } 523case TypeKind.Enum: 524case TypeKind.Delegate:
Emitter\NoPia\EmbeddedType.cs (3)
158case TypeKind.Enum: 159case TypeKind.Delegate: 161case TypeKind.Interface:
Emitter\NoPia\EmbeddedTypesManager.cs (16)
321case TypeKind.Interface: 344goto case TypeKind.Struct; 345case TypeKind.Struct: 346case TypeKind.Delegate: 347case TypeKind.Enum: 453Debug.Assert(namedType.TypeKind == TypeKind.Struct || namedType.TypeKind == TypeKind.Enum || namedType.TypeKind == TypeKind.Delegate); 456if (namedType.TypeKind == TypeKind.Struct || namedType.TypeKind == TypeKind.Enum) 506var containerKind = field.AdaptedFieldSymbol.ContainingType.TypeKind; 509if (containerKind == TypeKind.Interface || containerKind == TypeKind.Delegate || 510(containerKind == TypeKind.Struct && (field.AdaptedFieldSymbol.IsStatic || field.AdaptedFieldSymbol.DeclaredAccessibility != Accessibility.Public))) 545case TypeKind.Struct: 546case TypeKind.Enum:
FlowAnalysis\AbstractFlowPass.cs (2)
949InputType: NamedTypeSymbol { TypeKind: TypeKind.Struct, IsUnionType: true } inputType, 2292fieldSymbol.ContainingType.TypeKind == TypeKind.Struct &&
FlowAnalysis\DefiniteAssignment.cs (8)
103&& CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }; 1006variableBySlot[slot].Symbol.GetTypeOrReturnType().TypeKind == TypeKind.Struct; 1084(_trackClassFields || type.TypeKind == TypeKind.Struct); 1211Debug.Assert(CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }); 1264if (CurrentSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }) 2593case TypeKind.Array: 2597case TypeKind.Class: 2598case TypeKind.Struct:
FlowAnalysis\EmptyStructTypeCache.cs (4)
235case TypeKind.Enum: 236case TypeKind.Struct: 237case TypeKind.TypeParameter: 239case TypeKind.Array:
FlowAnalysis\NullableWalker.cs (7)
2515return valueType.Type?.TypeKind == TypeKind.TypeParameter && 2707targetType.TypeKind == TypeKind.TypeParameter || 2796fieldOrPropertyType.TypeKind == TypeKind.TypeParameter || 4969if (type.TypeKind != TypeKind.Struct) 6121{ TypeKind: TypeKind.Interface } => type.AllInterfacesNoUseSiteDiagnostics, 9889NamedTypeSymbol { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: { Parameters: { } parameters } signature } => (signature, parameters), 10875case BoundExpression arg when arg.Type is { TypeKind: TypeKind.Delegate }:
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (2)
582LocalSymbol thisTemp = (F.CurrentType.TypeKind == TypeKind.Class) ? F.SynthesizedLocal(F.CurrentType) : null; 643LocalSymbol thisTemp = (F.CurrentType.TypeKind == TypeKind.Class) ? F.SynthesizedLocal(F.CurrentType) : null;
Lowering\AsyncRewriter\AsyncRewriter.cs (6)
74var typeKind = (compilationState.Compilation.Options.EnableEditAndContinue || method.IsIterator) ? TypeKind.Class : TypeKind.Struct; 172if (F.CurrentType.TypeKind == TypeKind.Class) 195if (stateMachineType.TypeKind == TypeKind.Class) 204if (frameType.TypeKind == TypeKind.Class)
Lowering\AsyncRewriter\AsyncStateMachine.cs (3)
20private readonly TypeKind _typeKind; 25public AsyncStateMachine(VariableSlotAllocator variableAllocatorOpt, TypeCompilationState compilationState, MethodSymbol asyncMethod, int asyncMethodOrdinal, TypeKind typeKind) 64public override TypeKind TypeKind
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (2)
610if (e.StrippedType().TypeKind == TypeKind.Enum) 819if ((object)d != null && d.TypeKind == TypeKind.Delegate)
Lowering\ClosureConversion\SynthesizedClosureEnvironment.cs (3)
39public override TypeKind TypeKind { get; } 56TypeKind = isStruct ? TypeKind.Struct : TypeKind.Class;
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
241_ when variableType.TypeKind is TypeKind.Struct
Lowering\IteratorRewriter\IteratorStateMachine.cs (2)
46public override TypeKind TypeKind 48get { return TypeKind.Class; }
Lowering\LocalRewriter\DelegateCacheContainer.cs (2)
50public override TypeKind TypeKind => TypeKind.Class;
Lowering\LocalRewriter\DynamicSiteContainer.cs (2)
40public override TypeKind TypeKind 42get { return TypeKind.Class; }
Lowering\LocalRewriter\LocalRewriter.cs (1)
852Debug.Assert(node.Expression.Type is { TypeKind: TypeKind.Array });
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (4)
2279Debug.Assert(loweredLeft.Type is { TypeKind: TypeKind.Pointer }); 2284Debug.Assert(loweredRight.Type is { TypeKind: TypeKind.Pointer }); 2471Debug.Assert(loweredLeft.Type is { TypeKind: TypeKind.Pointer }); 2472Debug.Assert(loweredRight.Type is { TypeKind: TypeKind.Pointer });
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
556case ConversionKind.MethodGroup when oldNodeOpt is { Type: { TypeKind: TypeKind.FunctionPointer } funcPtrType }:
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (2)
213else if (fixedCollectionInitializer.Expression.Type is { TypeKind: TypeKind.Array }) 241Debug.Assert(initializerExpr.Type is { TypeKind: TypeKind.Pointer });
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (4)
876Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array }); 904Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array }); 1025Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array }); 1053Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array });
Lowering\LocalRewriter\LocalRewriter_PreviousSubmissionReference.cs (1)
15Debug.Assert(targetType.TypeKind == TypeKind.Submission);
Lowering\LocalRewriter\LocalRewriter_PropertyAccess.cs (1)
37if (rewrittenReceiverOpt is { Type: { TypeKind: TypeKind.Array } } && !isLeftOfAssignment)
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (1)
931Debug.Assert(binaryOperand.Type is { TypeKind: TypeKind.Pointer });
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
71if (!method.IsStatic && method.ContainingType.TypeKind == TypeKind.Struct && !isRuntimeAsync)
Lowering\SyntheticBoundNodeFactory.cs (3)
1199Debug.Assert(array.Type is { TypeKind: TypeKind.Array }); 1205Debug.Assert(array.Type is { TypeKind: TypeKind.Array }); 1218Debug.Assert(array.Type is { TypeKind: TypeKind.Array });
SymbolDisplay\SymbolDisplayVisitor.cs (3)
312if (type != null && type.TypeKind != TypeKind.Error) 375(containingType.TypeKind != TypeKind.Interface && !IsEnumMember(symbol) & !IsLocalFunction(symbol)))) 467&& symbol.ContainingType.TypeKind == TypeKind.Enum
SymbolDisplay\SymbolDisplayVisitor.Members.cs (3)
70else if (symbol.ContainingType.TypeKind == TypeKind.Enum) 887if (type.TypeKind == TypeKind.Enum) 936(containingType.TypeKind != TypeKind.Interface && !IsEnumMember(symbol) && !IsLocalFunction(symbol))))
SymbolDisplay\SymbolDisplayVisitor.Types.cs (26)
231if (typeArg.TypeKind != TypeKind.Pointer) 286var shouldSkip = namespaceSymbol.IsGlobalNamespace && symbol.TypeKind == TypeKind.Error; 329if (symbol.IsAnonymousType && symbol.TypeKind != TypeKind.Delegate) 382if (symbolName is null && symbol.IsAnonymousType && symbol.TypeKind == TypeKind.Delegate) 547if (tupleSymbol.TypeKind == TypeKind.Error || 615if (symbol.TypeKind == TypeKind.Error && 634symbol.TypeKind == TypeKind.Delegate && 643case TypeKind.Class when symbol.IsRecord: 645case TypeKind.Struct when symbol.IsRecord: 647case TypeKind.Submission: 648case TypeKind.Module: 649case TypeKind.Class: 651case TypeKind.Delegate: 653case TypeKind.Enum: 655case TypeKind.Error: 657case TypeKind.Interface: 659case TypeKind.Struct: 729if (symbol.IsAnonymousType && symbol.TypeKind != TypeKind.Delegate) 743case TypeKind.Class when symbol.IsRecord: 748case TypeKind.Struct when symbol.IsRecord: 764case TypeKind.Module: 765case TypeKind.Class: 770case TypeKind.Enum: 775case TypeKind.Delegate: 780case TypeKind.Interface: 785case TypeKind.Struct:
SymbolDisplay\SymbolDisplayVisitor_Constants.cs (1)
18else if (type.IsReferenceType || type.TypeKind == TypeKind.Pointer || ITypeSymbolHelpers.IsNullableType(type))
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (1)
153if (symbol.TypeKind != TypeKind.Error)
Symbols\AnonymousTypes\PublicSymbols\AnonymousManager.TypeOrDelegatePublicSymbol.cs (1)
179public abstract override TypeKind TypeKind { get; }
Symbols\AnonymousTypes\PublicSymbols\AnonymousType.DelegatePublicSymbol.cs (2)
37public override TypeKind TypeKind => TypeKind.Delegate;
Symbols\AnonymousTypes\PublicSymbols\AnonymousType.TypePublicSymbol.cs (2)
78public override TypeKind TypeKind 80get { return TypeKind.Class; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (2)
227public override TypeKind TypeKind => TypeKind.Delegate;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (2)
101public override TypeKind TypeKind 103get { return TypeKind.Class; }
Symbols\ArrayTypeSymbol.cs (3)
295public override TypeKind TypeKind 299return TypeKind.Array; 377while (current.TypeKind == TypeKind.Array)
Symbols\AssemblySymbol.cs (4)
521=> GetSpecialType(InternalSpecialType.System_Runtime_CompilerServices_AsyncHelpers) is { TypeKind: TypeKind.Class, IsStatic: true }; 528return GetSpecialType(SpecialType.System_Runtime_CompilerServices_RuntimeFeature) is { TypeKind: TypeKind.Class, IsStatic: true } && 551GetSpecialType(SpecialType.System_Runtime_CompilerServices_PreserveBaseOverridesAttribute) is { TypeKind: TypeKind.Class }; 1061if (result is null || result.TypeKind == TypeKind.Error)
Symbols\BaseTypeAnalysis.cs (1)
118if (fieldType is null || fieldType.TypeKind != TypeKind.Struct || field.IsStatic)
Symbols\Compilation_WellKnownMembers.cs (5)
227if (type.Kind != SymbolKind.NamedType || type.TypeKind != TypeKind.Class) 984case TypeKind.Dynamic: 988case TypeKind.Array: 997case TypeKind.Pointer: 1006case TypeKind.FunctionPointer:
Symbols\ConstantValueUtils.cs (1)
89if (typeSymbol.TypeKind == TypeKind.TypeParameter)
Symbols\ConstraintsHelper.cs (28)
168case TypeKind.TypeParameter: 219case TypeKind.Interface: 220case TypeKind.Class: 221case TypeKind.Delegate: 223Debug.Assert(inherited || currentCompilation == null || constraintType.TypeKind != TypeKind.Delegate); 238case TypeKind.Struct: 242if (underlyingType.TypeKind == TypeKind.TypeParameter) 262case TypeKind.Enum: 268case TypeKind.Array: 274case TypeKind.Error: 279case TypeKind.Pointer: 280case TypeKind.FunctionPointer: 285case TypeKind.Submission: 1197else if (typeArgument.TypeKind == TypeKind.TypeParameter) 1383if (typeArgument.TypeKind == TypeKind.TypeParameter) 1483case TypeKind.Struct: 1486case TypeKind.Enum: 1487case TypeKind.Dynamic: 1490case TypeKind.Class: 1498case TypeKind.TypeParameter: 1504case TypeKind.Submission: 1515Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 1565case TypeKind.Array: 1566case TypeKind.Class: 1567case TypeKind.Delegate: 1568case TypeKind.Enum: 1569case TypeKind.Struct:
Symbols\DynamicTypeSymbol.cs (3)
63public override TypeKind TypeKind 67return TypeKind.Dynamic; 203if (ReferenceEquals(this, t2) || t2.TypeKind == TypeKind.Dynamic)
Symbols\EnumConversions.cs (8)
13internal static TypeKind ToTypeKind(this DeclarationKind kind) 21return TypeKind.Class; 24return TypeKind.Submission; 27return TypeKind.Delegate; 30return TypeKind.Enum; 33return TypeKind.Interface; 38return TypeKind.Struct; 41return TypeKind.Extension;
Symbols\ErrorTypeSymbol.cs (2)
236public sealed override TypeKind TypeKind 240return TypeKind.Error;
Symbols\ExtendedErrorTypeSymbol.cs (8)
224if ((object?)oldSymbol == null || oldSymbol.TypeKind != TypeKind.Error) 250internal static TypeKind ExtractNonErrorTypeKind(TypeSymbol oldSymbol) 252if (oldSymbol.TypeKind != TypeKind.Error) 267TypeKind commonTypeKind = TypeKind.Error; 273if ((object?)type != null && type.TypeKind != TypeKind.Error) 275if (commonTypeKind == TypeKind.Error) 278return TypeKind.Error; // no common kind.
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (2)
76public override TypeKind TypeKind => TypeKind.FunctionPointer;
Symbols\FunctionTypeSymbol.cs (1)
102public override TypeKind TypeKind => TypeKindInternal.FunctionType;
Symbols\Metadata\PE\MetadataDecoder.cs (4)
397case TypeKind.Interface: 411case TypeKind.Delegate: 412case TypeKind.Enum: 413case TypeKind.Struct:
Symbols\Metadata\PE\NativeIntegerTypeDecoder.cs (11)
86case TypeKind.Array: 88case TypeKind.Pointer: 90case TypeKind.FunctionPointer: 92case TypeKind.TypeParameter: 93case TypeKind.Dynamic: 95case TypeKind.Class: 96case TypeKind.Struct: 97case TypeKind.Interface: 98case TypeKind.Delegate: 99case TypeKind.Enum: 102Debug.Assert(type.TypeKind == TypeKind.Error);
Symbols\Metadata\PE\PEMethodSymbol.cs (2)
1342if ((this.ContainingType.TypeKind == TypeKind.Class && this.IsRuntimeFinalizer(skipFirstMethodKindCheck: true)) || 1349if (_containingType.TypeKind == TypeKind.Delegate)
Symbols\Metadata\PE\PENamedTypeSymbol.cs (30)
72private TypeKind _lazyKind; 122if (this.TypeKind is TypeKind.Enum or TypeKind.Extension) 1435if (this.TypeKind == TypeKind.Enum) 1640&& this.TypeKind == TypeKind.Enum) 1734if (this.TypeKind == TypeKind.Enum) 1793if (this.TypeKind == TypeKind.Struct) 2203case TypeKind.Class: 2204case TypeKind.Struct: 2205case TypeKind.Delegate: 2232public override TypeKind TypeKind 2236var result = (TypeKind)Volatile.Read(ref Unsafe.As<TypeKind, byte>(ref _lazyKind)); 2238if (result == TypeKind.Unknown) 2243result = TypeKind.Extension; 2247result = TypeKind.Interface; 2253result = TypeKind.Class; 2263result = TypeKind.Enum; 2268result = TypeKind.Delegate; 2276result = TypeKind.Struct; 2405bool checkForExtensionGroup = this.IsStatic && this.ContainingType is null && this.TypeKind == TypeKind.Class && 2428type.TypeKind == TypeKind.Class && type.BaseTypeNoUseSiteDiagnostics.IsObjectType() && 2452marker.TypeKind == TypeKind.Class && marker.BaseTypeNoUseSiteDiagnostics.IsObjectType() && marker.Arity == 0 && 2492if (this.TypeKind == TypeKind.Struct) 2575var isOrdinaryEmbeddableStruct = (this.TypeKind == TypeKind.Struct) && (this.SpecialType == Microsoft.CodeAnalysis.SpecialType.None) && this.ContainingAssembly.IsLinked; 2739else if (TypeKind == TypeKind.Class && SpecialType != SpecialType.System_Enum) 2900if (this.TypeKind == TypeKind.Struct) 2949if (this.TypeKind == TypeKind.Struct) 2991var coClassType = ((object)type != null && (type.TypeKind == TypeKind.Class || type.IsErrorType())) ? (NamedTypeSymbol)type : null;
Symbols\MissingMetadataTypeSymbol.cs (1)
376t2.TypeKind == TypeKind.Dynamic &&
Symbols\NamedTypeSymbol.cs (15)
179if (TypeKind != TypeKind.Delegate) 537var kind = TypeKind; 538return kind != TypeKind.Enum && kind != TypeKind.Struct && kind != TypeKind.Error; 551var kind = TypeKind; 552return kind == TypeKind.Struct || kind == TypeKind.Enum; 585return TypeKind == TypeKind.Submission; 604var name = (TypeKind == TypeKind.Submission) ? SynthesizedEntryPointSymbol.FactoryName : SynthesizedEntryPointSymbol.MainName; 652=> TypeKind == TypeKind.Extension; 1034if (t2.TypeKind == TypeKind.Dynamic) 1860/// Requires less computation than <see cref="TypeSymbol.TypeKind"/> == <see cref="TypeKind.Interface"/>. 1873return TypeKind is TypeKind.Class or TypeKind.Struct &&
Symbols\NamespaceOrTypeSymbol.cs (1)
213TypeKind typeKind = kind.ToDeclarationKind().ToTypeKind();
Symbols\PointerTypeSymbol.cs (3)
166public override TypeKind TypeKind 170return TypeKind.Pointer; 220while (current.TypeKind == TypeKind.Pointer)
Symbols\PublicModel\TypeSymbol.cs (1)
147TypeKind ITypeSymbol.TypeKind
Symbols\Retargeting\RetargetingSymbolTranslator.cs (2)
842Debug.Assert(nts.TypeKind == TypeKind.Error || nts.PrimitiveTypeCode == Cci.PrimitiveTypeCode.NotPrimitive); 854Debug.Assert(ts.TypeKind == TypeKind.Error || ts.PrimitiveTypeCode == Cci.PrimitiveTypeCode.NotPrimitive);
Symbols\Source\ExplicitInterfaceHelpers.cs (3)
197case TypeKind.Class: 198case TypeKind.Struct: 199case TypeKind.Interface:
Symbols\Source\SourceAssemblySymbol.cs (1)
2226Debug.Assert(forwardedType.TypeKind != TypeKind.Error);
Symbols\Source\SourceDelegateMethodSymbol.cs (2)
80if (binder.Compilation.GetSpecialType(SpecialType.System_IAsyncResult).TypeKind != TypeKind.Error && 81binder.Compilation.GetSpecialType(SpecialType.System_AsyncCallback).TypeKind != TypeKind.Error &&
Symbols\Source\SourceEventSymbol.cs (4)
661else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 666else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct) 707else if (IsAbstract && !ContainingType.IsAbstract && (ContainingType.TypeKind == TypeKind.Class || ContainingType.TypeKind == TypeKind.Submission))
Symbols\Source\SourceFixedFieldSymbol.cs (2)
169public override TypeKind TypeKind 171get { return TypeKind.Struct; }
Symbols\Source\SourceMemberContainerSymbol.cs (48)
103public TypeKind TypeKind 105get { return (TypeKind)((_flags >> TypeKindOffset) & TypeKindMask); } 119public Flags(ExtendedSpecialType specialType, TypeKind typeKind, bool hasPrimaryConstructor) 240TypeKind typeKind = declaration.Kind.ToTypeKind(); 264Debug.Assert(typeKind is TypeKind.Struct or TypeKind.Class || !HasPrimaryConstructor); 293private DeclarationModifiers MakeModifiers(TypeKind typeKind, BindingDiagnosticBag diagnostics) 300if (typeKind == TypeKind.Extension) 329case TypeKind.Class: 330case TypeKind.Submission: 340case TypeKind.Struct: 349case TypeKind.Interface: 352case TypeKind.Delegate: 399case TypeKind.Interface: 402case TypeKind.Class: 407case TypeKind.Struct: 408case TypeKind.Enum: 409case TypeKind.Delegate: 410case TypeKind.Extension: 829public override TypeKind TypeKind 850return this.TypeKind == TypeKind.Interface; 1500case TypeKind.Class: 1501case TypeKind.Struct: 1504case TypeKind.Interface: 1511case TypeKind.Extension: 1656if (this.TypeKind == TypeKind.Enum) 2678if (this.TypeKind is TypeKind.Delegate or TypeKind.Extension) 2742if (TypeKind != TypeKind.Struct) 2767Debug.Assert(TypeKind == TypeKind.Struct); 2801(type.TypeKind == TypeKind.Struct) && 3132if (f is null || !f.IsStatic || f.Type.TypeKind != TypeKind.Struct) continue; 3161if (f is null || !f.IsStatic || f.Type.TypeKind != TypeKind.Struct) continue; 3696case TypeKind.Struct: 3701case TypeKind.Enum: 3705case TypeKind.Class: 3706case TypeKind.Interface: 3707case TypeKind.Submission: 3979if (TypeKind is TypeKind.Class) 3986case TypeKind.Struct: 3987case TypeKind.Enum: 3988case TypeKind.Class: 3989case TypeKind.Interface: 3990case TypeKind.Submission: 3994if (TypeKind == TypeKind.Class) // Tracked by https://github.com/dotnet/roslyn/issues/78827 : MQ, Consider tightening this check to only top-level non-generic static classes, however optimizing for error scenarios is usually not a goal. 4011if (type.TypeKind == TypeKind.Extension) 4880Debug.Assert(TypeKind == TypeKind.Struct); 5690builder.AddNonTypeMember(this, (this.TypeKind == TypeKind.Submission) ?
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (7)
519case TypeKind.Enum: 520case TypeKind.Delegate: 521case TypeKind.Extension: 524case TypeKind.Class: 525case TypeKind.Struct: 526case TypeKind.Interface: 527case TypeKind.Submission: // we have to check that "override" is not used
Symbols\Source\SourceMemberFieldSymbol.cs (1)
607if (ContainingType.TypeKind != TypeKind.Struct)
Symbols\Source\SourceMethodSymbolWithAttributes.cs (2)
1487if (ContainingSymbol is NamedTypeSymbol { IsComImport: true, TypeKind: TypeKind.Class or TypeKind.Interface })
Symbols\Source\SourceNamedTypeSymbol.cs (14)
822case TypeKind.Delegate: 825case TypeKind.Enum: 826case TypeKind.Interface: 829case TypeKind.Struct: 830case TypeKind.Class: 1228if (TypeKind != TypeKind.Struct) 1257return builderType is NamedTypeSymbol { TypeKind: TypeKind.Class or TypeKind.Struct, IsGenericType: false }; 1364if ((object)coClassType != null && coClassType.TypeKind == TypeKind.Class) 1554if (this.TypeKind == TypeKind.Struct) 1658if (this.TypeKind == TypeKind.Class) 1970if (TypeKind == TypeKind.Struct && !IsRecordStruct && HasInlineArrayAttribute(out _)) 2056if (TypeKind == TypeKind.Struct && HasExtendedLayoutAttribute) 2080|| TypeKind != TypeKind.Class
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (32)
44TypeKind is not (TypeKind.Enum or TypeKind.Delegate or TypeKind.Submission)) 282if (this.TypeKind == TypeKind.Enum) 312else if (baseType.TypeKind == TypeKind.Error && (object)partBase != null) 319else if ((object)partBase != null && !TypeSymbol.Equals(partBase, baseType, TypeCompareKind.ConsiderEverything) && partBase.TypeKind != TypeKind.Error) 524if (i == 0 && TypeKind == TypeKind.Class) // allow class in the first position 563if (baseType.TypeKind == TypeKind.Error) 567TypeKind guessTypeKind = baseType.GetNonErrorTypeKindGuess(); 568if (guessTypeKind == TypeKind.Interface) 575if ((baseType.TypeKind == TypeKind.Class || 576baseType.TypeKind == TypeKind.Delegate || 577baseType.TypeKind == TypeKind.Struct || 605case TypeKind.Interface: 638case TypeKind.Class: 639if (TypeKind == TypeKind.Class) 655case TypeKind.TypeParameter: 659case TypeKind.Error: 664case TypeKind.Dynamic: 668case TypeKind.Submission: 689if (TypeKind != TypeKind.Class || baseType.TypeKind == TypeKind.Interface) 721var typeKind = this.TypeKind; 723if (typeKind == TypeKind.Enum) 730bool isInterface = (typeKind == TypeKind.Interface); 772var typeKind = this.TypeKind; 777if (typeKind == TypeKind.Enum) 783else if (typeKind == TypeKind.Extension) 797case TypeKind.Class: 807case TypeKind.Struct: 812case TypeKind.Interface: 815case TypeKind.Delegate:
Symbols\Source\SourceNamedTypeSymbol_Enum.cs (2)
46if (this.TypeKind != TypeKind.Enum) 89if (this.TypeKind != TypeKind.Enum)
Symbols\Source\SourceOrdinaryMethodSymbol.cs (5)
883else if (IsSealed && ContainingType.TypeKind == TypeKind.Struct) 905else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 910else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct) 920else if (IsAbstract && !ContainingType.IsAbstract && (ContainingType.TypeKind == TypeKind.Class || ContainingType.TypeKind == TypeKind.Submission))
Symbols\Source\SourcePropertyAccessorSymbol.cs (3)
579if (IsAbstract && !ContainingType.IsAbstract && (ContainingType.TypeKind == TypeKind.Class || ContainingType.TypeKind == TypeKind.Submission)) 584else if (IsVirtual && ContainingType.IsSealed && ContainingType.TypeKind != TypeKind.Struct) // error CS0106 on struct already
Symbols\Source\SourcePropertySymbolBase.cs (2)
1126else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 1131else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct)
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (1)
422case { TypeKind: TypeKind.TypeParameter, IsReferenceType: false }:
Symbols\Source\ThisParameterSymbol.cs (1)
157if (ContainingType?.TypeKind != TypeKind.Struct)
Symbols\Symbol.cs (3)
256if (ContainingType?.TypeKind == TypeKind.Submission) 278if (ContainingType.TypeKind == TypeKind.Submission) 289Debug.Assert(ContainingType.TypeKind != TypeKind.Submission);
Symbols\Symbol_Attributes.cs (7)
70case TypeKind.Class: 73case TypeKind.Delegate: 76case TypeKind.Enum: 79case TypeKind.Interface: 82case TypeKind.Struct: 85case TypeKind.TypeParameter: 88case TypeKind.Submission:
Symbols\SymbolExtensions.cs (3)
85return superType.TypeKind == TypeKind.Submission && subType.TypeKind == TypeKind.Submission; 239if (type.TypeKind == TypeKind.TypeParameter)
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (2)
147public override TypeKind TypeKind => TypeKind.Class;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (2)
860public override TypeKind TypeKind => TypeKind.Class;
Symbols\Synthesized\SynthesizedContainer.cs (3)
48internal sealed override bool IsInterface => this.TypeKind == TypeKind.Interface; 94public override bool IsAbstract => (object)Constructor == null && this.TypeKind != TypeKind.Struct; 168internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => ContainingAssembly.GetSpecialType(this.TypeKind == TypeKind.Struct ? SpecialType.System_ValueType : SpecialType.System_Object);
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (2)
79public override TypeKind TypeKind => TypeKind.Class;
Symbols\Synthesized\SynthesizedHotReloadExceptionSymbol.cs (2)
106public override TypeKind TypeKind => TypeKind.Class;
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (2)
64public override TypeKind TypeKind => TypeKind.Struct;
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (2)
84Debug.Assert(_containingType.TypeKind == TypeKind.Class); 88if (_containingType.TypeKind == TypeKind.Delegate)
Symbols\Synthesized\SynthesizedPrivateImplementationDetailsType.cs (2)
57public override TypeKind TypeKind => TypeKind.Class;
Symbols\Synthesized\SynthesizedSubmissionConstructor.cs (1)
19Debug.Assert(containingType.TypeKind == TypeKind.Submission);
Symbols\TypeParameterSymbol.cs (7)
196public sealed override TypeKind TypeKind 200return TypeKind.TypeParameter; 394if (constraint.TypeKind == TypeKind.TypeParameter) 404Debug.Assert(constraint.TypeKind != TypeKind.TypeParameter); 414case TypeKind.Interface: 416case TypeKind.Error: 485if (constraintType.TypeKind == TypeKind.TypeParameter)
Symbols\TypeSymbol.cs (7)
110var interfaces = (baseType.TypeKind == TypeKind.TypeParameter) ? ((TypeParameterSymbol)baseType).EffectiveInterfacesNoUseSiteDiagnostics : baseType.InterfacesNoUseSiteDiagnostics(); 346var interfaces = (baseType.TypeKind == TypeKind.TypeParameter) ? ((TypeParameterSymbol)baseType).EffectiveInterfacesNoUseSiteDiagnostics : baseType.InterfacesNoUseSiteDiagnostics(); 487public abstract TypeKind TypeKind { get; } 511TypeKind.Pointer => Microsoft.Cci.PrimitiveTypeCode.Pointer, 512TypeKind.FunctionPointer => Microsoft.Cci.PrimitiveTypeCode.FunctionPointer, 2528TypeKind ITypeSymbolInternal.TypeKind => this.TypeKind; 2556if (this.TypeKind == TypeKind.Struct)
Symbols\TypeSymbolExtensions.cs (71)
72if (type.TypeKind != TypeKind.TypeParameter) 118if (type.TypeKind == TypeKind.TypeParameter) 240return type.TypeKind == TypeKind.Enum; 335case TypeKind.Pointer: 336case TypeKind.Dynamic: 337case TypeKind.FunctionPointer: 346return type is { IsValueType: true, TypeKind: not TypeKind.TypeParameter }; 358return type.TypeKind == TypeKind.Class; 364return type.TypeKind == TypeKind.Struct; 380return type.TypeKind == TypeKind.Dynamic; 386return type.TypeKind == TypeKind.TypeParameter; 392return type.TypeKind == TypeKind.Array; 398return type.TypeKind == TypeKind.Array && ((ArrayTypeSymbol)type).IsSZArray; 441return type.TypeKind == TypeKind.FunctionPointer; 448case TypeKind.Pointer: 449case TypeKind.FunctionPointer: 461case TypeKind.Class: 462case TypeKind.Struct: 465case TypeKind.TypeParameter: 611return type.TypeKind == TypeKind.Delegate; 747case TypeKind.Class: 748case TypeKind.Struct: 749case TypeKind.Interface: 750case TypeKind.Enum: 751case TypeKind.Delegate: 752case TypeKind.Submission: 822case TypeKind.Class: 823case TypeKind.Struct: 824case TypeKind.Interface: 825case TypeKind.Enum: 826case TypeKind.Delegate: 841case TypeKind.Submission: 880case TypeKind.Dynamic: 881case TypeKind.TypeParameter: 882case TypeKind.Submission: 883case TypeKind.Enum: 893goto case TypeKind.Delegate; 895case TypeKind.Error: 896case TypeKind.Class: 897case TypeKind.Struct: 898case TypeKind.Interface: 899case TypeKind.Delegate: 900case TypeKind.Extension: 968case TypeKind.Array: 972case TypeKind.Pointer: 976case TypeKind.FunctionPointer: 1211if (ReferenceEquals(parent2.OriginalDefinition, parent1OriginalDefinition) || parent1OriginalDefinition.TypeKind == TypeKind.Submission && parent2.TypeKind == TypeKind.Submission) 1251(type, parameter, unused) => type.TypeKind == TypeKind.TypeParameter && (parameter is null || TypeSymbol.Equals(type, parameter, TypeCompareKind.ConsiderEverything2)); 1262(type, typeParameterContainer, unused) => type.TypeKind == TypeKind.TypeParameter && (object)type.ContainingSymbol == (object)typeParameterContainer; 1271(type, parameters, unused) => type.TypeKind == TypeKind.TypeParameter && parameters.Contains((TypeParameterSymbol)type); 1318(type, _, _) => type.TypeKind == TypeKind.TypeParameter && type.ContainingSymbol is MethodSymbol; 1329private static readonly Func<TypeSymbol, object?, bool, bool> s_containsDynamicPredicate = (type, unused1, unused2) => type.TypeKind == TypeKind.Dynamic; 1367type.VisitType((TypeSymbol t, object? _, bool _) => t.TypeKind is TypeKind.Pointer or TypeKind.FunctionPointer, null) is object; 1395internal static TypeKind GetNonErrorTypeKindGuess(this TypeSymbol type) 1594case TypeKind.Struct: 1597case TypeKind.Array: 1598case TypeKind.Class: 1599case TypeKind.Delegate: 1600case TypeKind.Dynamic: 1601case TypeKind.Error: 1602case TypeKind.Interface: 1603case TypeKind.Pointer: 1604case TypeKind.FunctionPointer: 1607case TypeKind.Enum: 1610case TypeKind.TypeParameter: 1613case TypeKind.Submission: 1754return type.IsReferenceType && type.TypeKind != TypeKind.TypeParameter; 1762return type.IsValueType && type.TypeKind != TypeKind.TypeParameter; 2087if (taskType.TypeKind == TypeKind.Error)
Symbols\TypeWithAnnotations.cs (4)
200if (typeSymbol.TypeKind != TypeKind.TypeParameter) 271public TypeKind TypeKind => Type.TypeKind; 650if (type.TypeKind != TypeKind.Array) 1068Debug.Assert(underlying.TypeKind == TypeKind.TypeParameter);
Symbols\VarianceSafety.cs (12)
75case TypeKind.Class: 76case TypeKind.Struct: 77case TypeKind.Enum: 79case TypeKind.Extension: 82case TypeKind.Interface: 83case TypeKind.Delegate: 373case TypeKind.Class: 374case TypeKind.Struct: 375case TypeKind.Enum: // Can't be generic, but can be nested in generic. 376case TypeKind.Interface: 377case TypeKind.Delegate: 378case TypeKind.Error:
Symbols\Wrapped\WrappedNamedTypeSymbol.cs (1)
113public override TypeKind TypeKind
Utilities\TypeSymbolExtensions.cs (17)
183case TypeKind.TypeParameter: 186case TypeKind.Class: 187case TypeKind.Struct: 188case TypeKind.Error: 189case TypeKind.Interface: 192case TypeKind.Dynamic: 193case TypeKind.Enum: 194case TypeKind.Delegate: 195case TypeKind.Array: 196case TypeKind.Submission: 197case TypeKind.Pointer: 198case TypeKind.FunctionPointer: 199case TypeKind.Extension: 278case TypeKind.Class: 279case TypeKind.Error: 281case TypeKind.Interface: 283case TypeKind.Struct:
Microsoft.CodeAnalysis.CSharp.CodeStyle (28)
src\roslyn\src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
90if (syntaxContext.SemanticModel.GetTypeInfo(invocationExpression.Expression, syntaxContext.CancellationToken).Type is { TypeKind: TypeKind.FunctionPointer })
src\roslyn\src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
56if (namedTypeSymbol.TypeKind != TypeKind.Struct)
src\roslyn\src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
58TypeKind: TypeKind.Struct, 256return instance is { Type.TypeKind: TypeKind.Struct } ||
src\roslyn\src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
82if (typeSymbol.TypeKind is not TypeKind.Struct)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
140if (invokedMethod is { ContainingType.TypeKind: TypeKind.Struct, IsReadOnly: false, ContainingType.IsReadOnly: false })
src\roslyn\src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
115if (symbolInfo.GetAnySymbol() is not IFieldSymbol { ContainingType.TypeKind: TypeKind.Struct })
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
138if (operation?.Parent is IAssignmentOperation { Type.TypeKind: TypeKind.Dynamic })
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
128if (asType?.TypeKind == TypeKind.Dynamic)
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
120if (isType?.TypeKind == TypeKind.Dynamic)
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (2)
274if (namedType.TypeKind is not (TypeKind.Class or TypeKind.Struct))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (3)
66if (lockType.GetTypeMembers("Scope").FirstOrDefault() is not { TypeKind: TypeKind.Struct, IsRefLikeType: true, DeclaredAccessibility: Accessibility.Public }) 78if (namedType is not { TypeKind: TypeKind.Class or TypeKind.Struct })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs (2)
42if (typeSymbol.TypeKind is TypeKind.Class or TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
211if (containingType != null && containingType.TypeKind == TypeKind.Interface) 445if (parameter.Type.OriginalDefinition.TypeKind != TypeKind.TypeParameter)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (8)
253if (originalDelegateCreationOperation.Type?.TypeKind != TypeKind.Delegate) 270if (rewrittenDelegateCreationOperation.Type?.TypeKind != TypeKind.Delegate) 316if (originalConvertedType is null || originalConvertedType.TypeKind == TypeKind.Error) 357if (rewrittenConvertedType is null || rewrittenConvertedType.TypeKind == TypeKind.Error || !rewrittenConversion.Exists) 579originalConvertedType.IsReferenceType && rewrittenConvertedType.TypeKind == TypeKind.Dynamic) 1101if (!original.IsReferenceType || original.TypeKind == TypeKind.Interface) 1444if (originalMemberSymbol.ContainingType.TypeKind == TypeKind.Interface) 1484rewrittenType.TypeKind == TypeKind.Array ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
260if (declaredType.TypeKind == TypeKind.Dynamic)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (43)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (5)
44TypeKind: TypeKind.Class or TypeKind.Struct, 272recordKeyword = type.TypeKind == TypeKind.Class 417type.TypeKind == TypeKind.Class 423type.TypeKind == TypeKind.Class
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
179if (containingType.TypeKind == TypeKind.Struct && !containingType.IsReadOnly)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsService.cs (2)
39return classType?.TypeKind is TypeKind.Class or TypeKind.Struct;
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (5)
56ISet<TypeKind> classInterfaceModuleStructTypes, 82ISet<TypeKind> classInterfaceModuleStructTypes, 108ISet<TypeKind> classInterfaceModuleStructTypes, 136ISet<TypeKind> classInterfaceModuleStructTypes, 167ISet<TypeKind> classInterfaceModuleStructTypes,
src\roslyn\src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
71if (interfaceSymbolInfo.GetAnySymbol() is INamedTypeSymbol interfaceType && interfaceType.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (2)
85if (type != null && type.TypeKind != TypeKind.Error) 124return type.TypeKind == TypeKind.Enum &&
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
47if (type == null || type.TypeKind == TypeKind.Error || type.IsAnonymousType)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
390semanticModel.GetSymbolInfo(baseType.Type, cancellationToken).GetAnySymbol() is INamedTypeSymbol { TypeKind: TypeKind.Class })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
60if (type is INamedTypeSymbol { TypeKind: TypeKind.Enum } enumType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
293if (constraintType.IsReferenceType && constraintType.TypeKind != TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (8)
96if (info.Context.GenerateMembers && namedType.TypeKind != TypeKind.Delegate) 188if (namedType.TypeKind == TypeKind.Enum) 192else if (namedType.TypeKind == TypeKind.Delegate) 200var isRecordClass = namedType.TypeKind is TypeKind.Class; 211var kind = namedType.TypeKind == TypeKind.Struct ? SyntaxKind.StructDeclaration : 212namedType.TypeKind == TypeKind.Interface ? SyntaxKind.InterfaceDeclaration : SyntaxKind.ClassDeclaration; 293if (namedType.TypeKind == TypeKind.Class) 321if (namedType is { TypeKind: TypeKind.Class, BaseType: not null, BaseType.SpecialType: not SpecialType.System_Object })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
3069return ((INamedTypeSymbol)symbol).TypeKind == TypeKind.Enum; 3072return target.IsType && ((ITypeSymbol)target).TypeKind == TypeKind.Enum;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (4)
59typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Class).Concat( 60typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Interface).Concat( 61typeParameter.ConstraintTypes.Where(t => t.TypeKind is not TypeKind.Class and not TypeKind.Interface)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (2)
53if (symbol.ContainingType.TypeKind == TypeKind.Submission) 67if (symbol.TypeKind != TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (4)
197if (symbol is { TypeKind: TypeKind.Error, Name: "var" }) 234if (innerType.TypeKind != TypeKind.Pointer) 269if (symbol.ContainingType.TypeKind != TypeKind.Submission) 288if (symbol.TypeKind != TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
447if (type.TypeKind == TypeKind.Delegate) 1037if (parentTypes.Any(static parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate)) 1039return parentTypes.Where(parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate);
Microsoft.CodeAnalysis.CSharp.Features (72)
ChangeSignature\CSharpChangeSignatureService.cs (1)
166if (typeSymbol is INamedTypeSymbol { TypeKind: TypeKind.Delegate })
Completion\CompletionProviders\DeclarationName\DeclarationNameRecommender.NameGenerator.cs (2)
105if (type.TypeKind == TypeKind.Interface) 113if (type.TypeKind == TypeKind.TypeParameter)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (5)
124if (type.TypeKind != TypeKind.Enum) 179if (type.TypeKind == TypeKind.Enum) 285if (containingType?.TypeKind == TypeKind.Enum && 342if (type.TypeKind is TypeKind.Struct or TypeKind.Class)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (4)
100if (symbol is not { TypeKind: TypeKind.Interface }) 108if (containingType is not INamedTypeSymbol { TypeKind: TypeKind.Class or TypeKind.Struct or TypeKind.Interface })
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (3)
156if (semanticModel.GetTypeInfo(objectCreationExpression, cancellationToken).Type is not INamedTypeSymbol { TypeKind: not TypeKind.Delegate } type) 191if (within is not { TypeKind: TypeKind.Struct or TypeKind.Class })
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (6)
963return method.ContainingType.TypeKind != TypeKind.Struct; 967if (method.ContainingType.TypeKind == TypeKind.Struct) 1965TypeKind.Struct => symbol.IsRecord ? CSharpFeaturesResources.record_struct : FeaturesResources.struct_, 1966TypeKind.Class => symbol.IsRecord ? CSharpFeaturesResources.record_ : FeaturesResources.class_, 2557{ ContainingType.TypeKind: TypeKind.Interface } 2562IFieldSymbol { ContainingType.TypeKind: TypeKind.Enum }
ExtractMethod\CSharpMethodExtractor.CSharpCodeGenerator.ExpressionCodeGenerator.cs (1)
95var expression = returnType.TypeKind == TypeKind.Array && containingScope is InitializerExpressionSyntax initializerExpression
ExtractMethod\CSharpMethodExtractor.PostProcessor.cs (2)
189semanticInfo.TypeKind is TypeKind.Error or TypeKind.Unknown)
ExtractMethod\CSharpSelectionResult.ExpressionResult.cs (1)
137info.ConvertedType.TypeKind != TypeKind.Interface)
GenerateType\CSharpGenerateTypeService.cs (1)
438if (expressionType is INamedTypeSymbol { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: var invokeMethod })
NavigationBar\CSharpNavigationBarItemService.cs (1)
259return symbol.ContainingType.TypeKind == TypeKind.Enum
SignatureHelp\ConstructorInitializerSignatureHelpProvider.cs (2)
71if (within.TypeKind is not TypeKind.Struct and not TypeKind.Class)
SignatureHelp\InvocationExpressionSignatureHelpProvider.cs (2)
72if (invokedType is INamedTypeSymbol { TypeKind: TypeKind.Delegate } or IFunctionPointerTypeSymbol) 120if (invokedType is INamedTypeSymbol { TypeKind: TypeKind.Delegate } expressionType)
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.cs (2)
68if (type.TypeKind == TypeKind.Delegate) 105Debug.Assert(type.TypeKind == TypeKind.Delegate);
Snippets\AbstractCSharpTypeSnippetProvider.cs (1)
26TypeKind typeKind, string defaultPrefix = "")
Snippets\CSharpClassSnippetProvider.cs (1)
19: AbstractCSharpTypeSnippetProvider<ClassDeclarationSyntax>(TypeKind.Class)
Snippets\CSharpConsoleSnippetProvider.cs (1)
42if (lambdaSymbol is IMethodSymbol { ReturnType: { SpecialType: SpecialType.System_Void } or { TypeKind: TypeKind.Error } })
Snippets\CSharpEnumSnippetProvider.cs (1)
19: AbstractCSharpTypeSnippetProvider<EnumDeclarationSyntax>(TypeKind.Enum)
Snippets\CSharpInterfaceSnippetProvider.cs (1)
19: AbstractCSharpTypeSnippetProvider<InterfaceDeclarationSyntax>(TypeKind.Interface, defaultPrefix: "I")
Snippets\CSharpStructSnippetProvider.cs (1)
19: AbstractCSharpTypeSnippetProvider<StructDeclarationSyntax>(TypeKind.Struct)
src\roslyn\src\Analyzers\CSharp\Analyzers\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessAnalyzer.cs (1)
90if (syntaxContext.SemanticModel.GetTypeInfo(invocationExpression.Expression, syntaxContext.CancellationToken).Type is { TypeKind: TypeKind.FunctionPointer })
src\roslyn\src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
56if (namedTypeSymbol.TypeKind != TypeKind.Struct)
src\roslyn\src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
58TypeKind: TypeKind.Struct, 256return instance is { Type.TypeKind: TypeKind.Struct } ||
src\roslyn\src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
82if (typeSymbol.TypeKind is not TypeKind.Struct)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryLambdaExpression\CSharpRemoveUnnecessaryLambdaExpressionDiagnosticAnalyzer.cs (1)
140if (invokedMethod is { ContainingType.TypeKind: TypeKind.Struct, IsReadOnly: false, ContainingType.IsReadOnly: false })
src\roslyn\src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
115if (symbolInfo.GetAnySymbol() is not IFieldSymbol { ContainingType.TypeKind: TypeKind.Struct })
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
138if (operation?.Parent is IAssignmentOperation { Type.TypeKind: TypeKind.Dynamic })
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.cs (1)
128if (asType?.TypeKind == TypeKind.Dynamic)
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpIsAndCastCheckDiagnosticAnalyzer.cs (1)
120if (isType?.TypeKind == TypeKind.Dynamic)
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (2)
274if (namedType.TypeKind is not (TypeKind.Class or TypeKind.Struct))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (3)
66if (lockType.GetTypeMembers("Scope").FirstOrDefault() is not { TypeKind: TypeKind.Struct, IsRefLikeType: true, DeclaredAccessibility: Accessibility.Public }) 78if (namedType is not { TypeKind: TypeKind.Class or TypeKind.Struct })
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (5)
44TypeKind: TypeKind.Class or TypeKind.Struct, 272recordKeyword = type.TypeKind == TypeKind.Class 417type.TypeKind == TypeKind.Class 423type.TypeKind == TypeKind.Class
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
179if (containingType.TypeKind == TypeKind.Struct && !containingType.IsReadOnly)
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsService.cs (2)
39return classType?.TypeKind is TypeKind.Class or TypeKind.Struct;
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateParameterizedMember\CSharpGenerateConversionService.cs (5)
56ISet<TypeKind> classInterfaceModuleStructTypes, 82ISet<TypeKind> classInterfaceModuleStructTypes, 108ISet<TypeKind> classInterfaceModuleStructTypes, 136ISet<TypeKind> classInterfaceModuleStructTypes, 167ISet<TypeKind> classInterfaceModuleStructTypes,
src\roslyn\src\Analyzers\CSharp\CodeFixes\ImplementInterface\CSharpImplementInterfaceService.cs (1)
71if (interfaceSymbolInfo.GetAnySymbol() is INamedTypeSymbol interfaceType && interfaceType.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ReplaceDefaultLiteral\CSharpReplaceDefaultLiteralCodeFixProvider.cs (2)
85if (type != null && type.TypeKind != TypeKind.Error) 124return type.TypeKind == TypeKind.Enum &&
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseExplicitTypeForConst\UseExplicitTypeForConstCodeFixProvider.cs (1)
47if (type == null || type.TypeKind == TypeKind.Error || type.IsAnonymousType)
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
390semanticModel.GetSymbolInfo(baseType.Type, cancellationToken).GetAnySymbol() is INamedTypeSymbol { TypeKind: TypeKind.Class })
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (3)
Microsoft.NetCore.Analyzers\Runtime\CSharpForwardCancellationTokenToInvocationsFixer.TypeNameVisitor.cs (3)
48if (symbol.ContainingType.TypeKind != TypeKind.Submission) 66if (symbol.TypeKind != TypeKind.Error) 133if (symbol.TypeKind == TypeKind.Error && symbol.Name == "var")
Microsoft.CodeAnalysis.CSharp.Workspaces (44)
Classification\SyntaxClassification\SyntaxTokenClassifier.cs (1)
24private static readonly Func<ITypeSymbol, bool> s_shouldInclude = t => t.TypeKind != TypeKind.Error && t.GetArity() > 0;
Rename\CSharpRenameRewriterLanguageService.cs (4)
769matchingLocal is ILocalSymbol { Type.TypeKind: TypeKind.Delegate } || 770matchingLocal is IParameterSymbol { Type.TypeKind: TypeKind.Delegate }; 796if (renamedSymbol is INamedTypeSymbol { TypeKind: not TypeKind.Enum } namedType) 801if (renamedSymbol.ContainingSymbol is INamedTypeSymbol { TypeKind: not TypeKind.Enum } containingNamedType &&
Simplification\CSharpSimplificationService.Expander.cs (1)
793if (typeinfo.Type != null && typeinfo.Type.TypeKind == TypeKind.Dynamic)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs (2)
42if (typeSymbol.TypeKind is TypeKind.Class or TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
211if (containingType != null && containingType.TypeKind == TypeKind.Interface) 445if (parameter.Type.OriginalDefinition.TypeKind != TypeKind.TypeParameter)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (8)
253if (originalDelegateCreationOperation.Type?.TypeKind != TypeKind.Delegate) 270if (rewrittenDelegateCreationOperation.Type?.TypeKind != TypeKind.Delegate) 316if (originalConvertedType is null || originalConvertedType.TypeKind == TypeKind.Error) 357if (rewrittenConvertedType is null || rewrittenConvertedType.TypeKind == TypeKind.Error || !rewrittenConversion.Exists) 579originalConvertedType.IsReferenceType && rewrittenConvertedType.TypeKind == TypeKind.Dynamic) 1101if (!original.IsReferenceType || original.TypeKind == TypeKind.Interface) 1444if (originalMemberSymbol.ContainingType.TypeKind == TypeKind.Interface) 1484rewrittenType.TypeKind == TypeKind.Array ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
260if (declaredType.TypeKind == TypeKind.Dynamic)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
60if (type is INamedTypeSymbol { TypeKind: TypeKind.Enum } enumType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
293if (constraintType.IsReferenceType && constraintType.TypeKind != TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (8)
96if (info.Context.GenerateMembers && namedType.TypeKind != TypeKind.Delegate) 188if (namedType.TypeKind == TypeKind.Enum) 192else if (namedType.TypeKind == TypeKind.Delegate) 200var isRecordClass = namedType.TypeKind is TypeKind.Class; 211var kind = namedType.TypeKind == TypeKind.Struct ? SyntaxKind.StructDeclaration : 212namedType.TypeKind == TypeKind.Interface ? SyntaxKind.InterfaceDeclaration : SyntaxKind.ClassDeclaration; 293if (namedType.TypeKind == TypeKind.Class) 321if (namedType is { TypeKind: TypeKind.Class, BaseType: not null, BaseType.SpecialType: not SpecialType.System_Object })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
3069return ((INamedTypeSymbol)symbol).TypeKind == TypeKind.Enum; 3072return target.IsType && ((ITypeSymbol)target).TypeKind == TypeKind.Enum;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (4)
59typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Class).Concat( 60typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Interface).Concat( 61typeParameter.ConstraintTypes.Where(t => t.TypeKind is not TypeKind.Class and not TypeKind.Interface)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (2)
53if (symbol.ContainingType.TypeKind == TypeKind.Submission) 67if (symbol.TypeKind != TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (4)
197if (symbol is { TypeKind: TypeKind.Error, Name: "var" }) 234if (innerType.TypeKind != TypeKind.Pointer) 269if (symbol.ContainingType.TypeKind != TypeKind.Submission) 288if (symbol.TypeKind != TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
447if (type.TypeKind == TypeKind.Delegate) 1037if (parentTypes.Any(static parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate)) 1039return parentTypes.Where(parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate);
Microsoft.CodeAnalysis.Extensions.Package (45)
Symbols\INamedTypeSymbolExtensions.cs (10)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface 555TypeKind: TypeKind.Class or TypeKind.Struct
Symbols\ISymbolExtensions.cs (9)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } && 187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 226=> symbol is ITypeSymbol { TypeKind: TypeKind.Error }; 229=> symbol is ITypeSymbol { TypeKind: TypeKind.Module }; 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface }; 271=> symbol is { Kind: SymbolKind.Field, ContainingType.TypeKind: TypeKind.Enum }; 284=> symbol is { ContainingType.TypeKind: TypeKind.Module }; 308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 730if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
Symbols\ISymbolExtensions_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
Symbols\ITypeSymbolExtensions.cs (12)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract; 78=> symbol?.TypeKind == TypeKind.Module; 81=> symbol?.TypeKind == TypeKind.Interface; 84=> symbol?.TypeKind == TypeKind.Delegate; 87=> symbol?.TypeKind == TypeKind.FunctionPointer; 90=> symbol?.TypeKind == TypeKind.Struct; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes(); 262case TypeKind.Array: 263case TypeKind.Delegate: 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
Symbols\SymbolEquivalenceComparer.cs (3)
257private static TypeKind GetTypeKind(INamedTypeSymbol x) 261TypeKind.Module => TypeKind.Class,
Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
284var xTypeKind = GetTypeKind(x); 285var yTypeKind = GetTypeKind(y); 287if (xTypeKind == TypeKind.Error || 288yTypeKind == TypeKind.Error) 305var typeKind1 = GetTypeKind(type1); 308var typeKind2 = GetTypeKind(type2); 513if (x.TypeKind == TypeKind.Delegate)
Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
Microsoft.CodeAnalysis.Features (165)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.State.cs (1)
56ContainingType.TypeKind == TypeKind.Interface ||
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (2)
106=> typeSymbol.TypeKind is TypeKind.Class or TypeKind.Struct;
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (3)
85if (type.TypeKind is TypeKind.Interface or TypeKind.Pointer or TypeKind.Dynamic ||
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (4)
166return type.TypeKind is not (TypeKind.Delegate or TypeKind.Struct or TypeKind.FunctionPointer or TypeKind.Pointer);
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (2)
87if (enclosingSymbol.TypeKind is not (TypeKind.Struct or TypeKind.Class))
Completion\Providers\AbstractRecommendationServiceBasedCompletionProvider.cs (1)
121if (namedType.TypeKind == TypeKind.Interface)
Completion\Providers\ImportCompletionProvider\AbstractTypeImportCompletionProvider.cs (1)
80TypeKind: not TypeKind.Error
Completion\Providers\ImportCompletionProvider\ExtensionMemberImportCompletionHelper.SymbolComputer_Constraints.cs (5)
31=> CheckConstraints(receiverTypeSymbol, typeParameter, TypeKind.Interface, static type => type.GetAllInterfacesIncludingThis()); 34=> CheckConstraints(receiverTypeSymbol, typeParameter, TypeKind.Class, static type => type.GetBaseTypesAndThis()); 38TypeKind typeKind, 68TypeKind constraintTypeKind, 105ITypeSymbol type, TypeKind typeKind, Func<ITypeSymbol, IEnumerable<ITypeSymbol>> getInheritanceTypes)
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
317isRecord, TypeKind.Class, className, capturedTypeParameters, members: members);
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (1)
52if (type is { TypeKind: TypeKind.Error })
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
279if (collectionType.TypeKind == TypeKind.Interface && knownCollectionInterfaces.Contains(collectionType.OriginalDefinition))
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
918TypeKind.Struct, structName, typeParameters, members: members, containingAssembly: containingAssembly);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (20)
292return (symbol is IParameterSymbol { ContainingType: not { TypeKind: TypeKind.Delegate } }) 331TypeKind.Class => FeaturesResources.class_, 332TypeKind.Interface => FeaturesResources.interface_, 333TypeKind.Delegate => FeaturesResources.delegate_, 334TypeKind.Enum => FeaturesResources.enum_, 335TypeKind.TypeParameter => FeaturesResources.type_parameter, 340=> symbol.IsConst ? ((symbol.ContainingType.TypeKind == TypeKind.Enum) ? FeaturesResources.enum_value : FeaturesResources.const_field) : 3448if (oldSymbol is not INamedTypeSymbol { TypeKind: TypeKind.Delegate }) 3715=> IsMember(symbol) || symbol is INamedTypeSymbol { TypeKind: TypeKind.Delegate }; 3852if (symbol.ContainingType is { TypeKind: TypeKind.Interface }) 4762newParameter.ContainingType is INamedTypeSymbol { TypeKind: TypeKind.Delegate } newContainingDelegateType) 4770if (hasReturnTypeAttributeChange && newSymbol is INamedTypeSymbol { TypeKind: TypeKind.Delegate } newDelegateType) 5140if (record.TypeKind == TypeKind.Class) 5345(newSymbol.ContainingType.TypeKind == TypeKind.Struct) ? RudeEditKind.InsertOrMoveStructMember : RudeEditKind.InsertOrMoveTypeWithLayoutMember, 5435if (type.TypeKind == TypeKind.Struct) 5440if (type.TypeKind != TypeKind.Class) 5750if (!isStatic && oldType.TypeKind == TypeKind.Class && newType.TypeKind == TypeKind.Class) 6072var isInInterface = newMember.ContainingType.TypeKind == TypeKind.Interface; 6357=> (parameter.ContainingType.TypeKind == TypeKind.Struct) ? FeaturesResources.struct_ : FeaturesResources.class_with_explicit_or_sequential_layout;
ExtractClass\ExtractClassWithDialogCodeAction.cs (1)
89TypeKind.Class,
ExtractInterface\AbstractExtractInterfaceService.cs (4)
92if (semanticModel.GetDeclaredSymbol(typeNode, cancellationToken) is not INamedTypeSymbol { TypeKind: not TypeKind.Extension } typeToExtractFrom) 144typeKind: TypeKind.Interface, 263var candidateInterfaceName = type.TypeKind == TypeKind.Interface ? type.Name : "I" + type.Name; 323if (typeToExtractFrom.TypeKind == TypeKind.Interface)
ExtractInterface\ExtractInterfaceCodeAction.cs (1)
26=> _typeAnalysisResult.TypeToExtractFrom is { TypeKind: TypeKind.Interface }
ExtractMethod\MethodExtractor.Analyzer.cs (1)
117&& thisParameterBeingRead is { Type: { TypeKind: TypeKind.Struct, IsReadOnly: false } };
ExtractMethod\MethodExtractor.cs (2)
231if (type.TypeKind is TypeKind.Error or TypeKind.Unknown)
FindUsages\AbstractFindUsagesService_FindImplementations.cs (1)
198else if (symbol is INamedTypeSymbol { TypeKind: TypeKind.Class } namedType)
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (2)
212if (containingType?.TypeKind is not TypeKind.Class and not TypeKind.Struct)
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.State.cs (1)
67if (ContainingType == null || ContainingType.TypeKind == TypeKind.Interface)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (4)
90if (containingType?.TypeKind is not TypeKind.Class and not TypeKind.Struct) 179if (info.ContainingType != null && info.ContainingType.TypeKind != TypeKind.Interface) 300if (generateEquals && containingType.TypeKind == TypeKind.Struct)
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (9)
43if (options.TypeKind == TypeKind.Delegate) 139if (_state.BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface || argumentList.Count == 0) 219if (!(parameters.Count == 0 && options is { TypeKind: TypeKind.Struct })) 277if (_state.BaseTypeOrInterfaceOpt == null || _state.BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface) 287if (_state.BaseTypeOrInterfaceOpt != null && _state.BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface) 311private TypeKind DetermineTypeKind() 314? TypeKind.Struct 316? TypeKind.Interface 317: TypeKind.Class;
GenerateType\AbstractGenerateTypeService.State.cs (5)
253if (baseType.TypeKind is not TypeKind.Class and not TypeKind.Interface) 283(BaseTypeOrInterfaceOpt == null || BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface)) 301if (TypeToGenerateInOpt.TypeKind is not TypeKind.Class and 302not TypeKind.Module)
GenerateType\GenerateTypeOptionsResult.cs (2)
22public TypeKind TypeKind { get; } 30TypeKind typeKind,
GoToBase\FindBaseHelpers.cs (3)
18TypeKind: TypeKind.Class or TypeKind.Interface or TypeKind.Struct,
InheritanceMargin\AbstractInheritanceMarginService.cs (3)
73return !symbol.IsStatic && namedType.TypeKind is TypeKind.Interface or TypeKind.Class or TypeKind.Struct;
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (3)
324if (memberSymbol.TypeKind == TypeKind.Interface) 337Debug.Assert(memberSymbol.TypeKind is TypeKind.Class or TypeKind.Struct);
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
439if (parameterType.TypeKind != TypeKind.Enum)
InitializeParameter\AbstractInitializeParameterCodeRefactoringProvider.cs (1)
84methodSymbol.ContainingType.TypeKind == TypeKind.Interface)
IntroduceVariable\AbstractIntroduceVariableService.State.cs (1)
98if (containingType?.TypeKind is TypeKind.Interface)
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (2)
556if (symbol.TypeKind == TypeKind.Delegate) 635if (symbol.ContainingType != null && symbol.ContainingType.TypeKind == TypeKind.Enum)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
67public TypeKind TypeKind => _symbol.TypeKind;
MoveStaticMembers\AbstractMoveStaticMembersRefactoringProvider.cs (1)
58if (containingType.TypeKind == TypeKind.Enum)
MoveStaticMembers\MoveStaticMembersWithDialogCodeAction.cs (1)
154private static TypeKind GetNewTypeKind(INamedTypeSymbol oldType)
PullMemberUp\MemberAndDestinationValidator.cs (2)
17if (destination.TypeKind is not TypeKind.Interface and not TypeKind.Class)
PullMemberUp\MembersPuller.cs (5)
66TypeKind.Interface => PullMembersIntoInterfaceAsync(document, pullMembersUpOptions, cancellationToken), 68TypeKind.Class or TypeKind.Module => PullMembersIntoClassAsync(document, pullMembersUpOptions, cancellationToken), 127if (analysisResult.Member.ContainingType.TypeKind == TypeKind.Interface) 492return destination.TypeKind == TypeKind.Interface
PullMemberUp\PullMembersUpOptionsBuilder.cs (1)
18if (destination.TypeKind == TypeKind.Interface)
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (1)
379if (property.ContainingType.TypeKind == TypeKind.Interface)
RQName\RQNodeBuilder.cs (3)
289else if (symbol.TypeKind == TypeKind.TypeParameter) 293else if (symbol.TypeKind == TypeKind.Unknown) 297else if (symbol.TypeKind == TypeKind.Dynamic)
Shared\Extensions\ISymbolExtensions_2.cs (9)
41if (containingType != null && containingType.TypeKind == TypeKind.Enum) 61case TypeKind.Extension: 62case TypeKind.Class: 66case TypeKind.Delegate: 70case TypeKind.Enum: 74case TypeKind.Interface: 78case TypeKind.Module: 82case TypeKind.Struct: 86case TypeKind.Error:
Snippets\SnippetFunctionService.cs (1)
60if (typeSymbol?.TypeKind != TypeKind.Enum)
Snippets\SnippetProviders\AbstractTypeSnippetProvider.cs (2)
19TypeKind typeKind, string defaultPrefix) 23private readonly TypeKind _typeKind = typeKind;
src\roslyn\src\Analyzers\Core\Analyzers\PopulateSwitch\AbstractPopulateSwitchDiagnosticAnalyzer.cs (2)
90if (typeWithoutNullable.TypeKind == TypeKind.Enum) 122if (type.RemoveNullableIfPresent()?.TypeKind != TypeKind.Enum)
src\roslyn\src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchExpressionHelpers.cs (1)
27if (switchExpressionType?.TypeKind == TypeKind.Enum)
src\roslyn\src\Analyzers\Core\Analyzers\PopulateSwitch\PopulateSwitchStatementHelpers.cs (1)
68if (switchExpressionType?.TypeKind == TypeKind.Enum)
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
183if (value.Type.TypeKind == TypeKind.Dynamic)
src\roslyn\src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (3)
177if (namedType.TypeKind is not TypeKind.Class and not TypeKind.Struct and not TypeKind.Module)
src\roslyn\src\Analyzers\Core\CodeFixes\AddAccessibilityModifiers\AddAccessibilityModifiersHelpers.cs (1)
50if (symbol.ContainingType?.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (4)
403return TypeToGenerateIn?.TypeKind is (TypeKind?)TypeKind.Class or (TypeKind?)TypeKind.Struct;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.State.cs (2)
58baseType.TypeKind == TypeKind.Error) 108if (classType.TypeKind == TypeKind.Struct)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (11)
19protected static readonly ISet<TypeKind> EnumType = new HashSet<TypeKind> { TypeKind.Enum }; 20protected static readonly ISet<TypeKind> ClassInterfaceModuleStructTypes = new HashSet<TypeKind> 22TypeKind.Class, 23TypeKind.Module, 24TypeKind.Struct, 25TypeKind.Interface 31ISet<TypeKind> typeKinds) 42if (typeToGenerateIn.TypeKind == TypeKind.Interface && isStatic)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateConversionService.cs (2)
24protected abstract bool TryInitializeImplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, [NotNullWhen(true)] out IMethodSymbol? methodSymbol, [NotNullWhen(true)] out INamedTypeSymbol? typeToGenerateIn); 25protected abstract bool TryInitializeExplicitConversionState(SemanticDocument document, SyntaxNode expression, ISet<TypeKind> classInterfaceModuleStructTypes, CancellationToken cancellationToken, out SyntaxToken identifierToken, [NotNullWhen(true)] out IMethodSymbol? methodSymbol, [NotNullWhen(true)] out INamedTypeSymbol? typeToGenerateIn);
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.AbstractInvocationInfo.cs (2)
59var classTypes = constraints.Where(ts => ts.TypeKind == TypeKind.Class).ToList(); 60var nonClassTypes = constraints.Where(ts => ts.TypeKind != TypeKind.Class).ToList();
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.CodeAction.cs (2)
76generateMethodBodies: _state.TypeToGenerateIn.TypeKind != TypeKind.Interface)), 92generateMethodBodies: _state.TypeToGenerateIn.TypeKind != TypeKind.Interface,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.cs (1)
47state.TypeToGenerateIn.TypeKind != TypeKind.Interface &&
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.SignatureInfo.cs (2)
193return isAbstract || State.TypeToGenerateIn.TypeKind == TypeKind.Interface || throwStatement == null 225if (State.TypeToGenerateIn.TypeKind != TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateParameterizedMember\AbstractGenerateParameterizedMemberService.State.cs (1)
73generateMethodBodies: TypeToGenerateIn.TypeKind != TypeKind.Interface,
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.CodeAction.cs (2)
118return _state.TypeToGenerateIn.TypeKind != TypeKind.Interface && _refKind != RefKind.None 125if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (3)
98if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface && state.IsStatic) 108var isOnlyReadAndIsInInterface = state.TypeToGenerateIn.TypeKind == TypeKind.Interface && !state.IsWrittenTo; 142if (state.TypeToGenerateIn.TypeKind != TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.State.cs (1)
86if (this.TypeToGenerateIn.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementHelpers.cs (2)
226if (state.ClassOrStructType.TypeKind != TypeKind.Class) 249if (idisposable?.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
272var condition1 = typeParameter.ConstraintTypes.Count(t => t.TypeKind == TypeKind.Class) >= 2;
src\roslyn\src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
40type.TypeKind == TypeKind.Class && type.IsSealed && !type.IsStatic)
src\roslyn\src\Analyzers\Core\CodeFixes\UseConditionalExpression\AbstractUseConditionalExpressionCodeFixProvider.cs (2)
195conversion.Type.TypeKind != TypeKind.Error) 199if (conversion.Operand.Type == null || conversion.Operand.Type.TypeKind != TypeKind.Error)
Microsoft.CodeAnalysis.Razor.Compiler (17)
CSharp\CompilationExtensions.cs (2)
26if (type is null || type.TypeKind == TypeKind.Error) 44byteType.TypeKind == TypeKind.Error)
CSharp\CompilationTagHelperFeature.cs (1)
44return @string != null && @string.TypeKind != TypeKind.Error;
CSharp\DefaultTagHelperDescriptorFactory.cs (1)
213if (property.Type.TypeKind == TypeKind.Enum)
CSharp\DefaultUtf8WriteLiteralFeature.cs (2)
109if (type is not null && type.TypeKind != TypeKind.Error) 202if (symbol is not null && symbol.TypeKind != TypeKind.Error)
Language\Extensions\INamedTypeSymbolExtensions.cs (1)
11=> symbol.TypeKind != TypeKind.Error &&
Language\TagHelpers\Producers\ComponentTagHelperProducer.cs (3)
373Parameters: [{ Type.TypeKind: TypeKind.Delegate }] 707return property.Type.TypeKind == TypeKind.Enum; 726return property.Type.TypeKind == TypeKind.Delegate;
Language\TagHelpers\Producers\DefaultTagHelperProducer.Factory.cs (1)
21iTagHelperType.TypeKind == TypeKind.Error)
Mvc.Version1_X\ViewComponentTagHelperDescriptorFactory.cs (1)
196if (parameter.Type.TypeKind == TypeKind.Enum)
Mvc.Version1_X\ViewComponentTagHelperProducer.Factory.cs (1)
22viewComponentAttributeType.TypeKind == TypeKind.Error)
Mvc.Version2_X\ViewComponentTagHelperDescriptorFactory.cs (1)
211if (parameter.Type.TypeKind == TypeKind.Enum)
Mvc.Version2_X\ViewComponentTagHelperProducer.Factory.cs (1)
22viewComponentAttributeType.TypeKind == TypeKind.Error)
Mvc\ViewComponentTagHelperDescriptorFactory.cs (1)
214if (parameter.Type.TypeKind == TypeKind.Enum)
Mvc\ViewComponentTagHelperProducer.Factory.cs (1)
22viewComponentAttributeType.TypeKind == TypeKind.Error)
Microsoft.CodeAnalysis.ResxSourceGenerator (99)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (5)
134case TypeKind.Class: 135case TypeKind.Interface: 146case TypeKind.Struct: 147case TypeKind.Enum: 148case TypeKind.Delegate:
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
520=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
113if (type1.TypeKind == TypeKind.TypeParameter && 114type2.TypeKind == TypeKind.TypeParameter &&
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (5)
48case TypeKind.Class: 49if (type.TypeKind == TypeKind.Interface) 56case TypeKind.Interface: 71if (!baseTypesOnly && candidateBaseType.TypeKind == TypeKind.Interface) 86if (checkTypeParameterConstraints && symbol.TypeKind == TypeKind.TypeParameter)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
412namedType.TypeKind != TypeKind.Interface ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\CollectionExpressionUtilities.cs (1)
112if (!(namedType.TypeKind == TypeKind.Struct && noArgConstructor.IsImplicitlyDeclared))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
147if (type.TypeKind == TypeKind.Array && typeArguments.IsEmpty)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (13)
104private static readonly SymbolKindOrTypeKind s_class = new(TypeKind.Class); 105private static readonly SymbolKindOrTypeKind s_struct = new(TypeKind.Struct); 106private static readonly SymbolKindOrTypeKind s_interface = new(TypeKind.Interface); 107private static readonly SymbolKindOrTypeKind s_enum = new(TypeKind.Enum); 113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 329case TypeKind.Class: 332case TypeKind.Struct: 335case TypeKind.Interface: 338case TypeKind.Enum: 341case TypeKind.Delegate: 344case TypeKind.Module: 347case TypeKind.Pointer: 350case TypeKind.TypeParameter:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
66if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (20)
62new SymbolKindOrTypeKind(TypeKind.Class), 63new SymbolKindOrTypeKind(TypeKind.Struct), 64new SymbolKindOrTypeKind(TypeKind.Interface), 65new SymbolKindOrTypeKind(TypeKind.Delegate), 66new SymbolKindOrTypeKind(TypeKind.Enum), 67new SymbolKindOrTypeKind(TypeKind.Module), 68new SymbolKindOrTypeKind(TypeKind.Pointer), 75new SymbolKindOrTypeKind(TypeKind.TypeParameter), 293foreach (var typeKindElement in symbolKindListElement.Elements(nameof(TypeKind))) 344public SymbolKindOrTypeKind(TypeKind typeKind) 355public TypeKind? TypeKind => (_category == SymbolCategory.Type) ? (TypeKind)_kind : null; 362SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind, 371SymbolCategory.Type => new XElement(nameof(TypeKind), GetTypeKindString((TypeKind)_kind)), 376private static string GetTypeKindString(TypeKind typeKind) 383CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct), 433=> new((TypeKind)Enum.Parse(typeof(TypeKind), typeKindElement.Value)); 441public static implicit operator SymbolKindOrTypeKind(TypeKind symbolKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
407if (namedTypeSymbol.TypeKind == TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
22var isError = symbol.TupleUnderlyingType!.TypeKind == TypeKind.Error;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (10)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface 555TypeKind: TypeKind.Class or TypeKind.Struct
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (9)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } && 187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 226=> symbol is ITypeSymbol { TypeKind: TypeKind.Error }; 229=> symbol is ITypeSymbol { TypeKind: TypeKind.Module }; 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface }; 271=> symbol is { Kind: SymbolKind.Field, ContainingType.TypeKind: TypeKind.Enum }; 284=> symbol is { ContainingType.TypeKind: TypeKind.Module }; 308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 730if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (12)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract; 78=> symbol?.TypeKind == TypeKind.Module; 81=> symbol?.TypeKind == TypeKind.Interface; 84=> symbol?.TypeKind == TypeKind.Delegate; 87=> symbol?.TypeKind == TypeKind.FunctionPointer; 90=> symbol?.TypeKind == TypeKind.Struct; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes(); 262case TypeKind.Array: 263case TypeKind.Delegate: 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (3)
257private static TypeKind GetTypeKind(INamedTypeSymbol x) 261TypeKind.Module => TypeKind.Class,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
284var xTypeKind = GetTypeKind(x); 285var yTypeKind = GetTypeKind(y); 287if (xTypeKind == TypeKind.Error || 288yTypeKind == TypeKind.Error) 305var typeKind1 = GetTypeKind(type1); 308var typeKind2 = GetTypeKind(type2); 513if (x.TypeKind == TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
Microsoft.CodeAnalysis.VisualBasic (655)
Analysis\FlowAnalysis\DataFlowPass.vb (2)
457If receiverOpt.Type Is Nothing OrElse receiverOpt.Type.TypeKind <> TypeKind.Structure Then 1279ElseIf type.TypeKind = TypeKind.TypeParameter Then
Analysis\FlowAnalysis\RegionReachableWalker.vb (1)
9Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Analysis\IteratorAndAsyncAnalysis\IteratorAndAsyncCaptureWalker.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\BackstopBinder.vb (1)
16Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\BasesBeingResolvedBinder.vb (1)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\Binder.vb (2)
17Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 456If type.TypeKind = TypeKind.Error AndAlso TypeOf type Is MissingMetadataTypeSymbol.TopLevel Then
Binding\Binder_AnonymousTypes.vb (1)
13Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\Binder_Attributes.vb (1)
15Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\Binder_ConditionalAccess.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\Binder_Conversions.vb (7)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 790Case TypeKind.Delegate 797Case TypeKind.Interface 1231If targetType.TypeKind <> TypeKind.Delegate AndAlso targetType.TypeKind <> TypeKind.Error Then 1383If(targetDelegateType.TypeKind = TypeKind.Delegate AndAlso targetDelegateType.IsFromCompilation(Me.Compilation), 1435If(targetDelegateType.TypeKind = TypeKind.Delegate AndAlso targetDelegateType.IsFromCompilation(Me.Compilation),
Binding\Binder_Delegates.vb (3)
10Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 234ElseIf targetType.TypeKind <> TypeKind.Delegate Then 236If targetType.TypeKind <> TypeKind.Error Then
Binding\Binder_Diagnostics.vb (1)
8Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\Binder_Expressions.vb (22)
1070type.TypeKind <> TYPEKIND.Class Then 1210Case TYPEKIND.Class 1213Case TYPEKIND.Interface 1216Case TYPEKIND.Enum 1219Case TYPEKIND.Structure 2605If currentType.TypeKind = TYPEKIND.Submission AndAlso Not currentMember.IsShared Then 2606If memberDeclaringType.TypeKind = TYPEKIND.Submission Then 2740If CaseInsensitiveComparison.Equals(leftType.Name, leftName) AndAlso leftType.TypeKind <> TYPEKIND.TypeParameter Then 2823Dim leftTypeKind As TYPEKIND = leftTypeSymbol.TypeKind 2825If leftTypeKind = TYPEKIND.Class OrElse leftTypeKind = TYPEKIND.Structure OrElse leftTypeKind = TYPEKIND.Module Then 2908If type.TypeKind = TYPEKIND.TypeParameter Then 3804Case TYPEKIND.Array, TYPEKIND.Enum 3806Case TYPEKIND.Class 3812Case TYPEKIND.TypeParameter, TYPEKIND.Interface 3814Case TYPEKIND.Structure 3841Case TYPEKIND.Class 3844Case TYPEKIND.Structure 3847Case TYPEKIND.Error
Binding\Binder_Invocation.vb (1)
288ElseIf targetType.Kind = SymbolKind.NamedType AndAlso targetType.TypeKind = TypeKind.Delegate Then
Binding\Binder_Latebound.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\Binder_Lookup.vb (35)
16Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 580Case TypeKind.Class, TypeKind.Module, TypeKind.Structure, TypeKind.Delegate, TypeKind.Array, TypeKind.Enum 583Case TypeKind.Submission 586Case TypeKind.Interface 589Case TypeKind.TypeParameter 592Case TypeKind.Error 606Case TypeKind.Class, TypeKind.Structure, TypeKind.Delegate, TypeKind.Array, TypeKind.Enum 609Case TypeKind.Module 612Case TypeKind.Submission 615Case TypeKind.Interface 618Case TypeKind.TypeParameter 621Case TypeKind.Error 931Case TypeKind.Class, TypeKind.Module, TypeKind.Structure 936Case TypeKind.Interface 941Case TypeKind.TypeParameter 1092Case TypeKind.Class, TypeKind.Module, TypeKind.Structure 1104Case TypeKind.Interface 1116Case TypeKind.TypeParameter 1697Case TypeKind.Interface 1710Case TypeKind.TypeParameter 1964(container.TypeKind = TypeKind.Class OrElse container.TypeKind = TypeKind.Structure) AndAlso
Binding\Binder_ObjectInitializer.vb (18)
80Case TypeKind.Delegate 84Case TypeKind.Structure 211Case TypeKind.Class 220Case TypeKind.Interface 226Case TypeKind.Error, 227TypeKind.Interface 233Case TypeKind.Array 239Case TypeKind.Class, 240TypeKind.Delegate, 241TypeKind.Enum, 242TypeKind.Module, 243TypeKind.Structure 297Case TypeKind.Error 304Case TypeKind.TypeParameter 325Case TypeKind.Enum, TypeKind.Structure 328Case TypeKind.Module 335Case TypeKind.Array
Binding\Binder_SelectCase.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\Binder_Statements.vb (1)
1001If Me.ContainingType IsNot Nothing AndAlso Me.ContainingType.TypeKind = TYPEKIND.Structure Then
Binding\Binder_Utils.vb (6)
1161Case TypeKind.Module 1180Case TypeKind.Interface 1189Case TypeKind.Structure 1241Case TypeKind.Module 1253Case TypeKind.Interface 1262Case TypeKind.Structure
Binding\Binder_WithBlock.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\BinderFactory.vb (1)
395containingType.TypeKind = TypeKind.Delegate Then
Binding\Binders\AliasAndImportsClause.vb (1)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\DocumentationCommentBinder.vb (1)
44If commentedNamedType IsNot Nothing AndAlso commentedNamedType.TypeKind <> TypeKind.Delegate Then
Binding\DocumentationCommentParamBinder.vb (1)
30If namedType.TypeKind = TypeKind.Delegate Then
Binding\EarlyWellKnownAttributeBinder.vb (1)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\ExecutableCodeBinder.vb (1)
16Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\GetTypeBinder.vb (1)
10Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\IgnoreBaseClassesBinder.vb (1)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\ImportAliasesBinder.vb (1)
16Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\ImportedTypesAndNamespacesMembersBinder.vb (1)
16Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\LocationSpecificBinder.vb (1)
15Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\LookupResult.vb (1)
740If symbol1.Kind <> SymbolKind.Field OrElse symbol2.Kind <> SymbolKind.Field OrElse symbol1.ContainingType.TypeKind <> TypeKind.Enum Then
Binding\MemberSemanticModel.vb (1)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\MethodBodyBinder.vb (1)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\MethodTypeParametersBinder.vb (1)
15Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\NamedTypeBinder.vb (1)
16Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\NamespaceBinder.vb (1)
16Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\OptionStrictOffBinder.vb (1)
9Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\ProjectImportsBinder.vb (1)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\SourceFileBinder.vb (1)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\SourceModuleBinder.vb (1)
15Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\SpeculativeStatementBinder.vb (1)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Binding\TypesOfImportedNamespacesMembersBinder.vb (1)
16Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
BoundTree\BoundNewT.vb (1)
16Debug.Assert(Type.TypeKind = TypeKind.TypeParameter)
CodeGen\EmitAddress.vb (1)
471If receiverType.TypeKind = TypeKind.TypeParameter Then
CodeGen\EmitExpression.vb (5)
317(receiverType.IsReferenceType AndAlso receiverType.TypeKind = TypeKind.TypeParameter) OrElse 519Debug.Assert(thisType.TypeKind <> TypeKind.TypeParameter) 641If elementType.TypeKind = TypeKind.TypeParameter Then 1734If ((type IsNot Nothing) AndAlso (type.TypeKind = TypeKind.TypeParameter) AndAlso constantValue.IsNull) Then 1854Return AllowedToTakeRef(left, AddressKind.Writeable) AndAlso Not (left.Kind = BoundKind.ArrayAccess AndAlso left.Type.TypeKind = TypeKind.TypeParameter)
CodeGen\EmitStatement.vb (2)
367Debug.Assert(receiver.Type.TypeKind <> TypeKind.TypeParameter) 914If (operandType IsNot Nothing) AndAlso (operandType.TypeKind = TypeKind.TypeParameter) Then
CodeGen\Optimizer\Optimizer.vb (1)
9Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
CodeGen\Optimizer\StackScheduler.Analyzer.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
CodeGen\Optimizer\StackScheduler.Rewriter.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
CodeGen\Optimizer\StackScheduler.vb (1)
10Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
CommandLine\VisualBasicCommandLineArguments.vb (1)
17Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Compilation\ClsComplianceChecker.vb (26)
186If symbol.TypeKind = TypeKind.Delegate Then 340ElseIf symbol.TypeKind = TypeKind.Enum Then 439If type.TypeKind = TypeKind.Delegate AndAlso type.IsImplicitlyDeclared AndAlso TryCast(type, NamedTypeSymbol)?.AssociatedSymbol Is symbol Then 591Case TypeKind.Array 593Case TypeKind.Error, TypeKind.TypeParameter 595Case TypeKind.Class, TypeKind.Structure, TypeKind.Interface, TypeKind.Delegate, TypeKind.Enum, TypeKind.Submission, TypeKind.Module 617Case TypeKind.Array 619Case TypeKind.Error, TypeKind.TypeParameter 621Case TypeKind.Class, TypeKind.Structure, TypeKind.Interface, TypeKind.Delegate, TypeKind.Enum, TypeKind.Submission, TypeKind.Module 636If type.TypeKind = TypeKind.Error Then 892Dim typeKind As TypeKind = xType.TypeKind 897If typeKind = TypeKind.Array Then
Compilation\DocumentationComments\DocumentationCommentCompiler.Common.vb (7)
737Case TypeKind.Class 739Case TypeKind.Delegate 741Case TypeKind.Enum 743Case TypeKind.Interface 745Case TypeKind.Module 747Case TypeKind.Structure 768If namedType.TypeKind <> TypeKind.Delegate Then
Compilation\DocumentationComments\DocumentationCommentCompiler.Includes.vb (5)
123If namedType.TypeKind = TYPEKIND.Delegate Then 131Me.ParamAndParamRefSupported = namedType.TypeKind = TYPEKIND.Delegate 132Me.TypeParamSupported = namedType.TypeKind <> TYPEKIND.Enum AndAlso namedType.TypeKind <> TYPEKIND.Module 133Me.TypeParamRefSupported = namedType.TypeKind <> TYPEKIND.Module
Compilation\DocumentationComments\DocumentationCommentCompiler.NamedType.vb (5)
107If namedType.TypeKind = TypeKind.Delegate Then 116If namedType.TypeKind = TypeKind.Delegate Then 127If namedType.TypeKind = TypeKind.Enum Then 132ElseIf namedType.TypeKind = TypeKind.Enum OrElse namedType.TypeKind = TypeKind.Module Then
Compilation\MethodCompiler.vb (1)
866If sourceTypeSymbol.TypeKind = TypeKind.Class AndAlso sourceTypeSymbol.GetAttributes().IndexOfAttribute(AttributeDescription.DesignerGeneratedAttribute) > -1 Then
Compilation\SemanticModel.vb (1)
965If highestExpr.Type IsNot Nothing AndAlso highestExpr.Type.TypeKind <> TypeKind.Error Then
Compilation\SyntaxTreeSemanticModel.vb (2)
17Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 1080Debug.Assert(typeSymbol.TypeKind = TYPEKIND.Delegate)
Compilation\VisualBasicCompilation.vb (3)
1545If mainType Is Nothing OrElse (mainType.TypeKind <> TYPEKIND.Class AndAlso mainType.TypeKind <> TYPEKIND.Structure AndAlso mainType.TypeKind <> TYPEKIND.Module) Then
Emit\EditAndContinue\PEDeltaAssemblyBuilder.vb (1)
199If propertyType.TypeKind = TypeKind.TypeParameter Then
Emit\NamedTypeReference.vb (1)
49Return m_UnderlyingNamedType.TypeKind = TypeKind.Enum
Emit\NamedTypeSymbolAdapter.vb (8)
43Return AdaptedNamedTypeSymbol.TypeKind = TypeKind.Enum 243If AdaptedNamedTypeSymbol.TypeKind = TypeKind.Submission Then 462Case TypeKind.Enum, TypeKind.Interface, TypeKind.Delegate 973Case TypeKind.Module, TypeKind.Enum, TypeKind.Structure
Emit\NoPia\EmbeddedType.vb (3)
128Case TypeKind.Enum, TypeKind.Delegate, TypeKind.Interface
Emit\NoPia\EmbeddedTypesManager.vb (16)
254Case TypeKind.Interface 269Case TypeKind.Structure, 270TypeKind.Enum, 271TypeKind.Delegate 289Debug.Assert(type.TypeKind = TypeKind.Class OrElse type.TypeKind = TypeKind.Module) 364Debug.Assert(namedType.TypeKind = TypeKind.Structure OrElse 365namedType.TypeKind = TypeKind.Enum OrElse 366namedType.TypeKind = TypeKind.Delegate) 369If namedType.TypeKind = TypeKind.Structure OrElse namedType.TypeKind = TypeKind.Enum Then 415If containerKind = TypeKind.Interface OrElse 416containerKind = TypeKind.Delegate OrElse 417(containerKind = TypeKind.Structure AndAlso (field.AdaptedFieldSymbol.IsShared OrElse field.AdaptedFieldSymbol.DeclaredAccessibility <> Accessibility.Public)) Then 449Case TypeKind.Structure, TypeKind.Enum
Lowering\AsyncRewriter\AsyncRewriter.AsyncMethodToClassRewriter.Expressions.vb (1)
17Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\AsyncRewriter\AsyncRewriter.AsyncMethodToClassRewriter.Spilling.vb (1)
514If type.TypeKind <> TypeKind.Structure Then
Lowering\AsyncRewriter\AsyncRewriter.vb (5)
91Dim kind = If(compilationState.Compilation.Options.EnableEditAndContinue, TypeKind.Class, TypeKind.Struct) 141If frameType.TypeKind = TypeKind.Class Then 185If Me.F.CurrentType.TypeKind = TypeKind.Class Then 200If StateMachineType.TypeKind = TypeKind.Class Then
Lowering\AsyncRewriter\AsyncStateMachine.vb (4)
14Private ReadOnly _typeKind As TypeKind 17Protected Friend Sub New(slotAllocatorOpt As VariableSlotAllocator, compilationState As TypeCompilationState, asyncMethod As MethodSymbol, asyncMethodOrdinal As Integer, typeKind As TypeKind) 22asyncMethod.ContainingAssembly.GetSpecialType(If(typeKind = TypeKind.Struct, SpecialType.System_ValueType, SpecialType.System_Object)), 30Public Overrides ReadOnly Property TypeKind As TypeKind
Lowering\Diagnostics\DiagnosticsPass.vb (1)
15Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter.vb (2)
17Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 461Debug.Assert(delegateType.TypeKind = TYPEKIND.Delegate)
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_ConditionalExpresion.vb (1)
16Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_Conversion.vb (1)
15Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_UnaryOperator.vb (1)
16Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\IteratorRewriter\IteratorStateMachine.vb (2)
62Public Overrides ReadOnly Property TypeKind As TypeKind 64Return TypeKind.Class
Lowering\LambdaRewriter\LambdaCapturedVariable.vb (1)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LambdaRewriter\LambdaFrame.vb (2)
214Public Overrides ReadOnly Property TypeKind As TypeKind 216Return TypeKind.Class
Lowering\LambdaRewriter\LambdaFrameCopyConstructor.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_AnonymousTypeCreationExpression.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_AsNewLocalDeclarations.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_Block.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_Call.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_ConditionalAccess.vb (2)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 102(receiverType.IsReferenceType AndAlso receiverType.TypeKind = TypeKind.TypeParameter) OrElse
Lowering\LocalRewriter\LocalRewriter_Constant.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_Continue.vb (1)
10Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_DimStatement.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_DoLoop.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_Exit.vb (1)
10Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_ExpressionStatement.vb (1)
10Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_FieldAccess.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_FieldOrPropertyInitializer.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_ForEach.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_ForTo.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_Goto.vb (1)
10Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_Label.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_Lambda.vb (1)
10Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_LateAddressOf.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_LateInvocation.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_LateMemberAccess.vb (1)
10Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_OmittedArgument.vb (1)
10Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_PreviousSubmissionReference.vb (1)
15Debug.Assert(targetType.TypeKind = TypeKind.Submission)
Lowering\LocalRewriter\LocalRewriter_Query.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_Redim.vb (1)
10Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_RedimClause.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_Return.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_SelectCase.vb (1)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_StringConcat.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_SyncLock.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_Throw.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_Try.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_UnaryOperators.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_UnstructuredExceptionHandling.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_Using.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_While.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\LocalRewriter\LocalRewriter_With.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\StateMachineRewriter\SynthesizedContainer.vb (1)
110Public MustOverride Overrides ReadOnly Property TypeKind As TypeKind
Lowering\UseTwiceRewriter.vb (1)
13Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Lowering\WithExpressionRewriter.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
OptionsValidator.vb (1)
11Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Semantics\AccessCheck.vb (7)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 232If containingType.TypeKind = TypeKind.Submission Then 287If originalContainingType.TypeKind = TypeKind.Submission Then 444Case TypeKind.Interface 446Case TypeKind.TypeParameter 506Case TypeKind.Interface 511Case TypeKind.TypeParameter
Semantics\Conversions.vb (17)
1745If destination.TypeKind = TypeKind.Enum AndAlso 1750If source.TypeKind = TypeKind.Enum AndAlso 1754ElseIf source.TypeKind = TypeKind.Enum AndAlso destination.TypeKind = TypeKind.Enum Then 1996(src.TypeKind <> TypeKind.Class OrElse DirectCast(src, NamedTypeSymbol).IsNotInheritable) AndAlso 2018(dst.TypeKind <> TypeKind.Class OrElse DirectCast(dst, NamedTypeSymbol).IsNotInheritable) AndAlso 2452If Not base.IsErrorType() AndAlso base.TypeKind = TypeKind.Class AndAlso 2865Case TypeKind.Class, 2866TypeKind.Module 2872Case TypeKind.Delegate 2878Case TypeKind.Interface 2884Case TypeKind.Array 2912Return type.TypeKind = TypeKind.Delegate 2916Return type.TypeKind = TypeKind.Array 3365If type.TypeKind = TypeKind.Enum Then 3784ElseIf constraint.TypeKind = TypeKind.Enum AndAlso 3948ElseIf constraint.TypeKind = TypeKind.Enum AndAlso
Semantics\Operators.vb (1)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Semantics\OverloadResolution.vb (5)
15Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 2411left.TypeKind = TypeKind.Enum AndAlso right.TypeKind <> TypeKind.Enum Then 2427right.TypeKind = TypeKind.Enum AndAlso left.TypeKind <> TypeKind.Enum Then
Semantics\TypeInference\TypeArgumentInference.vb (5)
1779Dim fixedTypeTypeKind As TypeKind = fixedType.TypeKind 1781If fixedTypeTypeKind <> TypeKind.Class AndAlso fixedTypeTypeKind <> TypeKind.Interface Then 1805If fixedTypeTypeKind = TypeKind.Class Then 1808Debug.Assert(fixedTypeTypeKind = TypeKind.Interface)
SymbolDisplay\SymbolDisplayVisitor.Members.vb (3)
29If symbol.ContainingType.TypeKind = TypeKind.Enum Then 616(containingType.TypeKind <> TypeKind.Interface AndAlso Not IsEnumMember(symbol))) Then 620(containingType Is Nothing OrElse containingType.TypeKind <> TypeKind.Module) AndAlso
SymbolDisplay\SymbolDisplayVisitor.Types.vb (19)
202symbol.TypeKind = TypeKind.Delegate AndAlso 257Case TypeKind.Class, 258TypeKind.Submission, 259TypeKind.Extension 261Case TypeKind.Delegate 263Case TypeKind.Enum 265Case TypeKind.Interface 267Case TypeKind.Module 269Case TypeKind.Struct 271Case TypeKind.Error 331Case TypeKind.Class 342Case TypeKind.Delegate 456Private Shared Function GetTypeKindKeyword(typeKind As TypeKind) As SyntaxKind 458Case TypeKind.Enum 460Case TypeKind.Class 462Case TypeKind.Delegate 464Case TypeKind.Interface 466Case TypeKind.Module 468Case TypeKind.Struct
SymbolDisplay\SymbolDisplayVisitor.vb (2)
349(containingType.TypeKind <> TypeKind.Interface AndAlso Not IsEnumMember(symbol))) Then 396symbol.ContainingType.TypeKind = TypeKind.Enum AndAlso
SymbolDisplay\SymbolDisplayVisitor_Minimal.vb (1)
107If symbol.TypeKind <> TypeKind.Error Then
Symbols\AnonymousTypes\AnonymousType_SymbolCollection.vb (2)
97Case TypeKind.Class 105Case TypeKind.Delegate
Symbols\AnonymousTypes\AnonymousTypeManager_Templates.vb (2)
185Case TypeKind.Delegate 188Case TypeKind.Class
Symbols\AnonymousTypes\PublicSymbols\AnonymousDelegate_TypePublicSymbol.vb (2)
121Public Overrides ReadOnly Property TypeKind As TypeKind 123Return TypeKind.Delegate
Symbols\AnonymousTypes\PublicSymbols\AnonymousType_TypePublicSymbol.vb (2)
147Public Overrides ReadOnly Property TypeKind As TypeKind 149Return TypeKind.Class
Symbols\AnonymousTypes\PublicSymbols\AnonymousTypeOrDelegatePublicSymbol.vb (3)
21Debug.Assert((TypeKind = TypeKind.Class AndAlso TypeOf Me Is AnonymousTypePublicSymbol) OrElse 22(TypeKind = TypeKind.Delegate AndAlso TypeOf Me Is AnonymousDelegatePublicSymbol)) 64Public MustOverride Overrides ReadOnly Property TypeKind As TYPEKIND
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousDelegate_TemplateSymbol.vb (2)
161Public Overrides ReadOnly Property TypeKind As TypeKind 163Return TypeKind.Delegate
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_TemplateSymbol.vb (2)
134Public Overrides ReadOnly Property TypeKind As TypeKind 136Return TypeKind.Class
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousTypeOrDelegateTemplateSymbol.vb (5)
54Debug.Assert(TypeKind = TypeKind.Class OrElse TypeKind = TypeKind.Delegate) 61If TypeKind = TypeKind.Delegate AndAlso typeDescr.Fields.IsSubDescription() Then 68Debug.Assert(TypeKind = TypeKind.Delegate) 121Public MustOverride Overrides ReadOnly Property TypeKind As TypeKind
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousTypeOrDelegateTypeParameterSymbol.vb (2)
65If _container.TypeKind = TypeKind.Delegate Then 72Debug.Assert(_container.TypeKind = TypeKind.Class)
Symbols\ArrayTypeSymbol.vb (3)
256Public Overrides ReadOnly Property TypeKind As TypeKind 258Return TypeKind.Array 356While (current.TypeKind = TypeKind.Array)
Symbols\AssemblySymbol.vb (1)
741If result Is Nothing OrElse result.TypeKind = TypeKind.Error Then
Symbols\Attributes\AttributeData.vb (1)
16Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Symbols\BaseTypeAnalysis.vb (2)
124If this.TypeKind = TypeKind.Class Then 233If currentNamedType.TypeKind = TypeKind.Class Then
Symbols\ConstraintsHelper.vb (24)
162Case TypeKind.Class 215Case TypeKind.Interface, 216TypeKind.Error 218Case TypeKind.Module 222Case TypeKind.TypeParameter 247Case TypeKind.Array, 248TypeKind.Delegate, 249TypeKind.Enum, 250TypeKind.Structure 837Case TypeKind.Array, 838TypeKind.Enum, 839TypeKind.Structure 844Debug.Assert(baseType.TypeKind <> TypeKind.TypeParameter) 869Case TypeKind.TypeParameter 874Case TypeKind.Error 939Case TypeKind.Enum 942Case TypeKind.TypeParameter 954Dim isStructure As Boolean = typeArgument.TypeKind = TypeKind.Structure 958If typeArgument.TypeKind = TypeKind.Class OrElse isStructure Then 1122If type.TypeKind = TypeKind.TypeParameter Then 1166Debug.Assert(type.TypeKind = TypeKind.Class OrElse type.TypeKind = TypeKind.Structure) 1168Dim sourceClass = If(type.TypeKind = TypeKind.Class, TryCast(type, SourceNamedTypeSymbol), Nothing) 1195If Not type.TypeKind = TypeKind.Structure Then
Symbols\EmbeddedSymbols\EmbeddedSymbolManager.SymbolsCollection.vb (3)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 333Debug.Assert(type.TypeKind = TypeKind.Module OrElse type.TypeKind = TypeKind.Class AndAlso type.IsNotInheritable)
Symbols\ErrorTypeSymbol.vb (3)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 110Public NotOverridable Overrides ReadOnly Property TypeKind As TypeKind 112Return TypeKind.Error
Symbols\EventSymbol.vb (2)
15Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 171If type IsNot Nothing AndAlso type.TypeKind = TypeKind.Delegate Then
Symbols\FieldSymbol.vb (1)
13Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Symbols\Metadata\PE\MetadataDecoder.vb (4)
349Case TypeKind.Interface 359Case TypeKind.Delegate, 360TypeKind.Enum, 361TypeKind.Structure
Symbols\Metadata\PE\PEFieldSymbol.vb (1)
16Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Symbols\Metadata\PE\PEMethodSymbol.vb (1)
421If Not IsShared AndAlso String.Equals(name, WellKnownMemberNames.DelegateInvokeName, StringComparison.Ordinal) AndAlso _containingType.TypeKind = TypeKind.Delegate Then
Symbols\Metadata\PE\PENamedTypeSymbol.vb (20)
379If _lazyEnumUnderlyingType Is Nothing AndAlso TypeKind = TypeKind.Enum Then 417If (_lazyTypeKind = TypeKind.Unknown AndAlso 419Me.TypeKind <> TypeKind.Module Then 441If Me.TypeKind = TypeKind.Module Then 669Dim ensureParameterlessConstructor As Boolean = (TypeKind = TypeKind.Structure OrElse TypeKind = TypeKind.Enum) AndAlso Not IsShared 1011Public Overrides ReadOnly Property TypeKind As TypeKind 1013If _lazyTypeKind = TypeKind.Unknown Then 1015Dim result As TypeKind 1018result = TypeKind.Interface 1022result = TypeKind.Class 1030result = TypeKind.Enum 1034result = TypeKind.Delegate 1038result = TypeKind.Structure 1042result = TypeKind.Module 1050Return CType(_lazyTypeKind, TypeKind) 1154Case TypeKind.Structure 1186Case TypeKind.Enum 1330If (typeKind = TypeKind.Class OrElse typeKind = TypeKind.Module) AndAlso
Symbols\Metadata\PE\PENamespaceSymbol.vb (2)
64Dim modules = GetTypeMembers().WhereAsArray(Function(t) t.TypeKind = TYPEKIND.Module) 73Return GetTypeMembers(name).WhereAsArray(Function(t) t.TypeKind = TYPEKIND.Module)
Symbols\MethodSymbol.vb (1)
587If firstType.TypeKind <> TypeKind.Array Then
Symbols\MissingModuleSymbol.vb (1)
15Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Symbols\NamedTypeSymbol.vb (12)
15Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 232If TypeKind <> TypeKind.Delegate Then 446Return TypeKind <> TypeKind.Enum AndAlso TypeKind <> TypeKind.Structure AndAlso 447TypeKind <> TypeKind.Error 459Return TypeKind = TypeKind.Enum OrElse TypeKind = TypeKind.Structure 574Return TypeKind = TypeKind.Submission 590Dim name = If(TypeKind = TypeKind.Submission, SynthesizedEntryPointSymbol.FactoryName, SynthesizedEntryPointSymbol.MainName) 822If Me.TypeKind = TypeKind.Interface Then 1274Case TypeKind.Pointer, TypeKind.FunctionPointer
Symbols\NamedTypeSymbolExtensions.vb (1)
110Return container.TypeKind = TypeKind.Module OrElse container.IsScriptClass
Symbols\NamespaceSymbol.vb (1)
53Return GetTypeMembers(name).WhereAsArray(Function(t) t.TypeKind = TypeKind.Module)
Symbols\ParameterSymbol.vb (1)
13Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Symbols\Retargeting\RetargetingModuleSymbol.vb (1)
15Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Symbols\Retargeting\RetargetingNamedTypeSymbol.vb (2)
17Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 419Public Overrides ReadOnly Property TypeKind As TypeKind
Symbols\Source\IAttributeTargetSymbol.vb (1)
13Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Symbols\Source\ImplementsHelper.vb (1)
396ElseIf interfaceType.TypeKind = TypeKind.Error Then
Symbols\Source\ImplicitNamedTypeSymbol.vb (2)
19Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 59Return If(Me.TypeKind = TypeKind.Submission, Nothing, baseType)
Symbols\Source\OverrideHidingHelper.vb (3)
27Case TypeKind.Class, TypeKind.Interface, TypeKind.Structure
Symbols\Source\SourceComplexParameterSymbol.vb (2)
342If (flags And SourceParameterFlags.ParamArray) <> 0 AndAlso paramType.TypeKind <> TypeKind.Error Then 343If paramType.TypeKind <> TypeKind.Array Then
Symbols\Source\SourceDeclareMethodSymbol.vb (1)
44If ContainingType.TypeKind <> TypeKind.Module Then
Symbols\Source\SourceDelegateMethodSymbol.vb (1)
13Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Symbols\Source\SourceFieldSymbol.vb (1)
16Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Symbols\Source\SourceMemberContainerTypeSymbol.vb (36)
35[Class] = CUShort(TypeKind.Class) << TypeKindShift 36[Structure] = CUShort(TypeKind.Structure) << TypeKindShift 37[Interface] = CUShort(TypeKind.Interface) << TypeKindShift 38[Enum] = CUShort(TypeKind.Enum) << TypeKindShift 39[Delegate] = CUShort(TypeKind.Delegate) << TypeKindShift 40[Module] = CUShort(TypeKind.Module) << TypeKindShift 41Submission = CUShort(TypeKind.Submission) << TypeKindShift 245If type.TypeKind = TypeKind.Module Then 339Case TypeKind.Interface 342Case TypeKind.Delegate 345Case TypeKind.Class, TypeKind.Enum, TypeKind.Structure 348Case TypeKind.Module, TypeKind.Submission 1261Public Overrides ReadOnly Property TypeKind As TypeKind 1263Return CType((_flags And SourceTypeFlags.TypeKindMask) >> CUInt(SourceTypeFlags.TypeKindShift), TypeKind) 1269Return Me.TypeKind = TypeKind.Interface 1647If TypeKind <> TypeKind.Delegate Then 2675propertySymbol.ContainingType.TypeKind = TypeKind.Structure Then 2726If TypeKind = TypeKind.Submission Then 2739ElseIf TypeKind = TypeKind.Class OrElse 2740TypeKind = TypeKind.Structure OrElse 2741TypeKind = TypeKind.Enum OrElse 2742(TypeKind = TypeKind.Module AndAlso isShared) Then 2790If TypeKind <> TypeKind.Structure OrElse isShared Then 2805If TypeKind = TypeKind.Submission Then 2808ElseIf TypeKind = TypeKind.Class OrElse TypeKind = TypeKind.Module Then 3501Dim myTypeKind As TypeKind = Me.TypeKind 3504If myTypeKind = TypeKind.Class OrElse myTypeKind = TypeKind.Interface OrElse myTypeKind = TypeKind.Structure OrElse myTypeKind = TypeKind.Module Then 3508Dim canDeclareOperators As Boolean = (myTypeKind <> TypeKind.Module AndAlso myTypeKind <> TypeKind.Interface)
Symbols\Source\SourceMemberFieldSymbol.vb (2)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 529If container.TypeKind = TypeKind.Structure AndAlso
Symbols\Source\SourceMemberMethodSymbol.vb (6)
757Case TypeKind.Interface, TypeKind.Structure, TypeKind.Enum, TypeKind.Delegate 761Case TypeKind.Class, TypeKind.Module
Symbols\Source\SourceMethodSymbol.vb (4)
98If container.TypeKind = TYPEKIND.Structure Then 231If container.TypeKind = TYPEKIND.Module Then 239ElseIf container.TypeKind = TYPEKIND.Structure Then 407If container.TypeKind = TYPEKIND.Structure AndAlso methodSym.ParameterCount = 0 Then
Symbols\Source\SourceNamedTypeSymbol.vb (40)
18Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 247If TypeKind = TypeKind.Delegate Then 275ElseIf TypeKind = TypeKind.Enum Then 1117Case TypeKind.TypeParameter 1121Case TypeKind.Interface, TypeKind.Enum, TypeKind.Delegate, TypeKind.Structure, TypeKind.Module, TypeKind.Array ' array can't really occur 1125Case TypeKind.Error, TypeKind.Unknown 1128Case TypeKind.Class 1188Case TypeKind.TypeParameter 1192Case TypeKind.Unknown 1195Case TypeKind.Interface, TypeKind.Error 1239Case TypeKind.TypeParameter 1243Case TypeKind.Unknown 1246Case TypeKind.Interface, TypeKind.Error 1382Case TypeKind.Submission 1388Case TypeKind.Class 1391Case TypeKind.Interface 1394Case TypeKind.Enum 1397Case TypeKind.Structure 1400Case TypeKind.Delegate 1403Case TypeKind.Module 1510Debug.Assert(Me.TypeKind <> TypeKind.Interface) 1512If TypeKind = TypeKind.Enum Then 1515ElseIf TypeKind = TypeKind.Delegate Then 1724TypeKind <> TypeKind.Class OrElse 2267Case TypeKind.Class 2294Case TypeKind.Interface 2314Case TypeKind.Module 2349Dim defaultAutoLayoutSize = If(Me.TypeKind = TypeKind.Structure, 1, 0) 2484If Me.TypeKind = TypeKind.Module Then 2539If Me.TypeKind = TypeKind.Structure Then 2589If Me.TypeKind = TypeKind.Module Then 2735If Me.TypeKind = TypeKind.Class AndAlso Not Me.IsGenericType Then
Symbols\Source\SourceNamedTypeSymbol_ComClass.vb (2)
964Public Overrides ReadOnly Property TypeKind As TypeKind 966Return TypeKind.Interface
Symbols\Source\SourceNamedTypeSymbol_GroupClass.vb (6)
17If Me.TypeKind = TypeKind.Class AndAlso Not Me.IsGenericType Then 216If named.TypeKind = TypeKind.Class AndAlso Not named.IsNotInheritable Then 250named.TypeKind = TypeKind.Class AndAlso 292Debug.Assert(candidate.TypeKind = TypeKind.Class) 302If Me.TypeKind = TypeKind.Class Then 315Debug.Assert(Me.TypeKind = TypeKind.Class)
Symbols\Source\SourcePropertyAccessorSymbol.vb (2)
92Case TypeKind.Structure 97Case TypeKind.Module
Symbols\Source\SourcePropertySymbol.vb (1)
18Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Symbols\Source\SourceWithEventsBackingFieldSymbol.vb (1)
12Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Symbols\Source\SynthesizedMainTypeEntryPoint.vb (1)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Symbols\Source\SynthesizedMyGroupCollectionPropertyAccessorSymbol.vb (1)
15Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Symbols\Source\SynthesizedSubmissionConstructorSymbol.vb (1)
27Debug.Assert(container.TypeKind = TypeKind.Submission)
Symbols\SubstitutedNamedType.vb (2)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 212Public NotOverridable Overrides ReadOnly Property TypeKind As TypeKind
Symbols\Symbol.vb (3)
98If ContainingType.TypeKind = TypeKind.Submission Then 112If ContainingType.TypeKind = TypeKind.Submission Then 119Debug.Assert(ContainingType.TypeKind <> TypeKind.Submission)
Symbols\Symbol_Attributes.vb (8)
14Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 98Case TypeKind.Class, 99TypeKind.Module 102Case TypeKind.Structure 105Case TypeKind.Interface 108Case TypeKind.Enum 111Case TypeKind.Delegate 114Case TypeKind.Submission
Symbols\SymbolExtensions.vb (6)
35Case TypeKind.Class 37Case TypeKind.Enum 39Case TypeKind.Interface 41Case TypeKind.Structure 43Case TypeKind.Module 45Case TypeKind.Delegate
Symbols\SynthesizedSymbols\SynthesizedEventDelegateSymbol.vb (2)
367Public Overrides ReadOnly Property TypeKind As TypeKind 369Return TypeKind.Delegate
Symbols\SynthesizedSymbols\SynthesizedHotReloadExceptionSymbol.vb (2)
272Public Overrides ReadOnly Property TypeKind As TypeKind 274Return TypeKind.Class
Symbols\Tuples\TupleTypeSymbol.vb (2)
149Public Overrides ReadOnly Property TypeKind As TypeKind 153Return TypeKind.Struct
Symbols\TypedConstant.vb (1)
18Imports TypeKind = Microsoft.CodeAnalysis.TypeKind
Symbols\TypeParameterSymbol.vb (3)
146Public NotOverridable Overrides ReadOnly Property TypeKind As TypeKind 148Return TypeKind.TypeParameter 246If (constraint.TypeKind = TypeKind.TypeParameter) Then
Symbols\TypeSymbol.vb (2)
276Public MustOverride ReadOnly Property TypeKind As TYPEKIND 581Private ReadOnly Property ITypeSymbol_TypeKind As TypeKind Implements ITypeSymbol.TypeKind, ITypeSymbolInternal.TypeKind
Symbols\TypeSymbolExtensions.vb (46)
118Return type.TypeKind = TypeKind.Enum 140Return type.TypeKind = TypeKind.Class 146Return type.TypeKind = TypeKind.Structure 152Return type.TypeKind = TypeKind.Module 233Return type.TypeKind = TypeKind.Delegate 410Case TypeKind.Array, TypeKind.Delegate, TypeKind.Enum, TypeKind.Structure, TypeKind.Module 412Case TypeKind.Interface, TypeKind.TypeParameter, TypeKind.Unknown 414Case TypeKind.Error, TypeKind.Class, TypeKind.Submission 635Case TypeKind.Array 637Case TypeKind.TypeParameter 735fieldType.TypeKind = TypeKind.Enum 746If type.TypeKind = TypeKind.TypeParameter Then 761Return (type.TypeKind = TypeKind.TypeParameter) AndAlso 774Return (type.TypeKind = TypeKind.TypeParameter) AndAlso 790Private ReadOnly s_isTypeParameterFunc As Func(Of TypeSymbol, Object, Boolean) = Function(type, arg) (type.TypeKind = TypeKind.TypeParameter) 830Case TypeKind.Class, 831TypeKind.Struct, 832TypeKind.Interface, 833TypeKind.Enum, 834TypeKind.Delegate 845Case TypeKind.Submission 855Case TypeKind.Dynamic, 856TypeKind.TypeParameter, 857TypeKind.Submission, 858TypeKind.Enum, 859TypeKind.Module 863Case TypeKind.Class, 864TypeKind.Struct, 865TypeKind.Interface, 866TypeKind.Delegate, 867TypeKind.Error 883Case TypeKind.Array 1060If type.TypeKind = TypeKind.Class Then 1066If typeArgument.TypeKind = TypeKind.Delegate Then 1082If type.TypeKind = TypeKind.Delegate Then 1096If type.TypeKind = TypeKind.Delegate Then 1131If type.TypeKind = TypeKind.TypeParameter Then 1139If type.TypeKind = TypeKind.TypeParameter Then
Symbols\UnboundGenericType.vb (2)
17Imports TypeKind = Microsoft.CodeAnalysis.TypeKind 210Public Overrides ReadOnly Property TypeKind As TypeKind
Symbols\Wrapped\WrappedNamedTypeSymbol.vb (1)
78Public Overrides ReadOnly Property TypeKind As TypeKind
Microsoft.CodeAnalysis.VisualBasic.CodeStyle (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (1)
247If parameter.Type.TypeKind <> TypeKind.TypeParameter Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (30)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateDefaultConstructors\VisualBasicGenerateDefaultConstructorsService.vb (1)
35Return classType IsNot Nothing AndAlso classType.TypeKind = TypeKind.Class
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (5)
55Protected Overrides Function TryInitializeExplicitConversionState(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef identifierToken As SyntaxToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 69Protected Overrides Function TryInitializeImplicitConversionState(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef identifierToken As SyntaxToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 83Private Shared Function TryGetConversionMethodAndTypeToGenerateIn(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 113Private Shared Function TryGetExplicitConversionMethodAndTypeToGenerateIn(document As SemanticDocument, castExpression As CastExpressionSyntax, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 129Private Shared Function TryGetImplicitConversionMethodAndTypeToGenerateIn(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (1)
83interfaceTypes = interfaceTypes.WhereNotNull().Where(Function(t) t.TypeKind = TypeKind.Interface).ToImmutableArray()
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (1)
49ElseIf type?.TypeKind = TypeKind.Enum Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (8)
53declaration = If(options.Context.GenerateMembers AndAlso namedType.TypeKind <> TypeKind.Delegate, 94If namedType.TypeKind = TypeKind.Enum Then 96ElseIf namedType.TypeKind = TypeKind.Delegate Then 100Dim isInterface = namedType.TypeKind = TypeKind.Interface 101Dim isStruct = namedType.TypeKind = TypeKind.Struct 102Dim isModule = namedType.TypeKind = TypeKind.Module 187If namedType.TypeKind = TypeKind.Class Then 205If namedType.TypeKind = TypeKind.Struct OrElse
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Editing\VisualBasicImportAdder.vb (1)
114If type?.TypeKind = TypeKind.Module Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb (3)
328objectCreationType.TypeKind = TypeKind.Delegate Then 800Return DirectCast(symbol, INamedTypeSymbol).TypeKind = TypeKind.Enum 803Return target.IsType AndAlso DirectCast(target, ITypeSymbol).TypeKind = TypeKind.Enum
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContextExtensions.vb (1)
124objectCreationType.TypeKind = TypeKind.Delegate Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxGeneratorVisitor.vb (2)
40If symbol.ContainingType.TypeKind = TypeKind.Submission Then 48If symbol.TypeKind <> TypeKind.[Error] Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\IMethodSymbolExtensions.vb (1)
32If parameter.Type.TypeKind = TypeKind.Delegate Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (2)
160If symbol.ContainingType.TypeKind = TypeKind.Submission Then 167If _addGlobal AndAlso symbol.TypeKind <> TypeKind.[Error] Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (4)
30If info.Type IsNot Nothing AndAlso info.Type.TypeKind <> TypeKind.Error Then 34If info.ConvertedType IsNot Nothing AndAlso info.ConvertedType.TypeKind <> TypeKind.Error Then 296If namedType.TypeKind = TypeKind.Delegate Then 712Return lambdaTypes.Where(Function(t) t.InferredType.TypeKind = TypeKind.Delegate).SelectMany(Function(t) t.InferredType.GetMembers(WellKnownMemberNames.DelegateInvokeName).OfType(Of IMethodSymbol)().Select(Function(m) New TypeInferenceInfo(m.ReturnType)))
Microsoft.CodeAnalysis.VisualBasic.Features (34)
ChangeSignature\VisualBasicChangeSignatureService.vb (1)
131If typeSymbol IsNot Nothing AndAlso typeSymbol.IsKind(SymbolKind.NamedType) AndAlso DirectCast(typeSymbol, ITypeSymbol).TypeKind = TypeKind.Delegate Then
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (7)
180If delegateSymbol.Arity <> 0 AndAlso delegateSymbol.TypeArguments.Any(Function(n) n.TypeKind = TypeKind.TypeParameter) Then 189Not (targetType.TypeKind = TypeKind.Class OrElse targetType.TypeKind = TypeKind.Interface) OrElse 260If targetType Is Nothing OrElse (targetType.TypeKind <> TypeKind.Interface AndAlso targetType.TypeKind <> TypeKind.Class) Then 356Not (targetType.TypeKind = TypeKind.Class OrElse targetType.TypeKind = TypeKind.Interface) OrElse
Completion\CompletionProviders\EnumCompletionProvider.vb (1)
61If enumType.TypeKind <> TypeKind.Enum Then
Completion\CompletionProviders\NamedParameterCompletionProvider.vb (1)
147If type IsNot Nothing AndAlso within IsNot Nothing AndAlso type.TypeKind <> TypeKind.[Delegate] Then
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (5)
631Return method.ContainingType.TypeKind <> TypeKind.Struct 1418Case TypeKind.Structure 1420Case TypeKind.Module 2000If type.TypeKind = TypeKind.Module Then 2030If newSymbol.ContainingType.TypeKind = TypeKind.Enum Then
ExtractMethod\VisualBasicMethodExtractor.PostProcessor.vb (2)
139type.TypeKind = TypeKind.Error OrElse 140type.TypeKind = TypeKind.Unknown Then
ExtractMethod\VisualBasicSelectionResult.vb (1)
192info.ConvertedType.TypeKind <> TypeKind.Interface Then
InitializeParameter\VisualBasicInitializeMemberFromParameterCodeRefactoringProvider.vb (2)
37Return If(containingType.TypeKind = TypeKind.Class Or containingType.TypeKind = TypeKind.Module, Accessibility.Private, Accessibility.Public)
NavigationBar\VisualBasicNavigationBarItemService.vb (5)
110If type.TypeKind = TypeKind.Enum Then 115If type.TypeKind <> TypeKind.Interface Then 214If workspaceSupportsDocumentChanges AndAlso type.TypeKind = TypeKind.Class Then 227If workspaceSupportsDocumentChanges AndAlso type.TypeKind = TypeKind.Class Then 235If type.TypeKind <> TypeKind.Delegate Then
SignatureHelp\FunctionAggregationSignatureHelpProvider.vb (1)
144If parameter.Type.TypeKind = TypeKind.Delegate Then
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.vb (1)
85Dim itemsAndSelected = If(type.TypeKind = TypeKind.Delegate,
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateDefaultConstructors\VisualBasicGenerateDefaultConstructorsService.vb (1)
35Return classType IsNot Nothing AndAlso classType.TypeKind = TypeKind.Class
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateParameterizedMember\VisualBasicGenerateConversionService.vb (5)
55Protected Overrides Function TryInitializeExplicitConversionState(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef identifierToken As SyntaxToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 69Protected Overrides Function TryInitializeImplicitConversionState(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef identifierToken As SyntaxToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 83Private Shared Function TryGetConversionMethodAndTypeToGenerateIn(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 113Private Shared Function TryGetExplicitConversionMethodAndTypeToGenerateIn(document As SemanticDocument, castExpression As CastExpressionSyntax, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean 129Private Shared Function TryGetImplicitConversionMethodAndTypeToGenerateIn(document As SemanticDocument, expression As SyntaxNode, classInterfaceModuleStructTypes As ISet(Of TypeKind), cancellationToken As CancellationToken, ByRef methodSymbol As IMethodSymbol, ByRef typeToGenerateIn As INamedTypeSymbol) As Boolean
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\ImplementInterface\VisualBasicImplementInterfaceService.vb (1)
83interfaceTypes = interfaceTypes.WhereNotNull().Where(Function(t) t.TypeKind = TypeKind.Interface).ToImmutableArray()
Microsoft.CodeAnalysis.VisualBasic.NetAnalyzers (4)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\BasicOverrideEqualsOnOverloadingOperatorEquals.vb (1)
43If type.TypeKind = TypeKind.Interface OrElse type.IsImplicitClass OrElse type.SpecialType = SpecialType.System_Object Then
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\BasicOverrideGetHashCodeOnOverridingEquals.vb (1)
44If type.TypeKind = TypeKind.Interface OrElse type.IsImplicitClass OrElse type.SpecialType = SpecialType.System_Object Then
Microsoft.NetCore.Analyzers\Runtime\BasicForwardCancellationTokenToInvocationsFixer.TypeNameVisitor.vb (2)
57If symbol.ContainingType.TypeKind = TypeKind.Submission Then 64If symbol.TypeKind <> TypeKind.[Error] Then
Microsoft.CodeAnalysis.VisualBasic.Workspaces (36)
CaseCorrection\VisualBasicCaseCorrectionService.Rewriter.vb (1)
148If TypeOf symbol Is ITypeSymbol AndAlso DirectCast(symbol, ITypeSymbol).TypeKind = TypeKind.Error Then
Recommendations\VisualBasicRecommendationServiceRunner.vb (9)
275If container Is Nothing OrElse TryCast(container, ITypeSymbol)?.TypeKind = TypeKind.Enum Then 404Dim isInterface = TryCast(typeOrAssemblySymbol, ITypeSymbol)?.TypeKind = TypeKind.Interface 463Return namedTypeSymbol.TypeKind = TypeKind.Interface OrElse 479If namedTypeSymbol.TypeKind = TypeKind.Interface Then 497If type.TypeKind = TypeKind.Class AndAlso Not type.IsSealed AndAlso Not Equals(type, within) Then 501If type.TypeKind = TypeKind.Class OrElse 502type.TypeKind = TypeKind.Module OrElse 503type.TypeKind = TypeKind.Struct Then 527If namedTypeSymbol.TypeKind = TypeKind.Class AndAlso Not namedTypeSymbol.IsSealed AndAlso Not Equals(namedTypeSymbol, within) Then
Simplification\Reducers\VisualBasicEscapingReducer.vb (2)
105If type.TypeKind <> TypeKind.Interface AndAlso type.TypeKind <> TypeKind.Enum Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (1)
247If parameter.Type.TypeKind <> TypeKind.TypeParameter Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (1)
49ElseIf type?.TypeKind = TypeKind.Enum Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (8)
53declaration = If(options.Context.GenerateMembers AndAlso namedType.TypeKind <> TypeKind.Delegate, 94If namedType.TypeKind = TypeKind.Enum Then 96ElseIf namedType.TypeKind = TypeKind.Delegate Then 100Dim isInterface = namedType.TypeKind = TypeKind.Interface 101Dim isStruct = namedType.TypeKind = TypeKind.Struct 102Dim isModule = namedType.TypeKind = TypeKind.Module 187If namedType.TypeKind = TypeKind.Class Then 205If namedType.TypeKind = TypeKind.Struct OrElse
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Editing\VisualBasicImportAdder.vb (1)
114If type?.TypeKind = TypeKind.Module Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\SyntaxTreeExtensions.vb (3)
328objectCreationType.TypeKind = TypeKind.Delegate Then 800Return DirectCast(symbol, INamedTypeSymbol).TypeKind = TypeKind.Enum 803Return target.IsType AndAlso DirectCast(target, ITypeSymbol).TypeKind = TypeKind.Enum
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ContextQuery\VisualBasicSyntaxContextExtensions.vb (1)
124objectCreationType.TypeKind = TypeKind.Delegate Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxGeneratorVisitor.vb (2)
40If symbol.ContainingType.TypeKind = TypeKind.Submission Then 48If symbol.TypeKind <> TypeKind.[Error] Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\IMethodSymbolExtensions.vb (1)
32If parameter.Type.TypeKind = TypeKind.Delegate Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (2)
160If symbol.ContainingType.TypeKind = TypeKind.Submission Then 167If _addGlobal AndAlso symbol.TypeKind <> TypeKind.[Error] Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (4)
30If info.Type IsNot Nothing AndAlso info.Type.TypeKind <> TypeKind.Error Then 34If info.ConvertedType IsNot Nothing AndAlso info.ConvertedType.TypeKind <> TypeKind.Error Then 296If namedType.TypeKind = TypeKind.Delegate Then 712Return lambdaTypes.Where(Function(t) t.InferredType.TypeKind = TypeKind.Delegate).SelectMany(Function(t) t.InferredType.GetMembers(WellKnownMemberNames.DelegateInvokeName).OfType(Of IMethodSymbol)().Select(Function(m) New TypeInferenceInfo(m.ReturnType)))
Microsoft.CodeAnalysis.Workspaces (157)
Classification\ClassificationExtensions.cs (11)
12TypeKind.Class => type.IsRecord ? ClassificationTypeNames.RecordClassName : ClassificationTypeNames.ClassName, 13TypeKind.Module => ClassificationTypeNames.ModuleName, 14TypeKind.Struct => type.IsRecord ? ClassificationTypeNames.RecordStructName : ClassificationTypeNames.StructName, 15TypeKind.Interface => ClassificationTypeNames.InterfaceName, 16TypeKind.Enum => ClassificationTypeNames.EnumName, 17TypeKind.Delegate => ClassificationTypeNames.DelegateName, 18TypeKind.TypeParameter => ClassificationTypeNames.TypeParameterName, 19TypeKind.Dynamic => ClassificationTypeNames.Keyword, 20TypeKind.Array => ClassificationTypeNames.ArrayName, 21TypeKind.Pointer => ClassificationTypeNames.PointerName, 22TypeKind.FunctionPointer => ClassificationTypeNames.FunctionPointerName,
Editing\SymbolEditorExtensions.cs (1)
30if (baseOrInterfaceType.TypeKind != TypeKind.Error)
Editing\SyntaxGenerator.cs (12)
769TypeKind.Class => ClassDeclaration( 778TypeKind.Struct => StructDeclaration( 786TypeKind.Interface => InterfaceDeclaration( 792TypeKind.Enum => EnumDeclaration( 799TypeKind.Delegate => type.GetMembers(WellKnownMemberNames.DelegateInvokeName) is [IMethodSymbol invoke, ..] 808TypeKind.Extension when type.ExtensionParameter is { } extensionParameter => ExtensionBlockDeclaration( 897case TypeKind.Class: 898case TypeKind.Struct: 899case TypeKind.Interface: 900case TypeKind.Enum: 901case TypeKind.Delegate: 903case TypeKind.Extension:
FindSymbols\FindReferences\DependentTypeFinder.cs (2)
46private static readonly Func<INamedTypeSymbol, bool> s_isInterface = static t => t is { TypeKind: TypeKind.Interface }; 47private static readonly Func<INamedTypeSymbol, bool> s_isNonSealedClass = static t => t is { TypeKind: TypeKind.Class, IsSealed: false };
FindSymbols\FindReferences\DependentTypeFinder_ImplementingTypes.cs (5)
22if (type?.TypeKind == TypeKind.Interface) 54t => t.TypeKind is TypeKind.Class or 55TypeKind.Struct or 56TypeKind.Delegate or 57TypeKind.Enum);
FindSymbols\FindReferences\Finders\NamedTypeSymbolReferenceFinder.cs (1)
21=> symbol.TypeKind != TypeKind.Error;
FindSymbols\FindReferences\Finders\OrdinaryMethodReferenceFinder.cs (1)
38if (symbol.ContainingType.TypeKind == TypeKind.Delegate)
FindSymbols\FindReferences\FindReferencesSearchEngine.SymbolSet.cs (1)
121if (searchSymbol.IsConstructor() && searchSymbol.ContainingType.TypeKind == TypeKind.Delegate)
FindSymbols\SymbolFinder_Hierarchy.cs (2)
129if (symbol is { DeclaredAccessibility: Accessibility.Public, ContainingType.TypeKind: TypeKind.Class or TypeKind.Struct })
Recommendations\AbstractRecommendationServiceRunner.cs (3)
458if (originalConstraintType.TypeKind == TypeKind.TypeParameter) 465else if (originalConstraintType.TypeKind == TypeKind.Interface) 490else if (originalConstraintType.TypeKind == TypeKind.Class)
Rename\RenameUtilities.cs (6)
52typeSymbol.TypeKind is TypeKind.Array or TypeKind.Pointer or TypeKind.FunctionPointer or TypeKind.Dynamic; 264symbol.ContainingType.TypeKind == TypeKind.Interface) 391if (symbol is INamedTypeSymbol { IsImplicitlyDeclared: true, TypeKind: TypeKind.Delegate, AssociatedSymbol: not null } typeSymbol)
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
108((INamedTypeSymbol)referencedSymbol.ContainingSymbol).TypeKind == TypeKind.Interface &&
Shared\Extensions\IMethodSymbolExtensions.cs (1)
17Contract.ThrowIfFalse(delegateType.TypeKind == TypeKind.Delegate);
Shared\Extensions\ISymbolExtensions.cs (2)
489if (typeSymbol.TypeKind == TypeKind.Class) 495else if (typeSymbol.TypeKind == TypeKind.Interface)
Shared\Extensions\ITypeSymbolExtensions.cs (2)
159typeSymbol.TypeKind == TypeKind.Interface) 192if (type.TypeKind == TypeKind.Interface &&
Shared\Extensions\SemanticModelExtensions.cs (1)
144if (namedType.TypeKind == TypeKind.Delegate ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\CollectionExpressionUtilities.cs (1)
112if (!(namedType.TypeKind == TypeKind.Struct && noArgConstructor.IsImplicitlyDeclared))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
147if (type.TypeKind == TypeKind.Array && typeArguments.IsEmpty)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (13)
104private static readonly SymbolKindOrTypeKind s_class = new(TypeKind.Class); 105private static readonly SymbolKindOrTypeKind s_struct = new(TypeKind.Struct); 106private static readonly SymbolKindOrTypeKind s_interface = new(TypeKind.Interface); 107private static readonly SymbolKindOrTypeKind s_enum = new(TypeKind.Enum); 113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 329case TypeKind.Class: 332case TypeKind.Struct: 335case TypeKind.Interface: 338case TypeKind.Enum: 341case TypeKind.Delegate: 344case TypeKind.Module: 347case TypeKind.Pointer: 350case TypeKind.TypeParameter:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
66if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (20)
62new SymbolKindOrTypeKind(TypeKind.Class), 63new SymbolKindOrTypeKind(TypeKind.Struct), 64new SymbolKindOrTypeKind(TypeKind.Interface), 65new SymbolKindOrTypeKind(TypeKind.Delegate), 66new SymbolKindOrTypeKind(TypeKind.Enum), 67new SymbolKindOrTypeKind(TypeKind.Module), 68new SymbolKindOrTypeKind(TypeKind.Pointer), 75new SymbolKindOrTypeKind(TypeKind.TypeParameter), 293foreach (var typeKindElement in symbolKindListElement.Elements(nameof(TypeKind))) 344public SymbolKindOrTypeKind(TypeKind typeKind) 355public TypeKind? TypeKind => (_category == SymbolCategory.Type) ? (TypeKind)_kind : null; 362SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind, 371SymbolCategory.Type => new XElement(nameof(TypeKind), GetTypeKindString((TypeKind)_kind)), 376private static string GetTypeKindString(TypeKind typeKind) 383CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct), 433=> new((TypeKind)Enum.Parse(typeof(TypeKind), typeKindElement.Value)); 441public static implicit operator SymbolKindOrTypeKind(TypeKind symbolKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
407if (namedTypeSymbol.TypeKind == TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
22var isError = symbol.TupleUnderlyingType!.TypeKind == TypeKind.Error;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (10)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface 555TypeKind: TypeKind.Class or TypeKind.Struct
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (9)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } && 187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 226=> symbol is ITypeSymbol { TypeKind: TypeKind.Error }; 229=> symbol is ITypeSymbol { TypeKind: TypeKind.Module }; 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface }; 271=> symbol is { Kind: SymbolKind.Field, ContainingType.TypeKind: TypeKind.Enum }; 284=> symbol is { ContainingType.TypeKind: TypeKind.Module }; 308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 730if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (12)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract; 78=> symbol?.TypeKind == TypeKind.Module; 81=> symbol?.TypeKind == TypeKind.Interface; 84=> symbol?.TypeKind == TypeKind.Delegate; 87=> symbol?.TypeKind == TypeKind.FunctionPointer; 90=> symbol?.TypeKind == TypeKind.Struct; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes(); 262case TypeKind.Array: 263case TypeKind.Delegate: 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (3)
257private static TypeKind GetTypeKind(INamedTypeSymbol x) 261TypeKind.Module => TypeKind.Class,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
284var xTypeKind = GetTypeKind(x); 285var yTypeKind = GetTypeKind(y); 287if (xTypeKind == TypeKind.Error || 288yTypeKind == TypeKind.Error) 305var typeKind1 = GetTypeKind(type1); 308var typeKind2 = GetTypeKind(type2); 513if (x.TypeKind == TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (1)
37if (typeSymbol.TypeKind != TypeKind.Enum)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
152if (namedType.TypeKind != TypeKind.Enum)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (3)
418TypeKind typeKind, string name, 437bool isRecord, TypeKind typeKind, string name, 488typeKind: TypeKind.Delegate,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (2)
43public override TypeKind TypeKind => TypeKind.Array;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructedNamedTypeSymbol.cs (1)
93public override TypeKind TypeKind => _constructedFrom.TypeKind;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
29TypeKind typeKind, 63public override TypeKind TypeKind { get; } 95return this.TypeKind == TypeKind.Delegate
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPointerTypeSymbol.cs (2)
19public override TypeKind TypeKind => TypeKind.Pointer;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (2)
60public override TypeKind TypeKind => TypeKind.TypeParameter;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (3)
25public abstract TypeKind TypeKind { get; } 37public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
124member.ContainingType is { TypeKind: TypeKind.Interface } interfaceBeingImplemented)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
518if (containingType?.TypeKind == TypeKind.Struct)
Microsoft.DotNet.ApiCompatibility (11)
Mapping\AssemblyMapper.cs (1)
110if (symbol.TypeKind != TypeKind.Error)
Rules\CannotAddAbstractMember.cs (1)
34if (leftContainingType.TypeKind != TypeKind.Interface && !leftContainingType.IsEffectivelySealed(_settings.IncludeInternalSymbols))
Rules\CannotAddMemberToInterface.cs (1)
25if (left == null && right != null && right.ContainingType.TypeKind == TypeKind.Interface)
Rules\CannotAddOrRemoveVirtualKeyword.cs (2)
33if (leftContainingType.TypeKind == TypeKind.Interface || rightContainingType.TypeKind == TypeKind.Interface)
Rules\CannotRemoveBaseTypeOrInterface.cs (3)
28if (left.TypeKind != TypeKind.Interface && right.TypeKind != TypeKind.Interface) 81if (!leftInterface.IsVisibleOutsideOfAssembly(_settings.IncludeInternalSymbols) && leftInterface.TypeKind != TypeKind.Error)
Rules\CannotSealType.cs (2)
25if (left == null || right == null || left.TypeKind == TypeKind.Interface || right.TypeKind == TypeKind.Interface)
Rules\EnumsMustMatch.cs (1)
87private static bool IsEnum(ITypeSymbol? sym) => sym is not null && sym.TypeKind == TypeKind.Enum;
Microsoft.DotNet.ApiSymbolExtensions (1)
SymbolExtensions.cs (1)
42if (type.TypeKind == TypeKind.Interface)
Microsoft.Extensions.Options.SourceGeneration (1)
Parser.cs (1)
218if (ta.TypeKind == TypeKind.TypeParameter)
Microsoft.Gen.ContextualOptions (2)
Parser.cs (2)
82.Where(prop => prop.Type.TypeKind != TypeKind.Pointer) 83.Where(prop => prop.Type.TypeKind != TypeKind.FunctionPointer)
Microsoft.Gen.Logging (7)
Parsing\Parser.LogProperties.cs (5)
19private static readonly HashSet<TypeKind> _allowedTypeKinds = [TypeKind.Class, TypeKind.Struct, TypeKind.Interface]; 307|| (property.Type.TypeKind == TypeKind.Delegate)
Parsing\Parser.Records.cs (1)
120if (memberType.TypeKind == TypeKind.Delegate)
Parsing\Parser.TagProvider.cs (1)
161if (target.TypeKind == TypeKind.Interface)
Microsoft.Gen.Logging.Unit.Tests (1)
LogParserUtilitiesTests.cs (1)
155paramTypeMock.SetupGet(x => x.TypeKind).Returns(TypeKind.Class);
Microsoft.Gen.MetadataExtractor (6)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (6)
579returnType.TypeKind != TypeKind.Error) 638if (strongTypeSymbol.TypeKind == TypeKind.Class) 698TypeKind kind; 739if (kind == TypeKind.Enum) 769if (kind == TypeKind.Class) 827if (kind == TypeKind.Struct && specialType == SpecialType.None)
Microsoft.Gen.Metrics (6)
Parser.cs (6)
579returnType.TypeKind != TypeKind.Error) 638if (strongTypeSymbol.TypeKind == TypeKind.Class) 698TypeKind kind; 739if (kind == TypeKind.Enum) 769if (kind == TypeKind.Class) 827if (kind == TypeKind.Struct && specialType == SpecialType.None)
Microsoft.Gen.MetricsReports (6)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (6)
579returnType.TypeKind != TypeKind.Error) 638if (strongTypeSymbol.TypeKind == TypeKind.Class) 698TypeKind kind; 739if (kind == TypeKind.Enum) 769if (kind == TypeKind.Class) 827if (kind == TypeKind.Struct && specialType == SpecialType.None)
Microsoft.Interop.ComInterfaceGenerator (9)
Analyzers\AddGeneratedComClassAnalyzer.cs (1)
42if (type.TypeKind != TypeKind.Class)
Analyzers\ComClassGeneratorDiagnosticsAnalyzer.cs (1)
47if (context.Symbol is not INamedTypeSymbol { TypeKind: TypeKind.Class } classToAnalyze)
Analyzers\ComInterfaceGeneratorDiagnosticsAnalyzer.cs (1)
86if (typeSymbol.TypeKind != TypeKind.Interface)
Analyzers\ConvertComImportToGeneratedComInterfaceAnalyzer.cs (3)
52if (type is not { TypeKind: TypeKind.Interface, IsComImport: true } 226public bool CanProvideMarshallingInfoForType(ITypeSymbol type) => type is { TypeKind: TypeKind.Array or TypeKind.Delegate } or { SpecialType: SpecialType.System_Array or SpecialType.System_Object };
Analyzers\GeneratedComInterfaceAttributeAnalyzer.cs (1)
32if (typeSymbol.TypeKind != TypeKind.Interface)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
269if (methodSymbol.ReturnType is { TypeKind: TypeKind.Struct }
VtableIndexStubGenerator.cs (1)
194if (attrData.AttributeClass?.TypeKind is null or TypeKind.Error)
Microsoft.Interop.JavaScript.JSImportGenerator (2)
JSExportGenerator.cs (1)
137if (attrData.AttributeClass?.TypeKind is null or TypeKind.Error)
JSImportGenerator.cs (1)
112if (attrData.AttributeClass?.TypeKind is null or TypeKind.Error)
Microsoft.Interop.LibraryImportGenerator (3)
Analyzers\LibraryImportDiagnosticsAnalyzer.cs (1)
286if (attrData.AttributeClass?.TypeKind is null or TypeKind.Error)
LibraryImportGenerator.cs (1)
168if (attrData.AttributeClass?.TypeKind is null or TypeKind.Error)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
269if (methodSymbol.ReturnType is { TypeKind: TypeKind.Struct }
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
DownlevelLibraryImportDiagnosticsAnalyzer.cs (1)
290if (attrData.AttributeClass?.TypeKind is null or TypeKind.Error)
DownlevelLibraryImportGenerator.cs (1)
154if (attrData.AttributeClass?.TypeKind is null or TypeKind.Error)
Microsoft.Interop.SourceGeneration (21)
BlittableTypeMarshallingInfoProvider.cs (3)
27if (type.TypeKind is TypeKind.Enum or TypeKind.Pointer or TypeKind.FunctionPointer
CustomMarshallingInfoHelper.cs (4)
29if (!(entryPointType.IsStatic && entryPointType.TypeKind == TypeKind.Class) 30&& entryPointType.TypeKind != TypeKind.Struct) 145if (!(entryPointType.IsStatic && entryPointType.TypeKind == TypeKind.Class) 146&& entryPointType.TypeKind != TypeKind.Struct)
ManagedTypeInfo.cs (6)
48if (type.TypeKind == TypeKind.Enum) 52if (type.TypeKind == TypeKind.Pointer) 56if (type.TypeKind == TypeKind.FunctionPointer) 60if (type.TypeKind == TypeKind.Array && type is IArrayTypeSymbol { IsSZArray: true } arraySymbol) 64if (type.TypeKind == TypeKind.Delegate) 68if (type.TypeKind == TypeKind.TypeParameter)
ManualTypeMarshallingHelper.cs (5)
364while (innerType.TypeKind is TypeKind.Array or TypeKind.Pointer) 388if (wrapperType.TypeKind == TypeKind.Pointer) 392else if (wrapperType.TypeKind == TypeKind.Array) 412if (marshallerType is { IsStatic: true, TypeKind: TypeKind.Class })
TypeSymbolExtensions.cs (3)
104if (type.TypeKind == TypeKind.TypeParameter && !type.IsReferenceType) 110if (type.TypeKind is TypeKind.Pointer or TypeKind.FunctionPointer)
Microsoft.ML.InternalCodeAnalyzer (1)
BaseTestClassAnalyzer.cs (1)
68if (namedType.TypeKind != TypeKind.Class)
Roslyn.Diagnostics.Analyzers (145)
AbstractCreateTestAccessor`1.cs (2)
56=> typeSymbol.TypeKind is TypeKind.Class or TypeKind.Struct;
AbstractExposeMemberForTesting`1.cs (2)
92=> typeSymbol.TypeKind is TypeKind.Class or TypeKind.Struct;
DefaultableTypeShouldHaveDefaultableFieldsAnalyzer.cs (14)
82if (containingType.TypeKind != TypeKind.Struct) 114case TypeKind.Class: 115case TypeKind.Interface: 116case TypeKind.Delegate: 119case TypeKind.Enum: 122case TypeKind.Struct: 132case TypeKind.TypeParameter: 139case TypeKind.Unknown: 140case TypeKind.Array: 141case TypeKind.Dynamic: 142case TypeKind.Error: 143case TypeKind.Module: 144case TypeKind.Pointer: 145case TypeKind.Submission:
ImmutableArrayBoxingAnalyzer.cs (1)
83if (conversionOperation.Type?.TypeKind != TypeKind.Interface)
IRemoteJsonServiceParameterAnalyzer.cs (1)
64if (namedTypeSymbol.TypeKind != TypeKind.Interface ||
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (5)
134case TypeKind.Class: 135case TypeKind.Interface: 146case TypeKind.Struct: 147case TypeKind.Enum: 148case TypeKind.Delegate:
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
520=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ISymbolExtensions.cs (2)
113if (type1.TypeKind == TypeKind.TypeParameter && 114type2.TypeKind == TypeKind.TypeParameter &&
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (5)
48case TypeKind.Class: 49if (type.TypeKind == TypeKind.Interface) 56case TypeKind.Interface: 71if (!baseTypesOnly && candidateBaseType.TypeKind == TypeKind.Interface) 86if (checkTypeParameterConstraints && symbol.TypeKind == TypeKind.TypeParameter)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
412namedType.TypeKind != TypeKind.Interface ||
src\roslyn\src\RoslynAnalyzers\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (6)
42if (containingType.TypeKind == TypeKind.Class) 143if (containingType.TypeKind == TypeKind.Class) 195if (containingType.TypeKind == TypeKind.Class) 242if (containingType.TypeKind == TypeKind.Class) 290if (containingType.TypeKind == TypeKind.Class) 355if (containingType.TypeKind == TypeKind.Class)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\CollectionExpressionUtilities.cs (1)
112if (!(namedType.TypeKind == TypeKind.Struct && noArgConstructor.IsImplicitlyDeclared))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SemanticModelExtensions.cs (1)
147if (type.TypeKind == TypeKind.Array && typeArguments.IsEmpty)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (1)
410symbol.GetSymbolType()?.TypeKind != TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (13)
104private static readonly SymbolKindOrTypeKind s_class = new(TypeKind.Class); 105private static readonly SymbolKindOrTypeKind s_struct = new(TypeKind.Struct); 106private static readonly SymbolKindOrTypeKind s_interface = new(TypeKind.Interface); 107private static readonly SymbolKindOrTypeKind s_enum = new(TypeKind.Enum); 113private static readonly SymbolKindOrTypeKind s_delegate = new(TypeKind.Delegate); 329case TypeKind.Class: 332case TypeKind.Struct: 335case TypeKind.Interface: 338case TypeKind.Enum: 341case TypeKind.Delegate: 344case TypeKind.Module: 347case TypeKind.Pointer: 350case TypeKind.TypeParameter:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (2)
66if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (20)
62new SymbolKindOrTypeKind(TypeKind.Class), 63new SymbolKindOrTypeKind(TypeKind.Struct), 64new SymbolKindOrTypeKind(TypeKind.Interface), 65new SymbolKindOrTypeKind(TypeKind.Delegate), 66new SymbolKindOrTypeKind(TypeKind.Enum), 67new SymbolKindOrTypeKind(TypeKind.Module), 68new SymbolKindOrTypeKind(TypeKind.Pointer), 75new SymbolKindOrTypeKind(TypeKind.TypeParameter), 293foreach (var typeKindElement in symbolKindListElement.Elements(nameof(TypeKind))) 344public SymbolKindOrTypeKind(TypeKind typeKind) 355public TypeKind? TypeKind => (_category == SymbolCategory.Type) ? (TypeKind)_kind : null; 362SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind, 371SymbolCategory.Type => new XElement(nameof(TypeKind), GetTypeKindString((TypeKind)_kind)), 376private static string GetTypeKindString(TypeKind typeKind) 383CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct), 433=> new((TypeKind)Enum.Parse(typeof(TypeKind), typeKindElement.Value)); 441public static implicit operator SymbolKindOrTypeKind(TypeKind symbolKind)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (1)
407if (namedTypeSymbol.TypeKind == TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
22var isError = symbol.TupleUnderlyingType!.TypeKind == TypeKind.Error;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (10)
101if (member.ContainingType.TypeKind == TypeKind.Interface) 172if (implementation?.ContainingType.TypeKind == TypeKind.Interface) 210if (type.TypeKind == TypeKind.Interface) 313if (type.TypeKind == TypeKind.Interface) 351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 361if (!interfacesOrAbstractClasses.All(i => i.TypeKind == TypeKind.Interface) && 378return interfacesOrAbstractClasses.First().TypeKind == TypeKind.Interface 555TypeKind: TypeKind.Class or TypeKind.Struct
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (9)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } && 187if (symbol is { ContainingType.TypeKind: TypeKind.Interface }) 226=> symbol is ITypeSymbol { TypeKind: TypeKind.Error }; 229=> symbol is ITypeSymbol { TypeKind: TypeKind.Module }; 232=> symbol is ITypeSymbol { TypeKind: TypeKind.Interface }; 271=> symbol is { Kind: SymbolKind.Field, ContainingType.TypeKind: TypeKind.Enum }; 284=> symbol is { ContainingType.TypeKind: TypeKind.Module }; 308=> symbol is ITypeSymbol { TypeKind: TypeKind.Delegate }; 730if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (12)
46return type is INamedTypeSymbol { TypeKind: TypeKind.Interface } namedType && !allInterfaces.Contains(namedType) 52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract; 78=> symbol?.TypeKind == TypeKind.Module; 81=> symbol?.TypeKind == TypeKind.Interface; 84=> symbol?.TypeKind == TypeKind.Delegate; 87=> symbol?.TypeKind == TypeKind.FunctionPointer; 90=> symbol?.TypeKind == TypeKind.Struct; 184IEnumerable<ITypeSymbol> baseTypes = (baseType.TypeKind == TypeKind.Interface) ? type.AllInterfaces : type.GetBaseTypes(); 262case TypeKind.Array: 263case TypeKind.Delegate: 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (3)
257private static TypeKind GetTypeKind(INamedTypeSymbol x) 261TypeKind.Module => TypeKind.Class,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
284var xTypeKind = GetTypeKind(x); 285var yTypeKind = GetTypeKind(y); 287if (xTypeKind == TypeKind.Error || 288yTypeKind == TypeKind.Error) 305var typeKind1 = GetTypeKind(type1); 308var typeKind2 = GetTypeKind(type2); 513if (x.TypeKind == TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\AbstractFlagsEnumGenerator.cs (1)
37if (typeSymbol.TypeKind != TypeKind.Enum)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (1)
152if (namedType.TypeKind != TypeKind.Enum)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationSymbolFactory.cs (3)
418TypeKind typeKind, string name, 437bool isRecord, TypeKind typeKind, string name, 488typeKind: TypeKind.Delegate,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (2)
43public override TypeKind TypeKind => TypeKind.Array;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationConstructedNamedTypeSymbol.cs (1)
93public override TypeKind TypeKind => _constructedFrom.TypeKind;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationNamedTypeSymbol.cs (3)
29TypeKind typeKind, 63public override TypeKind TypeKind { get; } 95return this.TypeKind == TypeKind.Delegate
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPointerTypeSymbol.cs (2)
19public override TypeKind TypeKind => TypeKind.Pointer;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (2)
60public override TypeKind TypeKind => TypeKind.TypeParameter;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (3)
25public abstract TypeKind TypeKind { get; } 37public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
124member.ContainingType is { TypeKind: TypeKind.Interface } interfaceBeingImplemented)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
518if (containingType?.TypeKind == TypeKind.Struct)
Roslyn.Diagnostics.CSharp.Analyzers (40)
PreferNullLiteral.cs (2)
57if (type.TypeKind == TypeKind.Pointer) 61else if (type.TypeKind == TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs (2)
42if (typeSymbol.TypeKind is TypeKind.Class or TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SemanticModelExtensions.cs (2)
211if (containingType != null && containingType.TypeKind == TypeKind.Interface) 445if (parameter.Type.OriginalDefinition.TypeKind != TypeKind.TypeParameter)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (8)
253if (originalDelegateCreationOperation.Type?.TypeKind != TypeKind.Delegate) 270if (rewrittenDelegateCreationOperation.Type?.TypeKind != TypeKind.Delegate) 316if (originalConvertedType is null || originalConvertedType.TypeKind == TypeKind.Error) 357if (rewrittenConvertedType is null || rewrittenConvertedType.TypeKind == TypeKind.Error || !rewrittenConversion.Exists) 579originalConvertedType.IsReferenceType && rewrittenConvertedType.TypeKind == TypeKind.Dynamic) 1101if (!original.IsReferenceType || original.TypeKind == TypeKind.Interface) 1444if (originalMemberSymbol.ContainingType.TypeKind == TypeKind.Interface) 1484rewrittenType.TypeKind == TypeKind.Array ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
260if (declaredType.TypeKind == TypeKind.Dynamic)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\ExpressionGenerator.cs (1)
60if (type is INamedTypeSymbol { TypeKind: TypeKind.Enum } enumType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
293if (constraintType.IsReferenceType && constraintType.TypeKind != TypeKind.Interface)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (8)
96if (info.Context.GenerateMembers && namedType.TypeKind != TypeKind.Delegate) 188if (namedType.TypeKind == TypeKind.Enum) 192else if (namedType.TypeKind == TypeKind.Delegate) 200var isRecordClass = namedType.TypeKind is TypeKind.Class; 211var kind = namedType.TypeKind == TypeKind.Struct ? SyntaxKind.StructDeclaration : 212namedType.TypeKind == TypeKind.Interface ? SyntaxKind.InterfaceDeclaration : SyntaxKind.ClassDeclaration; 293if (namedType.TypeKind == TypeKind.Class) 321if (namedType is { TypeKind: TypeKind.Class, BaseType: not null, BaseType.SpecialType: not SpecialType.System_Object })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ContextQuery\SyntaxTreeExtensions.cs (2)
3069return ((INamedTypeSymbol)symbol).TypeKind == TypeKind.Enum; 3072return target.IsType && ((ITypeSymbol)target).TypeKind == TypeKind.Enum;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeParameterSymbolExtensions.cs (4)
59typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Class).Concat( 60typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Interface).Concat( 61typeParameter.ConstraintTypes.Where(t => t.TypeKind is not TypeKind.Class and not TypeKind.Interface)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.ExpressionSyntaxGeneratorVisitor.cs (2)
53if (symbol.ContainingType.TypeKind == TypeKind.Submission) 67if (symbol.TypeKind != TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (4)
197if (symbol is { TypeKind: TypeKind.Error, Name: "var" }) 234if (innerType.TypeKind != TypeKind.Pointer) 269if (symbol.ContainingType.TypeKind != TypeKind.Submission) 288if (symbol.TypeKind != TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (3)
447if (type.TypeKind == TypeKind.Delegate) 1037if (parentTypes.Any(static parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate)) 1039return parentTypes.Where(parentType => parentType.InferredType.SpecialType == SpecialType.System_String || parentType.InferredType.TypeKind == TypeKind.Delegate);
Roslyn.Diagnostics.VisualBasic.Analyzers (11)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\VisualBasic\Extensions\SemanticModelExtensions.vb (1)
247If parameter.Type.TypeKind <> TypeKind.TypeParameter Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\ExpressionGenerator.vb (1)
49ElseIf type?.TypeKind = TypeKind.Enum Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Editing\VisualBasicImportAdder.vb (1)
114If type?.TypeKind = TypeKind.Module Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\ExpressionSyntaxGeneratorVisitor.vb (2)
40If symbol.ContainingType.TypeKind = TypeKind.Submission Then 48If symbol.TypeKind <> TypeKind.[Error] Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\Extensions\TypeSyntaxGeneratorVisitor.vb (2)
160If symbol.ContainingType.TypeKind = TypeKind.Submission Then 167If _addGlobal AndAlso symbol.TypeKind <> TypeKind.[Error] Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\LanguageServices\VisualBasicTypeInferenceService.TypeInferrer.vb (4)
30If info.Type IsNot Nothing AndAlso info.Type.TypeKind <> TypeKind.Error Then 34If info.ConvertedType IsNot Nothing AndAlso info.ConvertedType.TypeKind <> TypeKind.Error Then 296If namedType.TypeKind = TypeKind.Delegate Then 712Return lambdaTypes.Where(Function(t) t.InferredType.TypeKind = TypeKind.Delegate).SelectMany(Function(t) t.InferredType.GetMembers(WellKnownMemberNames.DelegateInvokeName).OfType(Of IMethodSymbol)().Select(Function(m) New TypeInferenceInfo(m.ReturnType)))
System.Text.Json.SourceGeneration (7)
Helpers\RoslynExtensions.cs (4)
106if (type.IsAbstract || type.TypeKind is TypeKind.Interface || type is not INamedTypeSymbol namedType) 132if (baseType.TypeKind is TypeKind.Interface) 160if (baseType.TypeKind is TypeKind.Interface) 236if (type.TypeKind != TypeKind.Interface)
JsonSourceGenerator.Parser.cs (2)
651else if (type.TypeKind is TypeKind.Enum) 1320if (type.TypeKind is TypeKind.Enum)
src\runtime\src\libraries\Common\src\SourceGenerators\TypeRef.cs (1)
33public TypeKind TypeKind { get; }