22 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)
27public 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)
27public 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)
27public abstract TypeKind TypeKind { get; }
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\TypeSymbol.cs (1)
149TypeKind ITypeSymbol.TypeKind
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
68public TypeKind TypeKind => _symbol.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)
27public 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)
27public abstract TypeKind TypeKind { get; }
1140 references to TypeKind
Aspire.Hosting.Integration.Analyzers (5)
AspireExportAnalyzer.cs (5)
909contextNamedType.TypeKind is TypeKind.Enum or TypeKind.Interface) 963return type.TypeKind == TypeKind.Delegate || 1428namedType.TypeArguments[0].TypeKind is not TypeKind.Interface) 2228if (type.TypeKind == TypeKind.Enum) 2599return 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;
dotnet-format (1)
Analyzers\AnalyzerRunner.cs (1)
103if (compilation.ObjectType.TypeKind == TypeKind.Error)
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_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
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 }; 740if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
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_CreateEqualsMethod.cs (1)
518if (containingType?.TypeKind == TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
124member.ContainingType is { TypeKind: TypeKind.Interface } interfaceBeingImplemented)
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)) 534else 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.Components.Analyzers (1)
ComponentDisposableSanityAnalyzer.cs (1)
45if (type.TypeKind != TypeKind.Class || !type.AllInterfaces.Any(i => SymbolEqualityComparer.Default.Equals(i, iComponentType)))
Microsoft.AspNetCore.Http.RequestDelegateGenerator (6)
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)
StaticRouteHandlerModel\Emitters\EndpointParameterEmitter.cs (1)
340var receiverType = endpointParameter.BindableMethodSymbol?.ReceiverType is { TypeKind: TypeKind.Interface } targetType
StaticRouteHandlerModel\EndpointParameter.cs (1)
312if (type.TypeKind == TypeKind.Array)
StaticRouteHandlerModel\EndpointResponse.cs (1)
76ResponseType.TypeKind != TypeKind.Error &&
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.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)
3798return 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)
89ContainingType: { 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_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
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 }; 740if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
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_CreateEqualsMethod.cs (1)
518if (containingType?.TypeKind == TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
124member.ContainingType is { TypeKind: TypeKind.Interface } interfaceBeingImplemented)
Microsoft.CodeAnalysis.AnalyzerUtilities (59)
src\a172c07bebba4cd8\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (1)
37Debug.Assert(CollectionNamedTypes.All(ct => ct.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\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_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
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 }; 740if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
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\9547feb31df4cc5d\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
183if (value.Type.TypeKind == TypeKind.Dynamic)
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\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_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
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 }; 740if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
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)
402return 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)
117return _state.TypeToGenerateIn.TypeKind != TypeKind.Interface && _refKind != RefKind.None 124if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (3)
97if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface && state.IsStatic) 107var isOnlyReadAndIsInInterface = state.TypeToGenerateIn.TypeKind == TypeKind.Interface && !state.IsWrittenTo; 141if (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)
271var 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_CreateEqualsMethod.cs (1)
518if (containingType?.TypeKind == TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
124member.ContainingType is { TypeKind: TypeKind.Interface } interfaceBeingImplemented)
Microsoft.CodeAnalysis.CSharp (19)
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)
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)
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) 375if (rewrittenConvertedType.TypeKind == TypeKind.Error) 594originalConvertedType.IsReferenceType && rewrittenConvertedType.TypeKind == TypeKind.Dynamic) 1116if (!original.IsReferenceType || original.TypeKind == TypeKind.Interface) 1459if (originalMemberSymbol.ContainingType.TypeKind == TypeKind.Interface) 1499rewrittenType.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)
3062return ((INamedTypeSymbol)symbol).TypeKind == TypeKind.Enum; 3065return 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 (43)
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)
Simplification\Simplifiers\ExpressionSimplifier.cs (1)
323if (symbol is { IsStatic: true, ContainingType.TypeKind: TypeKind.Interface } &&
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) 375if (rewrittenConvertedType.TypeKind == TypeKind.Error) 594originalConvertedType.IsReferenceType && rewrittenConvertedType.TypeKind == TypeKind.Dynamic) 1116if (!original.IsReferenceType || original.TypeKind == TypeKind.Interface) 1459if (originalMemberSymbol.ContainingType.TypeKind == TypeKind.Interface) 1499rewrittenType.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)
3062return ((INamedTypeSymbol)symbol).TypeKind == TypeKind.Enum; 3065return 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_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
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 }; 740if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
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)
297return (symbol is IParameterSymbol { ContainingType: not { TypeKind: TypeKind.Delegate } }) 334=> symbol.TypeKind switch 345=> symbol.IsConst ? ((symbol.ContainingType.TypeKind == TypeKind.Enum) ? FeaturesResources.enum_value : FeaturesResources.const_field) : 3453if (oldSymbol is not INamedTypeSymbol { TypeKind: TypeKind.Delegate }) 3720=> IsMember(symbol) || symbol is INamedTypeSymbol { TypeKind: TypeKind.Delegate }; 3857if (symbol.ContainingType is { TypeKind: TypeKind.Interface }) 4541if (oldType.TypeKind != newType.TypeKind || 4767newParameter.ContainingType is INamedTypeSymbol { TypeKind: TypeKind.Delegate } newContainingDelegateType) 4775if (hasReturnTypeAttributeChange && newSymbol is INamedTypeSymbol { TypeKind: TypeKind.Delegate } newDelegateType) 5145if (record.TypeKind == TypeKind.Class) 5350(newSymbol.ContainingType.TypeKind == TypeKind.Struct) ? RudeEditKind.InsertOrMoveStructMember : RudeEditKind.InsertOrMoveTypeWithLayoutMember, 5440if (type.TypeKind == TypeKind.Struct) 5445if (type.TypeKind != TypeKind.Class) 5607if (newType.TypeKind != oldType.TypeKind || oldType.IsRecord != newType.IsRecord) 5755if (!isStatic && oldType.TypeKind == TypeKind.Class && newType.TypeKind == TypeKind.Class) 6077var isInInterface = newMember.ContainingType.TypeKind == TypeKind.Interface; 6362=> (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_Helpers.cs (2)
324if (memberSymbol.TypeKind == TypeKind.Interface) 337Debug.Assert(memberSymbol.TypeKind is TypeKind.Class or TypeKind.Struct);
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
73return !symbol.IsStatic && namedType.TypeKind is TypeKind.Interface or 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) 641if (symbol.ContainingType != null && symbol.ContainingType.TypeKind == TypeKind.Enum)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
68public 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\9547feb31df4cc5d\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (1)
183if (value.Type.TypeKind == TypeKind.Dynamic)
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\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)
402return 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)
117return _state.TypeToGenerateIn.TypeKind != TypeKind.Interface && _refKind != RefKind.None 124if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateVariable\AbstractGenerateVariableService.cs (3)
97if (state.TypeToGenerateIn.TypeKind == TypeKind.Interface && state.IsStatic) 107var isOnlyReadAndIsInInterface = state.TypeToGenerateIn.TypeKind == TypeKind.Interface && !state.IsWrittenTo; 141if (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)
271var 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.NetAnalyzers (145)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\AvoidEmptyInterfaces.cs (1)
47if (symbol.TypeKind == TypeKind.Interface &&
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\CollectionsShouldImplementGenericInterface.cs (2)
104Debug.Assert(interfacePairs.All(kvp => kvp.Key.TypeKind == TypeKind.Interface && kvp.Value.All(x => x.TypeKind == TypeKind.Interface)));
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\DoNotDeclareVisibleInstanceFields.cs (1)
66field.ContainingType?.TypeKind == TypeKind.Struct)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\DoNotNameEnumValuesReserved.cs (1)
46field.ContainingType.TypeKind != TypeKind.Enum ||
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\DoNotOverloadOperatorEqualsOnReferenceTypes.cs (1)
52method.ContainingType.TypeKind != TypeKind.Class)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\DoNotPrefixEnumValuesWithTypeName.cs (1)
51if (symbol.TypeKind != TypeKind.Enum || !(enumValues = symbol.GetMembers().Where(m => m.Kind == SymbolKind.Field && !m.IsImplicitlyDeclared)).Any())
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumShouldNotHaveDuplicatedValues.cs (1)
59if (enumSymbol.TypeKind != TypeKind.Enum)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumsShouldHaveZeroValue.cs (1)
105if (symbol.TypeKind != TypeKind.Enum)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumStorageShouldBeInt32.cs (1)
58if (symbol.TypeKind != TypeKind.Enum)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumWithFlagsAttribute.cs (1)
87symbol.TypeKind == TypeKind.Enum)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EquatableAnalyzer.cs (4)
67if ((namedType.TypeKind != TypeKind.Struct && namedType.TypeKind != TypeKind.Class) 68|| (namedType.TypeKind == TypeKind.Struct && namedType.IsRefLikeType)) 98if (overridesObjectEquals && !implementsEquatable && namedType.TypeKind == TypeKind.Struct)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EquatableAnalyzer.Fixer.cs (8)
51if (model.GetDeclaredSymbol(declaration, context.CancellationToken) is not INamedTypeSymbol type || type.TypeKind != TypeKind.Class && type.TypeKind != TypeKind.Struct) 65if (type.TypeKind == TypeKind.Struct && !TypeImplementsEquatable(type, equatableType)) 103type.TypeKind != TypeKind.Class && type.TypeKind != TypeKind.Struct) 116if (type.TypeKind == TypeKind.Struct && !TypeImplementsEquatable(type, equatableType)) 172returnStatement = typeSymbol.TypeKind == TypeKind.Class 178returnStatement = typeSymbol.TypeKind == TypeKind.Class
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\Helpers\EnumHelpers.cs (1)
64Debug.Assert(enumType.TypeKind == TypeKind.Enum);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\IdentifiersShouldHaveCorrectPrefix.cs (1)
100if (symbol.TypeKind == TypeKind.Interface &&
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\IdentifiersShouldHaveCorrectSuffix.cs (2)
123if (wellKnownNamedType.OriginalDefinition.TypeKind == TypeKind.Interface) 193eventSymbol.Type.TypeKind == TypeKind.Delegate &&
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\IdentifiersShouldNotContainUnderscores.cs (2)
155if (namedType.TypeKind == TypeKind.Delegate && 258if (containingType.TypeKind == TypeKind.Delegate)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\IdentifiersShouldNotHaveIncorrectSuffix.cs (1)
206if (namedTypeSymbol.TypeKind == TypeKind.Enum)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\ImplementIDisposableCorrectly.cs (2)
188if (type.TypeKind == TypeKind.Class && 249if (type != null && type.TypeKind == TypeKind.Class &&
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\InterfaceMethodsShouldBeCallableByChildTypes.cs (1)
103method.ContainingType.TypeKind != TypeKind.Class ||
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\NestedTypesShouldNotBeVisible.cs (4)
75if (nestedType.TypeKind == TypeKind.Delegate) 81if (nestedType.TypeKind == ITypeSymbolExtensions.ExtensionTypeKind) 110if (nestedType.TypeKind == TypeKind.Enum) 128DiagnosticDescriptor descriptor = containingType.TypeKind == TypeKind.Module
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OperatorOverloadsHaveNamedAlternates.cs (2)
251if (typeSymbol.TypeKind != TypeKind.Array) 261while (elementType.TypeKind == TypeKind.Array);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OperatorOverloadsHaveNamedAlternates.Fixer.cs (2)
66typeSymbol.TypeKind == TypeKind.Struct ? DeclarationKind.Struct : DeclarationKind.Class) is not SyntaxNode typeDeclaration) 92if (expectedSignature.Name == "CompareTo" && operatorOverloadSymbol.ContainingType.TypeKind == TypeKind.Class)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverloadOperatorEqualsOnOverridingValueTypeEquals.cs (1)
43!(namedTypeSymbol.IsRefLikeType && namedTypeSymbol.TypeKind == TypeKind.Struct) &&
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverrideEqualsAndOperatorEqualsOnValueTypes.cs (2)
73namedType.TypeKind == TypeKind.Enum || 74(namedType.TypeKind == TypeKind.Struct && namedType.IsRefLikeType) ||
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverrideEqualsOnOverloadingOperatorEquals.Fixer.cs (1)
36typeSymbol.TypeKind is not TypeKind.Class and not TypeKind.Struct)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverrideMethodsOnComparableTypes.cs (2)
92if (namedTypeSymbol.TypeKind == TypeKind.Interface || 93namedTypeSymbol.TypeKind == TypeKind.Enum ||
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverrideMethodsOnComparableTypes.Fixer.cs (2)
46return model.GetDeclaredSymbol(declaration, cancellationToken) is INamedTypeSymbol { TypeKind: TypeKind.Class or TypeKind.Struct } typeSymbol 61if (model.GetDeclaredSymbol(declaration, cancellationToken) is not INamedTypeSymbol { TypeKind: TypeKind.Class or TypeKind.Struct } typeSymbol)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\ParameterNamesShouldMatchBaseDeclaration.cs (1)
79if (originalDefinition.ContainingType.TypeKind != TypeKind.Interface)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\PropertiesShouldNotReturnArrays.cs (1)
45if (symbol.Type.TypeKind == TypeKind.Array && !symbol.IsOverride)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\UseGenericEventHandlerInstances.cs (1)
84namedType.TypeKind == TypeKind.Delegate && namedType.DelegateInvokeMethod != null;
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\UseIntegralOrStringArgumentForIndexers.cs (2)
89if (paramType.TypeKind == TypeKind.TypeParameter) 94if (paramType.TypeKind == TypeKind.Enum)
Microsoft.CodeQuality.Analyzers\Maintainability\AvoidUninstantiatedInternalClasses.cs (7)
181=> coClassAttributeSymbol != null && type.TypeKind == TypeKind.Interface; 192typeSymbol.TypeKind == TypeKind.Class) 201=> designerAttributeSymbol != null && (type.TypeKind == TypeKind.Interface || type.TypeKind == TypeKind.Class); 234=> debuggerTypeProxyAttributeSymbol != null && (type.TypeKind == TypeKind.Struct || type.TypeKind == TypeKind.Class); 305if (type.TypeKind != TypeKind.Class || type.IsAbstract || type.IsStatic)
Microsoft.CodeQuality.Analyzers\Maintainability\AvoidUnusedPrivateFields.cs (1)
69SpecialType specialType = argument.Type.TypeKind == TypeKind.Enum ?
Microsoft.CodeQuality.Analyzers\QualityGuidelines\DoNotInitializeUnnecessarily.cs (3)
57if (field.ContainingType?.TypeKind == TypeKind.Struct && !field.IsStatic) 80if (prop.ContainingType?.TypeKind == TypeKind.Struct && !prop.IsStatic) 128(type.IsPrimitiveType() || type.TypeKind == TypeKind.Enum) &&
Microsoft.CodeQuality.Analyzers\QualityGuidelines\MarkMembersAsStatic.cs (1)
134else if (operation.Parameter.ContainingSymbol is ITypeSymbol { TypeKind: ITypeSymbolExtensions.ExtensionTypeKind })
Microsoft.CodeQuality.Analyzers\QualityGuidelines\PreferJaggedArraysOverMultidimensional.cs (1)
148while (type.TypeKind == TypeKind.Array)
Microsoft.CodeQuality.Analyzers\QualityGuidelines\SealMethodsThatSatisfyPrivateInterfaces.cs (2)
48if (type.TypeKind != TypeKind.Class || 96&& member.ContainingType.TypeKind == TypeKind.Class;
Microsoft.NetCore.Analyzers\InteropServices\DisableRuntimeMarshallingAnalyzer.AutoLayoutTypeCache.cs (1)
63SpecialType specialType = argument.Type.TypeKind == TypeKind.Enum ?
Microsoft.NetCore.Analyzers\InteropServices\DisableRuntimeMarshallingAnalyzer.DelegateInteropUsageAnalyzer.cs (8)
59if (operation.Arguments.Length == 2 && operation.Arguments.GetArgumentForParameterAtIndex(1) is { Value: ITypeOfOperation { TypeOperand: INamedTypeSymbol { TypeKind: TypeKind.Delegate } delegateType } } arg) 66if (operation.TargetMethod.TypeArguments.Length == 1 && operation.TargetMethod.TypeArguments[0] is INamedTypeSymbol { TypeKind: TypeKind.Delegate } delegateType) 75if (conversion.Operand.Type is INamedTypeSymbol { TypeKind: TypeKind.Delegate } delegateType) 85if (argumentValue.Type is INamedTypeSymbol { TypeKind: TypeKind.Delegate } delegateType) 119if (param.Type.TypeKind == TypeKind.Delegate) 123else if (param.Type is IArrayTypeSymbol { ElementType.TypeKind: TypeKind.Delegate }) 129if (symbol.ReturnType.TypeKind == TypeKind.Delegate) 133else if (symbol.ReturnType is IArrayTypeSymbol { ElementType.TypeKind: TypeKind.Delegate })
Microsoft.NetCore.Analyzers\InteropServices\DisableRuntimeMarshallingAnalyzer.DisabledRuntimeMarshallingAssemblyAnalyzer.cs (1)
121if (type.TypeKind != TypeKind.Delegate || !type.HasAnyAttribute(_unmanagedFunctionPointerAttribute))
Microsoft.NetCore.Analyzers\InteropServices\DynamicInterfaceCastableImplementation.cs (1)
85if (targetType.TypeKind != TypeKind.Interface)
Microsoft.NetCore.Analyzers\InteropServices\ProvidePublicParameterlessSafeHandleConstructor.cs (1)
52if (type.TypeKind != TypeKind.Class)
Microsoft.NetCore.Analyzers\Performance\ConstantExpectedAnalyzer.cs (3)
276SpecialType.None when type.TypeKind == TypeKind.TypeParameter => true, 378case SpecialType.None when parameterSymbol.Type.TypeKind == TypeKind.TypeParameter: 418if (parameterSymbol?.Type.TypeKind is TypeKind.Enum)
Microsoft.NetCore.Analyzers\Performance\PreferReadOnlySpanOverSpan.cs (1)
65methodSymbol.ContainingType.TypeKind is TypeKind.Interface ||
Microsoft.NetCore.Analyzers\Performance\UseAsSpanInsteadOfRangeIndexer.cs (1)
188else if (containingType.TypeKind == TypeKind.Array)
Microsoft.NetCore.Analyzers\Performance\UseConcreteTypeAnalyzer.cs (4)
132if (namedType.TypeKind == TypeKind.Interface) 278if (!t.IsAbstract && fromType.TypeKind is TypeKind.Interface) 307if (targets != null && fromType.TypeKind != TypeKind.Interface) 335if (toType.TypeKind is not TypeKind.Class and not TypeKind.Array and not TypeKind.Struct)
Microsoft.NetCore.Analyzers\Performance\UseCountProperly.cs (1)
672if (type.TypeKind == TypeKind.Interface)
Microsoft.NetCore.Analyzers\Runtime\AttributeStringLiteralsShouldParseCorrectly.cs (1)
97if (namedType.TypeKind == TypeKind.Delegate && namedType.DelegateInvokeMethod != null)
Microsoft.NetCore.Analyzers\Runtime\AvoidZeroLengthArrayAllocations.cs (1)
117if (elementType.TypeKind != TypeKind.Pointer)
Microsoft.NetCore.Analyzers\Runtime\DetectPreviewFeatureAnalyzer.cs (1)
521return symbol.IsStatic && symbol.IsAbstract && symbol.ContainingType != null && symbol.ContainingType.TypeKind == TypeKind.Interface && !SymbolIsAnnotatedAsPreview(symbol, requiresPreviewFeaturesSymbols, previewFeatureAttributeSymbol);
Microsoft.NetCore.Analyzers\Runtime\DisposeObjectsBeforeLosingScope.cs (1)
188type.TypeKind == TypeKind.Delegate;
Microsoft.NetCore.Analyzers\Runtime\DoNotCallEnumerableCastOrOfTypeWithIncompatibleTypesAnalyzer.cs (6)
194if (castFrom.TypeKind == TypeKind.Error 195|| castTo.TypeKind == TypeKind.Error) 246if (t.TypeKind == TypeKind.Class) 255switch (castFrom.TypeKind, castTo.TypeKind) 274if (castTo.TypeKind == TypeKind.TypeParameter)
Microsoft.NetCore.Analyzers\Runtime\DoNotLockOnObjectsWithWeakIdentity.cs (1)
96switch (type.TypeKind)
Microsoft.NetCore.Analyzers\Runtime\DoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectly.cs (1)
98if (targetType.TypeKind == TypeKind.Interface && targetType.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IReadOnlyList_T)
Microsoft.NetCore.Analyzers\Runtime\PreferTypedStringBuilderAppendOverloads.cs (2)
59s.Parameters[0].Type.TypeKind != TypeKind.Array); 67s.Parameters[1].Type.TypeKind != TypeKind.Array);
Microsoft.NetCore.Analyzers\Runtime\SealInternalTypes.cs (1)
54if (type.TypeKind is TypeKind.Class &&
Microsoft.NetCore.Analyzers\Runtime\SerializationRulesDiagnosticAnalyzer.cs (2)
105if (namedTypeSymbol.TypeKind is TypeKind.Delegate or TypeKind.Interface) 187return type.TypeKind switch
Microsoft.NetCore.Analyzers\Runtime\UseExceptionThrowHelpers.cs (1)
270p.Type?.TypeKind == TypeKind.Enum;
Microsoft.NetCore.Analyzers\Security\DataSetDataTableInWebSerializableObjectGraphAnalyzer.cs (1)
82if (namedTypeSymbol.TypeKind is not TypeKind.Interface
Microsoft.NetCore.Analyzers\Security\DoNotCallDangerousMethodsInDeserialization.cs (4)
134fieldSymbol.Type.TypeKind == TypeKind.Delegate)) 161if (possibleDelegateSymbol.TypeKind != TypeKind.Delegate) 182calledSymbol.ContainingType.TypeKind == TypeKind.Interface || 185possibleDelegateSymbol.TypeKind == TypeKind.Delegate)
Microsoft.NetCore.Analyzers\Security\DoNotSerializeTypeWithPointerFields.cs (1)
88if (pointerTypeSymbol.PointedAtType.TypeKind is TypeKind.Struct or
Microsoft.NetCore.Analyzers\Security\UseAutoValidateAntiforgeryToken.cs (1)
149if (fieldSymbol.Type.TypeKind == TypeKind.Delegate)
Microsoft.NetCore.Analyzers\Tasks\DoNotConfigureAwaitWithSuppressThrowing.cs (1)
44configureAwaitOptionsType.TypeKind != TypeKind.Enum ||
Microsoft.NetCore.Analyzers\Usage\ProvideCorrectArgumentToEnumHasFlag.cs (2)
54invocation.Instance.Type.TypeKind != TypeKind.TypeParameter && 55conversion.Operand.Type?.TypeKind != TypeKind.TypeParameter &&
Microsoft.NetFramework.Analyzers\MarkVerbHandlersWithValidateAntiforgeryTokenAnalyzer.MvcAttributeSymbols.cs (2)
94&& parameterType.TypeKind == TypeKind.Array) 113else if (parameterType.TypeKind == TypeKind.Enum
src\afc74d572e54ec72\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (1)
34Debug.Assert(CollectionNamedTypes.All(ct => ct.TypeKind == TypeKind.Interface));
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
133switch (namedType.TypeKind)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
689=> methodSymbol.Parameters.Any(p => p.Type.TypeKind == TypeKind.Delegate);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\INamedTypeSymbolExtensions.cs (1)
139if (symbol.TypeKind != TypeKind.Class)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\IOperationExtensions.cs (1)
101if (operation.Type.TypeKind == TypeKind.Enum)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\ISymbolExtensions.cs (3)
93typeSymbol.TypeKind == TypeKind.Error; 401if (type1.TypeKind == TypeKind.TypeParameter && 402type2.TypeKind == TypeKind.TypeParameter &&
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (5)
54switch (possibleBase.TypeKind) 57if (type.TypeKind == TypeKind.Interface) 100if (!baseTypesOnly && candidateBaseType.TypeKind == TypeKind.Interface) 115if (checkTypeParameterConstraints && symbol.TypeKind == TypeKind.TypeParameter) 353if (invocationTarget.TypeKind == TypeKind.Interface)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Options\AnalyzerOptionsExtensions.cs (1)
411namedType.TypeKind != TypeKind.Interface ||
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataSymbolMap.cs (1)
122if (namedTypeSymbol.TypeKind == TypeKind.Interface
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (3)
1346static bool IsInterfaceOrTypeParameter(ITypeSymbol? type) => type?.TypeKind is TypeKind.Interface or TypeKind.TypeParameter; 2401if (argument.Parameter?.Type.TypeKind == TypeKind.Delegate || 2408if (argument.Parameter.Type.TypeKind == TypeKind.Delegate)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Workspaces\SyntaxGeneratorExtensions.cs (6)
41if (containingType.TypeKind == TypeKind.Class) 142if (containingType.TypeKind == TypeKind.Class) 194if (containingType.TypeKind == TypeKind.Class) 241if (containingType.TypeKind == TypeKind.Class) 289if (containingType.TypeKind == TypeKind.Class) 355if (containingType.TypeKind == TypeKind.Class)
Microsoft.CodeAnalysis.Razor.Compiler (18)
CSharp\CompilationExtensions.cs (3)
27if (type is null || type.TypeKind == TypeKind.Error) 45byteType.TypeKind == TypeKind.Error) 77if (stringType.TypeKind == TypeKind.Error ||
CSharp\CompilationTagHelperFeature.cs (1)
44return @string != null && @string.TypeKind != TypeKind.Error;
CSharp\DefaultTagHelperDescriptorFactory.cs (1)
227if (property.Type.TypeKind == TypeKind.Enum)
CSharp\Utf8SupportMap.cs (2)
76if (type is not null && type.TypeKind != TypeKind.Error) 170if (symbol is not null && symbol.TypeKind != TypeKind.Error)
Language\Extensions\INamedTypeSymbolExtensions.cs (1)
11=> symbol.TypeKind != TypeKind.Error &&
Language\TagHelpers\Producers\ComponentTagHelperProducer.cs (3)
466Parameters: [{ Type.TypeKind: TypeKind.Delegate }] 800return property.Type.TypeKind == TypeKind.Enum; 819return 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_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
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 }; 740if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
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.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.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_ImplementingTypes.cs (2)
22if (type?.TypeKind == TypeKind.Interface) 54t => t.TypeKind is TypeKind.Class or
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\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_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
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 }; 740if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
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_CreateEqualsMethod.cs (1)
518if (containingType?.TypeKind == TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
124member.ContainingType is { TypeKind: TypeKind.Interface } interfaceBeingImplemented)
Microsoft.Diagnostics.DataContractReader.DataGenerator (1)
Parser.cs (1)
464if (type.TypeKind == TypeKind.Enum &&
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.Configuration.Binder.SourceGeneration (6)
ConfigurationBindingGenerator.Parser.cs (5)
70type.TypeKind is TypeKind.TypeParameter or TypeKind.Pointer or TypeKind.Error || 196else if (type.TypeKind is TypeKind.Array) 663if (!(typeSymbol.IsAbstract || typeSymbol.TypeKind is TypeKind.Interface)) 931if (type.TypeKind is TypeKind.Error) 971if (typeArg.TypeKind is TypeKind.TypeParameter or TypeKind.Error ||
src\runtime\src\libraries\Common\src\SourceGenerators\TypeRef.cs (1)
21TypeKind = type.TypeKind;
Microsoft.Extensions.Options.SourceGeneration (1)
Parser.cs (1)
328if (ta.TypeKind == TypeKind.TypeParameter)
Microsoft.Extensions.Validation.ValidationsGenerator (3)
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.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)
90if (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)
parent\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)
118if (attrData.AttributeClass?.TypeKind is null or TypeKind.Error)
Microsoft.Interop.LibraryImportGenerator (3)
Analyzers\LibraryImportDiagnosticsAnalyzer.cs (1)
325if (attrData.AttributeClass?.TypeKind is null or TypeKind.Error)
LibraryImportGenerator.cs (1)
175if (attrData.AttributeClass?.TypeKind is null or TypeKind.Error)
parent\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
269if (methodSymbol.ReturnType is { TypeKind: TypeKind.Struct }
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
DownlevelLibraryImportDiagnosticsAnalyzer.cs (1)
326if (attrData.AttributeClass?.TypeKind is null or TypeKind.Error)
DownlevelLibraryImportGenerator.cs (1)
156if (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)
403while (innerType.TypeKind is TypeKind.Array or TypeKind.Pointer) 427if (wrapperType.TypeKind == TypeKind.Pointer) 431else if (wrapperType.TypeKind == TypeKind.Array) 451if (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_Accessibility.cs (1)
196typeArg.TypeKind != TypeKind.Error &&
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 }; 740if (!methods.Any(x => x is { Name: WellKnownMemberNames.OnCompleted, ReturnsVoid: true, Parameters: [{ Type.TypeKind: TypeKind.Delegate }] }))
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_CreateEqualsMethod.cs (1)
518if (containingType?.TypeKind == TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions.cs (1)
124member.ContainingType is { TypeKind: TypeKind.Interface } interfaceBeingImplemented)
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) 375if (rewrittenConvertedType.TypeKind == TypeKind.Error) 594originalConvertedType.IsReferenceType && rewrittenConvertedType.TypeKind == TypeKind.Dynamic) 1116if (!original.IsReferenceType || original.TypeKind == TypeKind.Interface) 1459if (originalMemberSymbol.ContainingType.TypeKind == TypeKind.Interface) 1499rewrittenType.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)
3062return ((INamedTypeSymbol)symbol).TypeKind == TypeKind.Enum; 3065return 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);
System.Text.Json.SourceGeneration (10)
Helpers\RoslynExtensions.cs (7)
109if (type.IsAbstract || type.TypeKind is TypeKind.Interface || type is not INamedTypeSymbol namedType) 140if (baseType.TypeKind is TypeKind.Interface) 185if (baseTypeDefinition.TypeKind is TypeKind.Interface) 646if (type.TypeKind != TypeKind.Interface) 820if (type is not { TypeKind: TypeKind.Class, IsAbstract: true }) 874Debug.Assert(closedType.TypeKind is TypeKind.Class); 1169if (originalSuperType.TypeKind == TypeKind.Interface)
JsonSourceGenerator.Parser.cs (2)
747else if (type.TypeKind is TypeKind.Enum) 1906if (type.TypeKind is TypeKind.Enum)
src\runtime\src\libraries\Common\src\SourceGenerators\TypeRef.cs (1)
21TypeKind = type.TypeKind;