401 references to Class
GenerateDocumentationAndConfigFiles (16)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
48case TypeKind.Class:
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\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
104private static readonly SymbolKindOrTypeKind s_class = new(TypeKind.Class); 329case TypeKind.Class:
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)
62new SymbolKindOrTypeKind(TypeKind.Class),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (2)
351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 555TypeKind: TypeKind.Class or TypeKind.Struct
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
261TypeKind.Module => TypeKind.Class,
ILLink.RoslynAnalyzer (2)
RequiresAnalyzerBase.cs (1)
190if (typeSymbol.TypeKind != TypeKind.Class || typeSymbol.BaseType == null)
TrimAnalysis\SingleValueExtensions.cs (1)
26TypeKind.Class or TypeKind.Enum or TypeKind.Interface or TypeKind.Struct =>
Microsoft.AspNetCore.App.Analyzers (1)
src\aspnetcore\src\Shared\Roslyn\MvcFacts.cs (1)
17if (type.TypeKind != TypeKind.Class)
Microsoft.AspNetCore.App.SourceGenerators (1)
PublicTopLevelProgramGenerator.cs (1)
32TypeKind: TypeKind.Class,
Microsoft.AspNetCore.Mvc.Analyzers (2)
AttributesShouldNotBeAppliedToPageModelAnalyzer.cs (1)
77return type.TypeKind == TypeKind.Class &&
src\aspnetcore\src\Shared\Roslyn\MvcFacts.cs (1)
17if (type.TypeKind != TypeKind.Class)
Microsoft.AspNetCore.Mvc.Api.Analyzers (1)
src\aspnetcore\src\Shared\Roslyn\MvcFacts.cs (1)
17if (type.TypeKind != TypeKind.Class)
Microsoft.AspNetCore.OpenApi.SourceGenerators (3)
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 (1)
297if (typeSymbol.TypeKind == TypeKind.Class)
Microsoft.CodeAnalysis.Analyzers (19)
MetaAnalyzers\ClassIsNotDiagnosticAnalyzer.cs (1)
51if (namedType.TypeKind == TypeKind.Class &&
MetaAnalyzers\CompareSymbolsCorrectlyAnalyzer.cs (1)
297operation.Type.TypeKind == TypeKind.Class &&
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
134case TypeKind.Class:
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
48case TypeKind.Class:
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\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
104private static readonly SymbolKindOrTypeKind s_class = new(TypeKind.Class); 329case TypeKind.Class:
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)
62new SymbolKindOrTypeKind(TypeKind.Class),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (2)
351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 555TypeKind: TypeKind.Class or TypeKind.Struct
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
261TypeKind.Module => TypeKind.Class,
Microsoft.CodeAnalysis.AnalyzerUtilities (11)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
134case TypeKind.Class:
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
48case TypeKind.Class:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
104private static readonly SymbolKindOrTypeKind s_class = new(TypeKind.Class); 329case TypeKind.Class:
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)
62new SymbolKindOrTypeKind(TypeKind.Class),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (2)
351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 555TypeKind: TypeKind.Class or TypeKind.Struct
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
261TypeKind.Module => TypeKind.Class,
Microsoft.CodeAnalysis.CodeStyle (10)
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\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
104private static readonly SymbolKindOrTypeKind s_class = new(TypeKind.Class); 329case TypeKind.Class:
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)
62new SymbolKindOrTypeKind(TypeKind.Class),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (2)
351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 555TypeKind: TypeKind.Class or TypeKind.Struct
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
261TypeKind.Module => TypeKind.Class,
Microsoft.CodeAnalysis.CodeStyle.Fixes (7)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
403return TypeToGenerateIn?.TypeKind is (TypeKind?)TypeKind.Class or (TypeKind?)TypeKind.Struct;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
22TypeKind.Class,
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\ImplementInterface\ImplementHelpers.cs (1)
226if (state.ClassOrStructType.TypeKind != TypeKind.Class)
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
272var condition1 = typeParameter.ConstraintTypes.Count(t => t.TypeKind == TypeKind.Class) >= 2;
src\roslyn\src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
40type.TypeKind == TypeKind.Class && type.IsSealed && !type.IsStatic)
Microsoft.CodeAnalysis.CSharp (103)
Binder\Binder_Constraints.cs (2)
505type.TypeKind == TypeKind.Class) 597case TypeKind.Class:
Binder\Binder_Conversions.cs (2)
860case TypeKind.Class when !type.IsAnonymousType: // We don't want to enable object creation with unspeakable types 869case TypeKind.Class:
Binder\Binder_Crefs.cs (1)
776case TypeKind.Class:
Binder\Binder_Expressions.cs (6)
5297case TypeKind.Class: 5315goto case TypeKind.Class; 5325goto case TypeKind.Class; 5723Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 7116Debug.Assert(coClassType.TypeKind == TypeKind.Class || coClassType.TypeKind == TypeKind.Error); 9944case TypeKind.Class:
Binder\Binder_Lookup.cs (2)
236case TypeKind.Class: 1925case TypeKind.Class:
Binder\ForEachLoopBinder.cs (1)
1650case TypeKind.Class:
Binder\Semantics\Conversions\ConversionsBase.cs (1)
2672case TypeKind.Class:
Binder\Semantics\Operators\OperatorFacts.cs (1)
22case TypeKind.Class:
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (6)
2263if (target.TypeKind != TypeKind.Class) 2282if (source.TypeKind == TypeKind.Class) 2325case TypeKind.Class: 2660if (source.TypeKind != TypeKind.Class || target.TypeKind != TypeKind.Class) 2702case TypeKind.Class:
Compilation\CSharpCompilation.cs (1)
2032if (mainType is null || mainType.IsGenericType || (mainType.TypeKind != TypeKind.Class && mainType.TypeKind != TypeKind.Struct && !mainType.IsInterface))
Compiler\ClsComplianceChecker.cs (1)
1000case TypeKind.Class:
Compiler\MethodCompiler.cs (1)
643containingType is { IsImplicitlyDeclared: false, TypeKind: TypeKind.Class or TypeKind.Struct or TypeKind.Interface } &&
FlowAnalysis\DefiniteAssignment.cs (1)
2597case TypeKind.Class:
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (2)
582LocalSymbol thisTemp = (F.CurrentType.TypeKind == TypeKind.Class) ? F.SynthesizedLocal(F.CurrentType) : null; 643LocalSymbol thisTemp = (F.CurrentType.TypeKind == TypeKind.Class) ? F.SynthesizedLocal(F.CurrentType) : null;
Lowering\AsyncRewriter\AsyncRewriter.cs (4)
74var typeKind = (compilationState.Compilation.Options.EnableEditAndContinue || method.IsIterator) ? TypeKind.Class : TypeKind.Struct; 172if (F.CurrentType.TypeKind == TypeKind.Class) 195if (stateMachineType.TypeKind == TypeKind.Class) 204if (frameType.TypeKind == TypeKind.Class)
Lowering\ClosureConversion\SynthesizedClosureEnvironment.cs (1)
56TypeKind = isStruct ? TypeKind.Struct : TypeKind.Class;
Lowering\IteratorRewriter\IteratorStateMachine.cs (1)
48get { return TypeKind.Class; }
Lowering\LocalRewriter\DelegateCacheContainer.cs (1)
50public override TypeKind TypeKind => TypeKind.Class;
Lowering\LocalRewriter\DynamicSiteContainer.cs (1)
42get { return TypeKind.Class; }
SymbolDisplay\SymbolDisplayVisitor.Types.cs (4)
643case TypeKind.Class when symbol.IsRecord: 649case TypeKind.Class: 743case TypeKind.Class when symbol.IsRecord: 765case TypeKind.Class:
Symbols\AnonymousTypes\PublicSymbols\AnonymousType.TypePublicSymbol.cs (1)
80get { return TypeKind.Class; }
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (1)
103get { return TypeKind.Class; }
Symbols\AssemblySymbol.cs (3)
521=> GetSpecialType(InternalSpecialType.System_Runtime_CompilerServices_AsyncHelpers) is { TypeKind: TypeKind.Class, IsStatic: true }; 528return GetSpecialType(SpecialType.System_Runtime_CompilerServices_RuntimeFeature) is { TypeKind: TypeKind.Class, IsStatic: true } && 551GetSpecialType(SpecialType.System_Runtime_CompilerServices_PreserveBaseOverridesAttribute) is { TypeKind: TypeKind.Class };
Symbols\Compilation_WellKnownMembers.cs (1)
227if (type.Kind != SymbolKind.NamedType || type.TypeKind != TypeKind.Class)
Symbols\ConstraintsHelper.cs (4)
220case TypeKind.Class: 1490case TypeKind.Class: 1515Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 1566case TypeKind.Class:
Symbols\EnumConversions.cs (1)
21return TypeKind.Class;
Symbols\Metadata\PE\NativeIntegerTypeDecoder.cs (1)
95case TypeKind.Class:
Symbols\Metadata\PE\PEMethodSymbol.cs (1)
1342if ((this.ContainingType.TypeKind == TypeKind.Class && this.IsRuntimeFinalizer(skipFirstMethodKindCheck: true)) ||
Symbols\Metadata\PE\PENamedTypeSymbol.cs (7)
2203case TypeKind.Class: 2253result = TypeKind.Class; 2405bool checkForExtensionGroup = this.IsStatic && this.ContainingType is null && this.TypeKind == TypeKind.Class && 2428type.TypeKind == TypeKind.Class && type.BaseTypeNoUseSiteDiagnostics.IsObjectType() && 2452marker.TypeKind == TypeKind.Class && marker.BaseTypeNoUseSiteDiagnostics.IsObjectType() && marker.Arity == 0 && 2739else if (TypeKind == TypeKind.Class && SpecialType != SpecialType.System_Enum) 2991var coClassType = ((object)type != null && (type.TypeKind == TypeKind.Class || type.IsErrorType())) ? (NamedTypeSymbol)type : null;
Symbols\NamedTypeSymbol.cs (1)
1873return TypeKind is TypeKind.Class or TypeKind.Struct &&
Symbols\Source\ExplicitInterfaceHelpers.cs (1)
197case TypeKind.Class:
Symbols\Source\SourceEventSymbol.cs (1)
707else if (IsAbstract && !ContainingType.IsAbstract && (ContainingType.TypeKind == TypeKind.Class || ContainingType.TypeKind == TypeKind.Submission))
Symbols\Source\SourceMemberContainerSymbol.cs (8)
264Debug.Assert(typeKind is TypeKind.Struct or TypeKind.Class || !HasPrimaryConstructor); 329case TypeKind.Class: 402case TypeKind.Class: 1500case TypeKind.Class: 3705case TypeKind.Class: 3979if (TypeKind is TypeKind.Class) 3988case TypeKind.Class: 3994if (TypeKind == TypeKind.Class) // Tracked by https://github.com/dotnet/roslyn/issues/78827 : MQ, Consider tightening this check to only top-level non-generic static classes, however optimizing for error scenarios is usually not a goal.
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
524case TypeKind.Class:
Symbols\Source\SourceMethodSymbolWithAttributes.cs (1)
1487if (ContainingSymbol is NamedTypeSymbol { IsComImport: true, TypeKind: TypeKind.Class or TypeKind.Interface })
Symbols\Source\SourceNamedTypeSymbol.cs (5)
830case TypeKind.Class: 1257return builderType is NamedTypeSymbol { TypeKind: TypeKind.Class or TypeKind.Struct, IsGenericType: false }; 1364if ((object)coClassType != null && coClassType.TypeKind == TypeKind.Class) 1658if (this.TypeKind == TypeKind.Class) 2080|| TypeKind != TypeKind.Class
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (6)
524if (i == 0 && TypeKind == TypeKind.Class) // allow class in the first position 575if ((baseType.TypeKind == TypeKind.Class || 638case TypeKind.Class: 639if (TypeKind == TypeKind.Class) 689if (TypeKind != TypeKind.Class || baseType.TypeKind == TypeKind.Interface) 797case TypeKind.Class:
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
920else if (IsAbstract && !ContainingType.IsAbstract && (ContainingType.TypeKind == TypeKind.Class || ContainingType.TypeKind == TypeKind.Submission))
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
579if (IsAbstract && !ContainingType.IsAbstract && (ContainingType.TypeKind == TypeKind.Class || ContainingType.TypeKind == TypeKind.Submission))
Symbols\Symbol_Attributes.cs (1)
70case TypeKind.Class:
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (1)
147public override TypeKind TypeKind => TypeKind.Class;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (1)
860public override TypeKind TypeKind => TypeKind.Class;
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (1)
79public override TypeKind TypeKind => TypeKind.Class;
Symbols\Synthesized\SynthesizedHotReloadExceptionSymbol.cs (1)
106public override TypeKind TypeKind => TypeKind.Class;
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
84Debug.Assert(_containingType.TypeKind == TypeKind.Class);
Symbols\Synthesized\SynthesizedPrivateImplementationDetailsType.cs (1)
57public override TypeKind TypeKind => TypeKind.Class;
Symbols\TypeSymbolExtensions.cs (6)
358return type.TypeKind == TypeKind.Class; 461case TypeKind.Class: 747case TypeKind.Class: 822case TypeKind.Class: 896case TypeKind.Class: 1598case TypeKind.Class:
Symbols\VarianceSafety.cs (2)
75case TypeKind.Class: 373case TypeKind.Class:
Utilities\TypeSymbolExtensions.cs (2)
186case TypeKind.Class: 278case TypeKind.Class:
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
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 (1)
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)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (11)
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\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsService.cs (1)
39return classType?.TypeKind is TypeKind.Class or TypeKind.Struct;
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\NamedTypeGenerator.cs (3)
200var isRecordClass = namedType.TypeKind is TypeKind.Class; 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\ITypeParameterSymbolExtensions.cs (2)
59typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Class).Concat( 61typeParameter.ConstraintTypes.Where(t => t.TypeKind is not TypeKind.Class and not TypeKind.Interface)));
Microsoft.CodeAnalysis.CSharp.Features (14)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
342if (type.TypeKind is TypeKind.Struct or TypeKind.Class)
Completion\CompletionProviders\ExplicitInterfaceMemberCompletionProvider.ItemGetter.cs (1)
108if (containingType is not INamedTypeSymbol { TypeKind: TypeKind.Class or TypeKind.Struct or TypeKind.Interface })
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (1)
191if (within is not { TypeKind: TypeKind.Struct or TypeKind.Class })
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (1)
1966TypeKind.Class => symbol.IsRecord ? CSharpFeaturesResources.record_ : FeaturesResources.class_,
SignatureHelp\ConstructorInitializerSignatureHelpProvider.cs (1)
71if (within.TypeKind is not TypeKind.Struct and not TypeKind.Class)
Snippets\CSharpClassSnippetProvider.cs (1)
19: AbstractCSharpTypeSnippetProvider<ClassDeclarationSyntax>(TypeKind.Class)
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 (1)
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\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsService.cs (1)
39return classType?.TypeKind is TypeKind.Class or TypeKind.Struct;
src\roslyn\src\Analyzers\CSharp\CodeFixes\UsePrimaryConstructor\CSharpUsePrimaryConstructorCodeFixProvider.cs (1)
390semanticModel.GetSymbolInfo(baseType.Type, cancellationToken).GetAnySymbol() is INamedTypeSymbol { TypeKind: TypeKind.Class })
Microsoft.CodeAnalysis.CSharp.Workspaces (6)
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\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (3)
200var isRecordClass = namedType.TypeKind is TypeKind.Class; 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\ITypeParameterSymbolExtensions.cs (2)
59typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Class).Concat( 61typeParameter.ConstraintTypes.Where(t => t.TypeKind is not TypeKind.Class and not TypeKind.Interface)));
Microsoft.CodeAnalysis.Extensions.Package (5)
Symbols\INamedTypeSymbolExtensions.cs (2)
351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 555TypeKind: TypeKind.Class or TypeKind.Struct
Symbols\ISymbolExtensions.cs (1)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } &&
Symbols\ITypeSymbolExtensions.cs (1)
52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract;
Symbols\SymbolEquivalenceComparer.cs (1)
261TypeKind.Module => TypeKind.Class,
Microsoft.CodeAnalysis.Features (30)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
106=> typeSymbol.TypeKind is TypeKind.Class or TypeKind.Struct;
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (1)
87if (enclosingSymbol.TypeKind is not (TypeKind.Struct or TypeKind.Class))
Completion\Providers\ImportCompletionProvider\ExtensionMemberImportCompletionHelper.SymbolComputer_Constraints.cs (1)
34=> CheckConstraints(receiverTypeSymbol, typeParameter, TypeKind.Class, static type => type.GetBaseTypesAndThis());
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (1)
317isRecord, TypeKind.Class, className, capturedTypeParameters, members: members);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (5)
331TypeKind.Class => FeaturesResources.class_, 5140if (record.TypeKind == TypeKind.Class) 5440if (type.TypeKind != TypeKind.Class) 5750if (!isStatic && oldType.TypeKind == TypeKind.Class && newType.TypeKind == TypeKind.Class)
ExtractClass\ExtractClassWithDialogCodeAction.cs (1)
89TypeKind.Class,
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)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (1)
90if (containingType?.TypeKind is not TypeKind.Class and not TypeKind.Struct)
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (1)
317: TypeKind.Class;
GenerateType\AbstractGenerateTypeService.State.cs (2)
253if (baseType.TypeKind is not TypeKind.Class and not TypeKind.Interface) 301if (TypeToGenerateInOpt.TypeKind is not TypeKind.Class and
GoToBase\FindBaseHelpers.cs (1)
18TypeKind: TypeKind.Class or TypeKind.Interface or TypeKind.Struct,
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
73return !symbol.IsStatic && namedType.TypeKind is TypeKind.Interface or TypeKind.Class or TypeKind.Struct;
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
337Debug.Assert(memberSymbol.TypeKind is TypeKind.Class or TypeKind.Struct);
PullMemberUp\MemberAndDestinationValidator.cs (1)
17if (destination.TypeKind is not TypeKind.Interface and not TypeKind.Class)
PullMemberUp\MembersPuller.cs (1)
68TypeKind.Class or TypeKind.Module => PullMembersIntoClassAsync(document, pullMembersUpOptions, cancellationToken),
Shared\Extensions\ISymbolExtensions_2.cs (1)
62case TypeKind.Class:
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\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
403return TypeToGenerateIn?.TypeKind is (TypeKind?)TypeKind.Class or (TypeKind?)TypeKind.Struct;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
22TypeKind.Class,
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\ImplementInterface\ImplementHelpers.cs (1)
226if (state.ClassOrStructType.TypeKind != TypeKind.Class)
src\roslyn\src\Analyzers\Core\CodeFixes\ImplementInterface\ImplementInterfaceGenerator.cs (1)
272var condition1 = typeParameter.ConstraintTypes.Count(t => t.TypeKind == TypeKind.Class) >= 2;
src\roslyn\src\Analyzers\Core\CodeFixes\UnsealClass\AbstractUnsealClassCodeFixProvider.cs (1)
40type.TypeKind == TypeKind.Class && type.IsSealed && !type.IsStatic)
Microsoft.CodeAnalysis.ResxSourceGenerator (11)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
134case TypeKind.Class:
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
48case TypeKind.Class:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
104private static readonly SymbolKindOrTypeKind s_class = new(TypeKind.Class); 329case TypeKind.Class:
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)
62new SymbolKindOrTypeKind(TypeKind.Class),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (2)
351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 555TypeKind: TypeKind.Class or TypeKind.Struct
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
261TypeKind.Module => TypeKind.Class,
Microsoft.CodeAnalysis.VisualBasic (75)
Binding\Binder_Expressions.vb (5)
1070type.TypeKind <> TYPEKIND.Class Then 1210Case TYPEKIND.Class 2825If leftTypeKind = TYPEKIND.Class OrElse leftTypeKind = TYPEKIND.Structure OrElse leftTypeKind = TYPEKIND.Module Then 3806Case TYPEKIND.Class 3841Case TYPEKIND.Class
Binding\Binder_Lookup.vb (5)
580Case TypeKind.Class, TypeKind.Module, TypeKind.Structure, TypeKind.Delegate, TypeKind.Array, TypeKind.Enum 606Case TypeKind.Class, TypeKind.Structure, TypeKind.Delegate, TypeKind.Array, TypeKind.Enum 931Case TypeKind.Class, TypeKind.Module, TypeKind.Structure 1092Case TypeKind.Class, TypeKind.Module, TypeKind.Structure 1964(container.TypeKind = TypeKind.Class OrElse container.TypeKind = TypeKind.Structure) AndAlso
Binding\Binder_ObjectInitializer.vb (2)
211Case TypeKind.Class 239Case TypeKind.Class,
Compilation\ClsComplianceChecker.vb (2)
595Case TypeKind.Class, TypeKind.Structure, TypeKind.Interface, TypeKind.Delegate, TypeKind.Enum, TypeKind.Submission, TypeKind.Module 621Case TypeKind.Class, TypeKind.Structure, TypeKind.Interface, TypeKind.Delegate, TypeKind.Enum, TypeKind.Submission, TypeKind.Module
Compilation\DocumentationComments\DocumentationCommentCompiler.Common.vb (1)
737Case TypeKind.Class
Compilation\MethodCompiler.vb (1)
866If sourceTypeSymbol.TypeKind = TypeKind.Class AndAlso sourceTypeSymbol.GetAttributes().IndexOfAttribute(AttributeDescription.DesignerGeneratedAttribute) > -1 Then
Compilation\VisualBasicCompilation.vb (1)
1545If mainType Is Nothing OrElse (mainType.TypeKind <> TYPEKIND.Class AndAlso mainType.TypeKind <> TYPEKIND.Structure AndAlso mainType.TypeKind <> TYPEKIND.Module) Then
Emit\NoPia\EmbeddedTypesManager.vb (1)
289Debug.Assert(type.TypeKind = TypeKind.Class OrElse type.TypeKind = TypeKind.Module)
Lowering\AsyncRewriter\AsyncRewriter.vb (4)
91Dim kind = If(compilationState.Compilation.Options.EnableEditAndContinue, TypeKind.Class, TypeKind.Struct) 141If frameType.TypeKind = TypeKind.Class Then 185If Me.F.CurrentType.TypeKind = TypeKind.Class Then 200If StateMachineType.TypeKind = TypeKind.Class Then
Lowering\IteratorRewriter\IteratorStateMachine.vb (1)
64Return TypeKind.Class
Lowering\LambdaRewriter\LambdaFrame.vb (1)
216Return TypeKind.Class
Semantics\Conversions.vb (4)
1996(src.TypeKind <> TypeKind.Class OrElse DirectCast(src, NamedTypeSymbol).IsNotInheritable) AndAlso 2018(dst.TypeKind <> TypeKind.Class OrElse DirectCast(dst, NamedTypeSymbol).IsNotInheritable) AndAlso 2452If Not base.IsErrorType() AndAlso base.TypeKind = TypeKind.Class AndAlso 2865Case TypeKind.Class,
Semantics\TypeInference\TypeArgumentInference.vb (2)
1781If fixedTypeTypeKind <> TypeKind.Class AndAlso fixedTypeTypeKind <> TypeKind.Interface Then 1805If fixedTypeTypeKind = TypeKind.Class Then
SymbolDisplay\SymbolDisplayVisitor.Types.vb (3)
257Case TypeKind.Class, 331Case TypeKind.Class 460Case TypeKind.Class
Symbols\AnonymousTypes\AnonymousType_SymbolCollection.vb (1)
97Case TypeKind.Class
Symbols\AnonymousTypes\AnonymousTypeManager_Templates.vb (1)
188Case TypeKind.Class
Symbols\AnonymousTypes\PublicSymbols\AnonymousType_TypePublicSymbol.vb (1)
149Return TypeKind.Class
Symbols\AnonymousTypes\PublicSymbols\AnonymousTypeOrDelegatePublicSymbol.vb (1)
21Debug.Assert((TypeKind = TypeKind.Class AndAlso TypeOf Me Is AnonymousTypePublicSymbol) OrElse
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType_TemplateSymbol.vb (1)
136Return TypeKind.Class
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousTypeOrDelegateTemplateSymbol.vb (1)
54Debug.Assert(TypeKind = TypeKind.Class OrElse TypeKind = TypeKind.Delegate)
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousTypeOrDelegateTypeParameterSymbol.vb (1)
72Debug.Assert(_container.TypeKind = TypeKind.Class)
Symbols\BaseTypeAnalysis.vb (2)
124If this.TypeKind = TypeKind.Class Then 233If currentNamedType.TypeKind = TypeKind.Class Then
Symbols\ConstraintsHelper.vb (4)
162Case TypeKind.Class 958If typeArgument.TypeKind = TypeKind.Class OrElse isStructure Then 1166Debug.Assert(type.TypeKind = TypeKind.Class OrElse type.TypeKind = TypeKind.Structure) 1168Dim sourceClass = If(type.TypeKind = TypeKind.Class, TryCast(type, SourceNamedTypeSymbol), Nothing)
Symbols\EmbeddedSymbols\EmbeddedSymbolManager.SymbolsCollection.vb (1)
333Debug.Assert(type.TypeKind = TypeKind.Module OrElse type.TypeKind = TypeKind.Class AndAlso type.IsNotInheritable)
Symbols\Metadata\PE\PENamedTypeSymbol.vb (2)
1022result = TypeKind.Class 1330If (typeKind = TypeKind.Class OrElse typeKind = TypeKind.Module) AndAlso
Symbols\Source\OverrideHidingHelper.vb (1)
27Case TypeKind.Class, TypeKind.Interface, TypeKind.Structure
Symbols\Source\SourceMemberContainerTypeSymbol.vb (5)
35[Class] = CUShort(TypeKind.Class) << TypeKindShift 345Case TypeKind.Class, TypeKind.Enum, TypeKind.Structure 2739ElseIf TypeKind = TypeKind.Class OrElse 2808ElseIf TypeKind = TypeKind.Class OrElse TypeKind = TypeKind.Module Then 3504If myTypeKind = TypeKind.Class OrElse myTypeKind = TypeKind.Interface OrElse myTypeKind = TypeKind.Structure OrElse myTypeKind = TypeKind.Module Then
Symbols\Source\SourceMemberMethodSymbol.vb (1)
761Case TypeKind.Class, TypeKind.Module
Symbols\Source\SourceNamedTypeSymbol.vb (5)
1128Case TypeKind.Class 1388Case TypeKind.Class 1724TypeKind <> TypeKind.Class OrElse 2267Case TypeKind.Class 2735If Me.TypeKind = TypeKind.Class AndAlso Not Me.IsGenericType Then
Symbols\Source\SourceNamedTypeSymbol_GroupClass.vb (6)
17If Me.TypeKind = TypeKind.Class AndAlso Not Me.IsGenericType Then 216If named.TypeKind = TypeKind.Class AndAlso Not named.IsNotInheritable Then 250named.TypeKind = TypeKind.Class AndAlso 292Debug.Assert(candidate.TypeKind = TypeKind.Class) 302If Me.TypeKind = TypeKind.Class Then 315Debug.Assert(Me.TypeKind = TypeKind.Class)
Symbols\Symbol_Attributes.vb (1)
98Case TypeKind.Class,
Symbols\SymbolExtensions.vb (1)
35Case TypeKind.Class
Symbols\SynthesizedSymbols\SynthesizedHotReloadExceptionSymbol.vb (1)
274Return TypeKind.Class
Symbols\TypeSymbolExtensions.vb (5)
140Return type.TypeKind = TypeKind.Class 414Case TypeKind.Error, TypeKind.Class, TypeKind.Submission 830Case TypeKind.Class, 863Case TypeKind.Class, 1060If type.TypeKind = TypeKind.Class Then
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateDefaultConstructors\VisualBasicGenerateDefaultConstructorsService.vb (1)
35Return classType IsNot Nothing AndAlso classType.TypeKind = TypeKind.Class
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (1)
187If namedType.TypeKind = TypeKind.Class Then
Microsoft.CodeAnalysis.VisualBasic.Features (7)
CodeFixes\GenerateEvent\GenerateEventCodeFixProvider.vb (3)
189Not (targetType.TypeKind = TypeKind.Class OrElse targetType.TypeKind = TypeKind.Interface) OrElse 260If targetType Is Nothing OrElse (targetType.TypeKind <> TypeKind.Interface AndAlso targetType.TypeKind <> TypeKind.Class) Then 356Not (targetType.TypeKind = TypeKind.Class OrElse targetType.TypeKind = TypeKind.Interface) OrElse
InitializeParameter\VisualBasicInitializeMemberFromParameterCodeRefactoringProvider.vb (1)
37Return If(containingType.TypeKind = TypeKind.Class Or containingType.TypeKind = TypeKind.Module, Accessibility.Private, Accessibility.Public)
NavigationBar\VisualBasicNavigationBarItemService.vb (2)
214If workspaceSupportsDocumentChanges AndAlso type.TypeKind = TypeKind.Class Then 227If workspaceSupportsDocumentChanges AndAlso type.TypeKind = TypeKind.Class Then
src\roslyn\src\Analyzers\VisualBasic\CodeFixes\GenerateDefaultConstructors\VisualBasicGenerateDefaultConstructorsService.vb (1)
35Return classType IsNot Nothing AndAlso classType.TypeKind = TypeKind.Class
Microsoft.CodeAnalysis.VisualBasic.Workspaces (4)
Recommendations\VisualBasicRecommendationServiceRunner.vb (3)
497If type.TypeKind = TypeKind.Class AndAlso Not type.IsSealed AndAlso Not Equals(type, within) Then 501If type.TypeKind = TypeKind.Class OrElse 527If namedTypeSymbol.TypeKind = TypeKind.Class AndAlso Not namedTypeSymbol.IsSealed AndAlso Not Equals(namedTypeSymbol, within) Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (1)
187If namedType.TypeKind = TypeKind.Class Then
Microsoft.CodeAnalysis.Workspaces (17)
Classification\ClassificationExtensions.cs (1)
12TypeKind.Class => type.IsRecord ? ClassificationTypeNames.RecordClassName : ClassificationTypeNames.ClassName,
Editing\SyntaxGenerator.cs (2)
769TypeKind.Class => ClassDeclaration( 897case TypeKind.Class:
FindSymbols\FindReferences\DependentTypeFinder.cs (1)
47private static readonly Func<INamedTypeSymbol, bool> s_isNonSealedClass = static t => t is { TypeKind: TypeKind.Class, IsSealed: false };
FindSymbols\FindReferences\DependentTypeFinder_ImplementingTypes.cs (1)
54t => t.TypeKind is TypeKind.Class or
FindSymbols\SymbolFinder_Hierarchy.cs (1)
129if (symbol is { DeclaredAccessibility: Accessibility.Public, ContainingType.TypeKind: TypeKind.Class or TypeKind.Struct })
Recommendations\AbstractRecommendationServiceRunner.cs (1)
490else if (originalConstraintType.TypeKind == TypeKind.Class)
Shared\Extensions\ISymbolExtensions.cs (1)
489if (typeSymbol.TypeKind == TypeKind.Class)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
104private static readonly SymbolKindOrTypeKind s_class = new(TypeKind.Class); 329case TypeKind.Class:
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)
62new SymbolKindOrTypeKind(TypeKind.Class),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (2)
351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 555TypeKind: TypeKind.Class or TypeKind.Struct
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
261TypeKind.Module => TypeKind.Class,
Microsoft.Gen.Logging (1)
Parsing\Parser.LogProperties.cs (1)
19private static readonly HashSet<TypeKind> _allowedTypeKinds = [TypeKind.Class, TypeKind.Struct, TypeKind.Interface];
Microsoft.Gen.Logging.Unit.Tests (1)
LogParserUtilitiesTests.cs (1)
155paramTypeMock.SetupGet(x => x.TypeKind).Returns(TypeKind.Class);
Microsoft.Gen.MetadataExtractor (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
638if (strongTypeSymbol.TypeKind == TypeKind.Class) 769if (kind == TypeKind.Class)
Microsoft.Gen.Metrics (2)
Parser.cs (2)
638if (strongTypeSymbol.TypeKind == TypeKind.Class) 769if (kind == TypeKind.Class)
Microsoft.Gen.MetricsReports (2)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (2)
638if (strongTypeSymbol.TypeKind == TypeKind.Class) 769if (kind == TypeKind.Class)
Microsoft.Interop.ComInterfaceGenerator (2)
Analyzers\AddGeneratedComClassAnalyzer.cs (1)
42if (type.TypeKind != TypeKind.Class)
Analyzers\ComClassGeneratorDiagnosticsAnalyzer.cs (1)
47if (context.Symbol is not INamedTypeSymbol { TypeKind: TypeKind.Class } classToAnalyze)
Microsoft.Interop.SourceGeneration (3)
CustomMarshallingInfoHelper.cs (2)
29if (!(entryPointType.IsStatic && entryPointType.TypeKind == TypeKind.Class) 145if (!(entryPointType.IsStatic && entryPointType.TypeKind == TypeKind.Class)
ManualTypeMarshallingHelper.cs (1)
412if (marshallerType is { IsStatic: true, TypeKind: TypeKind.Class })
Microsoft.ML.InternalCodeAnalyzer (1)
BaseTestClassAnalyzer.cs (1)
68if (namedType.TypeKind != TypeKind.Class)
Roslyn.Diagnostics.Analyzers (20)
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 (1)
114case TypeKind.Class:
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
134case TypeKind.Class:
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (1)
48case TypeKind.Class:
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\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
104private static readonly SymbolKindOrTypeKind s_class = new(TypeKind.Class); 329case TypeKind.Class:
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)
62new SymbolKindOrTypeKind(TypeKind.Class),
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\INamedTypeSymbolExtensions.cs (2)
351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 555TypeKind: TypeKind.Class or TypeKind.Struct
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.cs (1)
181return symbol is { ContainingType.TypeKind: TypeKind.Class, IsSealed: false } &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
52=> symbol?.TypeKind == TypeKind.Class && symbol.IsAbstract;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
261TypeKind.Module => TypeKind.Class,
Roslyn.Diagnostics.CSharp.Analyzers (6)
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\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (3)
200var isRecordClass = namedType.TypeKind is TypeKind.Class; 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\ITypeParameterSymbolExtensions.cs (2)
59typeParameter.ConstraintTypes.Where(t => t.TypeKind == TypeKind.Class).Concat( 61typeParameter.ConstraintTypes.Where(t => t.TypeKind is not TypeKind.Class and not TypeKind.Interface)));