23 implementations of TypeKind
GenerateDocumentationAndConfigFiles (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (1)
43public override TypeKind TypeKind => TypeKind.Array;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPointerTypeSymbol.cs (1)
19public override TypeKind TypeKind => TypeKind.Pointer;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
60public override TypeKind TypeKind => TypeKind.TypeParameter;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
25public abstract TypeKind TypeKind { get; }
Microsoft.CodeAnalysis.Analyzers (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (1)
43public override TypeKind TypeKind => TypeKind.Array;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPointerTypeSymbol.cs (1)
19public override TypeKind TypeKind => TypeKind.Pointer;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
60public override TypeKind TypeKind => TypeKind.TypeParameter;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
25public abstract TypeKind TypeKind { get; }
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (1)
43public override TypeKind TypeKind => TypeKind.Array;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPointerTypeSymbol.cs (1)
19public override TypeKind TypeKind => TypeKind.Pointer;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
60public override TypeKind TypeKind => TypeKind.TypeParameter;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
25public abstract TypeKind TypeKind { get; }
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\TypeSymbol.cs (1)
147TypeKind ITypeSymbol.TypeKind
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
67public TypeKind TypeKind => _symbol.TypeKind;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\TypeSymbol.vb (1)
581Private ReadOnly Property ITypeSymbol_TypeKind As TypeKind Implements ITypeSymbol.TypeKind, ITypeSymbolInternal.TypeKind
Microsoft.CodeAnalysis.Workspaces (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (1)
43public override TypeKind TypeKind => TypeKind.Array;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPointerTypeSymbol.cs (1)
19public override TypeKind TypeKind => TypeKind.Pointer;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
60public override TypeKind TypeKind => TypeKind.TypeParameter;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
25public abstract TypeKind TypeKind { get; }
Roslyn.Diagnostics.Analyzers (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationArrayTypeSymbol.cs (1)
43public override TypeKind TypeKind => TypeKind.Array;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationPointerTypeSymbol.cs (1)
19public override TypeKind TypeKind => TypeKind.Pointer;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeParameterSymbol.cs (1)
60public override TypeKind TypeKind => TypeKind.TypeParameter;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
25public abstract TypeKind TypeKind { get; }
1075 references to TypeKind
Aspire.Hosting.Integration.Analyzers (2)
AspireExportAnalyzer.cs (2)
934if (type.TypeKind == TypeKind.Enum) 1260return namedType.TypeKind == TypeKind.Delegate;
ConfigurationSchemaGenerator (5)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (4)
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)
21TypeKind = type.TypeKind;
GenerateDocumentationAndConfigFiles (64)
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 (4)
46switch (possibleBase.TypeKind) 49if (type.TypeKind == 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\NamingStyleRules.cs (1)
66if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
362SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind,
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 (8)
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 (13)
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(); 260switch (typeSymbol.TypeKind) 544if (t1.TypeKind != t2.TypeKind) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (2)
84symbol = updatedContainingType.GetTypeMembers(symbol.Name, symbol.Arity).First(m => m.TypeKind == symbol.TypeKind);
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 (1)
258=> x.TypeKind switch
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
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\INamedTypeSymbolExtensions.cs (1)
25namedType.TypeKind,
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 (7)
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 (1)
19return underlyingType?.TypeKind switch
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 (6)
Compilation\Compilation.cs (2)
3791return string.Format("{0}: {1} {2} -> {3} {4}", this.AssemblyName, source.TypeKind.ToString(), source.Name, destination.TypeKind.ToString(), destination.Name);
Compilation\Expression.cs (1)
41if (type.TypeKind == TypeKind.Enum)
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)
Microsoft.CodeAnalysis.Analyzers (72)
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 (1)
132switch (namedType.TypeKind)
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 (4)
46switch (possibleBase.TypeKind) 49if (type.TypeKind == 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\NamingStyleRules.cs (1)
66if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
362SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind,
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 (8)
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 (13)
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(); 260switch (typeSymbol.TypeKind) 544if (t1.TypeKind != t2.TypeKind) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (2)
84symbol = updatedContainingType.GetTypeMembers(symbol.Name, symbol.Arity).First(m => m.TypeKind == symbol.TypeKind);
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 (1)
258=> x.TypeKind switch
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
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\INamedTypeSymbolExtensions.cs (1)
25namedType.TypeKind,
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 (59)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
132switch (namedType.TypeKind)
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 (4)
46switch (possibleBase.TypeKind) 49if (type.TypeKind == 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 (3)
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\NamingStyleRules.cs (1)
66if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
362SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind,
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 (8)
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 (13)
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(); 260switch (typeSymbol.TypeKind) 544if (t1.TypeKind != t2.TypeKind) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (2)
84symbol = updatedContainingType.GetTypeMembers(symbol.Name, symbol.Arity).First(m => m.TypeKind == symbol.TypeKind);
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 (1)
258=> x.TypeKind switch
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
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 (51)
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 (1)
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\NamingStyleRules.cs (1)
66if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
362SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind,
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 (8)
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 (13)
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(); 260switch (typeSymbol.TypeKind) 544if (t1.TypeKind != t2.TypeKind) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (2)
84symbol = updatedContainingType.GetTypeMembers(symbol.Name, symbol.Arity).First(m => m.TypeKind == symbol.TypeKind);
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 (1)
258=> x.TypeKind switch
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
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 (31)
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 (1)
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 (2)
39if (!typeKinds.Contains(typeToGenerateIn.TypeKind)) 42if (typeToGenerateIn.TypeKind == TypeKind.Interface && isStatic)
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\INamedTypeSymbolExtensions.cs (1)
25namedType.TypeKind,
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 (19)
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 (11)
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 && 641switch (symbol.TypeKind) 662throw ExceptionUtilities.UnexpectedValue(symbol.TypeKind); 729if (symbol.IsAnonymousType && symbol.TypeKind != TypeKind.Delegate) 741switch (symbol.TypeKind)
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)
Microsoft.CodeAnalysis.CSharp.CodeStyle (25)
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 (1)
274if (namedType.TypeKind is not (TypeKind.Class or TypeKind.Struct))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (2)
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 (1)
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 (35)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (4)
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 (1)
39return classType?.TypeKind is TypeKind.Class or TypeKind.Struct;
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 (3)
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 (51)
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 (4)
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 (2)
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 (2)
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 (5)
963return method.ContainingType.TypeKind != TypeKind.Struct; 967if (method.ContainingType.TypeKind == TypeKind.Struct) 1963=> symbol.TypeKind switch 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 (1)
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 (1)
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\CSharpConsoleSnippetProvider.cs (1)
42if (lambdaSymbol is IMethodSymbol { ReturnType: { SpecialType: SpecialType.System_Void } or { TypeKind: TypeKind.Error } })
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 (1)
274if (namedType.TypeKind is not (TypeKind.Class or TypeKind.Struct))
src\roslyn\src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (2)
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 (4)
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 (1)
39return classType?.TypeKind is TypeKind.Class or TypeKind.Struct;
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 (42)
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 (1)
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 (3)
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 (38)
Symbols\INamedTypeSymbolExtensions.cs (8)
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 (13)
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(); 260switch (typeSymbol.TypeKind) 544if (t1.TypeKind != t2.TypeKind) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (2)
84symbol = updatedContainingType.GetTypeMembers(symbol.Name, symbol.Arity).First(m => m.TypeKind == symbol.TypeKind);
Symbols\SignatureComparer.cs (2)
186property1.ContainingType.TypeKind == TypeKind.Interface) 196property2.ContainingType.TypeKind == TypeKind.Interface)
Symbols\SymbolEquivalenceComparer.cs (1)
258=> x.TypeKind switch
Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
513if (x.TypeKind == TypeKind.Delegate)
Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
195if (x.TypeKind == TypeKind.Delegate)
Microsoft.CodeAnalysis.Features (107)
AddConstructorParametersFromMembers\AddConstructorParametersFromMembersCodeRefactoringProvider.State.cs (1)
56ContainingType.TypeKind == TypeKind.Interface ||
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
106=> typeSymbol.TypeKind is TypeKind.Class or TypeKind.Struct;
Completion\Providers\AbstractObjectCreationCompletionProvider.cs (1)
85if (type.TypeKind is TypeKind.Interface or TypeKind.Pointer or TypeKind.Dynamic ||
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
166return type.TypeKind is not (TypeKind.Delegate or TypeKind.Struct or TypeKind.FunctionPointer or TypeKind.Pointer);
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (1)
87if (enclosingSymbol.TypeKind is not (TypeKind.Struct or TypeKind.Class))
Completion\Providers\AbstractPartialTypeCompletionProvider.cs (2)
95.Where(symbol => declaredSymbol.TypeKind == symbol.TypeKind &&
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 (2)
56if (constraintType.TypeKind == typeKind) 86if (constraintType.TypeKind == constraintTypeKind)
ConvertCast\AbstractConvertCastCodeRefactoringProvider.cs (1)
52if (type is { TypeKind: TypeKind.Error })
ConvertForEachToFor\AbstractConvertForEachToForCodeRefactoringProvider.cs (1)
279if (collectionType.TypeKind == TypeKind.Interface && knownCollectionInterfaces.Contains(collectionType.OriginalDefinition))
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (20)
292return (symbol is IParameterSymbol { ContainingType: not { TypeKind: TypeKind.Delegate } }) 329=> symbol.TypeKind switch 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 }) 4536if (oldType.TypeKind != newType.TypeKind || 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) 5602if (newType.TypeKind != oldType.TypeKind || oldType.IsRecord != newType.IsRecord) 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;
ExtractInterface\AbstractExtractInterfaceService.cs (3)
92if (semanticModel.GetDeclaredSymbol(typeNode, cancellationToken) is not INamedTypeSymbol { TypeKind: not TypeKind.Extension } typeToExtractFrom) 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 (1)
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 (1)
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 (3)
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 (3)
139if (_state.BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface || argumentList.Count == 0) 277if (_state.BaseTypeOrInterfaceOpt == null || _state.BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface) 287if (_state.BaseTypeOrInterfaceOpt != null && _state.BaseTypeOrInterfaceOpt.TypeKind == TypeKind.Interface)
GenerateType\AbstractGenerateTypeService.State.cs (3)
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
GoToBase\FindBaseHelpers.cs (1)
18TypeKind: TypeKind.Class or TypeKind.Interface or TypeKind.Struct,
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
73return !symbol.IsStatic && namedType.TypeKind is TypeKind.Interface or TypeKind.Class or TypeKind.Struct;
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (2)
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)
156return oldType.TypeKind;
PullMemberUp\MemberAndDestinationValidator.cs (1)
17if (destination.TypeKind is not TypeKind.Interface and not TypeKind.Class)
PullMemberUp\MembersPuller.cs (3)
64return pullMembersUpOptions.Destination.TypeKind switch 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 (2)
41if (containingType != null && containingType.TypeKind == TypeKind.Enum) 59switch (((INamedTypeSymbol)symbol).TypeKind)
Snippets\SnippetFunctionService.cs (1)
60if (typeSymbol?.TypeKind != TypeKind.Enum)
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 (1)
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 (1)
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 (2)
39if (!typeKinds.Contains(typeToGenerateIn.TypeKind)) 42if (typeToGenerateIn.TypeKind == TypeKind.Interface && isStatic)
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 (54)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
132switch (namedType.TypeKind)
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 (4)
46switch (possibleBase.TypeKind) 49if (type.TypeKind == 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\NamingStyleRules.cs (1)
66if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
362SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind,
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 (8)
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 (13)
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(); 260switch (typeSymbol.TypeKind) 544if (t1.TypeKind != t2.TypeKind) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (2)
84symbol = updatedContainingType.GetTypeMembers(symbol.Name, symbol.Arity).First(m => m.TypeKind == symbol.TypeKind);
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 (1)
258=> x.TypeKind switch
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
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 (12)
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 (5)
202symbol.TypeKind = TypeKind.Delegate AndAlso 256Select Case symbol.TypeKind 274Throw ExceptionUtilities.UnexpectedValue(symbol.TypeKind) 330Select Case symbol.TypeKind 445Dim keyword = GetTypeKindKeyword(symbol.TypeKind)
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\TypeSymbol.vb (1)
581Private ReadOnly Property ITypeSymbol_TypeKind As TypeKind Implements ITypeSymbol.TypeKind, ITypeSymbolInternal.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 (21)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateDefaultConstructors\VisualBasicGenerateDefaultConstructorsService.vb (1)
35Return classType IsNot Nothing AndAlso classType.TypeKind = TypeKind.Class
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 (1)
328objectCreationType.TypeKind = TypeKind.Delegate Then
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 (3)
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
Microsoft.CodeAnalysis.VisualBasic.Features (25)
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 (6)
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\NamedParameterCompletionProvider.vb (1)
147If type IsNot Nothing AndAlso within IsNot Nothing AndAlso type.TypeKind <> TypeKind.[Delegate] Then
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (4)
631Return method.ContainingType.TypeKind <> TypeKind.Struct 1417Select Case symbol.TypeKind 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
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 (33)
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 (1)
328objectCreationType.TypeKind = TypeKind.Delegate Then
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 (3)
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
Microsoft.CodeAnalysis.Workspaces (75)
Classification\ClassificationExtensions.cs (1)
10=> type.TypeKind switch
Editing\SymbolEditorExtensions.cs (1)
30if (baseOrInterfaceType.TypeKind != TypeKind.Error)
Editing\SyntaxGenerator.cs (2)
767var declaration = type.TypeKind switch 895switch (type.TypeKind)
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 (2)
22if (type?.TypeKind == TypeKind.Interface) 54t => t.TypeKind is TypeKind.Class or
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 (1)
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 (3)
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\NamingStyleRules.cs (1)
66if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
362SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind,
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 (8)
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 (13)
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(); 260switch (typeSymbol.TypeKind) 544if (t1.TypeKind != t2.TypeKind) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (2)
84symbol = updatedContainingType.GetTypeMembers(symbol.Name, symbol.Arity).First(m => m.TypeKind == symbol.TypeKind);
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 (1)
258=> x.TypeKind switch
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
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\INamedTypeSymbolExtensions.cs (1)
25namedType.TypeKind,
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 (4)
Parsing\Parser.LogProperties.cs (2)
307|| (property.Type.TypeKind == TypeKind.Delegate) 337_allowedTypeKinds.Contains(symType.TypeKind) &&
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 (4)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (4)
579returnType.TypeKind != TypeKind.Error) 638if (strongTypeSymbol.TypeKind == TypeKind.Class) 713kind = propertySymbol!.Type.TypeKind; 721kind = fieldSymbol!.Type.TypeKind;
Microsoft.Gen.Metrics (4)
Parser.cs (4)
579returnType.TypeKind != TypeKind.Error) 638if (strongTypeSymbol.TypeKind == TypeKind.Class) 713kind = propertySymbol!.Type.TypeKind; 721kind = fieldSymbol!.Type.TypeKind;
Microsoft.Gen.MetricsReports (4)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (4)
579returnType.TypeKind != TypeKind.Error) 638if (strongTypeSymbol.TypeKind == TypeKind.Class) 713kind = propertySymbol!.Type.TypeKind; 721kind = fieldSymbol!.Type.TypeKind;
Microsoft.Interop.ComInterfaceGenerator (8)
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 (2)
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 (17)
BlittableTypeMarshallingInfoProvider.cs (1)
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 (4)
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 (2)
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 (71)
AbstractCreateTestAccessor`1.cs (1)
56=> typeSymbol.TypeKind is TypeKind.Class or TypeKind.Struct;
AbstractExposeMemberForTesting`1.cs (1)
92=> typeSymbol.TypeKind is TypeKind.Class or TypeKind.Struct;
DefaultableTypeShouldHaveDefaultableFieldsAnalyzer.cs (2)
82if (containingType.TypeKind != TypeKind.Struct) 112switch (type.TypeKind)
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 (1)
132switch (namedType.TypeKind)
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 (4)
46switch (possibleBase.TypeKind) 49if (type.TypeKind == 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\NamingStyleRules.cs (1)
66if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (1)
362SymbolCategory.Type => symbol is ITypeSymbol type && type.TypeKind == (TypeKind)_kind,
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 (8)
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 (13)
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(); 260switch (typeSymbol.TypeKind) 544if (t1.TypeKind != t2.TypeKind) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum) 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.SubstituteTypesVisitor.cs (2)
84symbol = updatedContainingType.GetTypeMembers(symbol.Name, symbol.Arity).First(m => m.TypeKind == symbol.TypeKind);
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 (1)
258=> x.TypeKind switch
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (1)
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\INamedTypeSymbolExtensions.cs (1)
25namedType.TypeKind,
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 (38)
PreferNullLiteral.cs (2)
57if (type.TypeKind == TypeKind.Pointer) 61else if (type.TypeKind == TypeKind.Error)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
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 (3)
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 (10)
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 (3)
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
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)
21TypeKind = type.TypeKind;