295 references to Struct
GenerateDocumentationAndConfigFiles (12)
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\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
105private static readonly SymbolKindOrTypeKind s_struct = new(TypeKind.Struct); 332case TypeKind.Struct:
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 (2)
63new SymbolKindOrTypeKind(TypeKind.Struct), 383CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct),
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\ITypeSymbolExtensions.cs (2)
90=> symbol?.TypeKind == TypeKind.Struct; 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
37public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
518if (containingType?.TypeKind == TypeKind.Struct)
ILLink.RoslynAnalyzer (1)
TrimAnalysis\SingleValueExtensions.cs (1)
26TypeKind.Class or TypeKind.Enum or TypeKind.Interface or TypeKind.Struct =>
Microsoft.CodeAnalysis (2)
Emit\EditAndContinue\DefinitionMap.cs (1)
660if (displayClass.TypeKind == TypeKind.Struct)
Symbols\INamedTypeSymbolInternal.cs (1)
77case TypeKind.Struct:
Microsoft.CodeAnalysis.Analyzers (13)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
146case TypeKind.Struct:
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\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
105private static readonly SymbolKindOrTypeKind s_struct = new(TypeKind.Struct); 332case TypeKind.Struct:
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 (2)
63new SymbolKindOrTypeKind(TypeKind.Struct), 383CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct),
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\ITypeSymbolExtensions.cs (2)
90=> symbol?.TypeKind == TypeKind.Struct; 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
37public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
518if (containingType?.TypeKind == TypeKind.Struct)
Microsoft.CodeAnalysis.AnalyzerUtilities (11)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
146case TypeKind.Struct:
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\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
105private static readonly SymbolKindOrTypeKind s_struct = new(TypeKind.Struct); 332case TypeKind.Struct:
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 (2)
63new SymbolKindOrTypeKind(TypeKind.Struct), 383CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct),
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\ITypeSymbolExtensions.cs (2)
90=> symbol?.TypeKind == TypeKind.Struct; 694if (type.TypeKind != TypeKind.Struct)
Microsoft.CodeAnalysis.CodeStyle (11)
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\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
105private static readonly SymbolKindOrTypeKind s_struct = new(TypeKind.Struct); 332case TypeKind.Struct:
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 (2)
63new SymbolKindOrTypeKind(TypeKind.Struct), 383CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct),
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\ITypeSymbolExtensions.cs (2)
90=> symbol?.TypeKind == TypeKind.Struct; 694if (type.TypeKind != TypeKind.Struct)
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
403return TypeToGenerateIn?.TypeKind is (TypeKind?)TypeKind.Class or (TypeKind?)TypeKind.Struct;
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.State.cs (1)
108if (classType.TypeKind == TypeKind.Struct)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
24TypeKind.Struct,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
37public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
518if (containingType?.TypeKind == TypeKind.Struct)
Microsoft.CodeAnalysis.CSharp (111)
Binder\Binder_Constraints.cs (2)
600goto case TypeKind.Struct; 612case TypeKind.Struct:
Binder\Binder_Conversions.cs (1)
859case TypeKind.Struct:
Binder\Binder_Crefs.cs (1)
778case TypeKind.Struct:
Binder\Binder_Expressions.cs (5)
4919if ((containingType.TypeKind == TypeKind.Enum || containingType.TypeKind == TypeKind.Struct) && initializerArgumentListOpt == null) 4970else if (initializerArgumentListOpt != null && containingType.TypeKind == TypeKind.Struct) 5296case TypeKind.Struct: 5723Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 9945case TypeKind.Struct:
Binder\Binder_Lookup.cs (2)
237case TypeKind.Struct: 1926case TypeKind.Struct:
Binder\Binder_Patterns.cs (1)
2413if (unionMatchingInputType is not null && (unionMatchingInputType.TypeKind != TypeKind.Struct || unionMatchingInputType.IsNullableType()))
Binder\ForEachLoopBinder.cs (1)
1651case TypeKind.Struct:
Binder\Semantics\AccessCheck.cs (1)
700: containingType.TypeKind == TypeKind.Struct ? ErrorCode.ERR_ProtectedInStruct
Binder\Semantics\Conversions\Conversions.cs (1)
537if (spanType.TypeKind == TypeKind.Struct && spanType.IsRefLikeType)
Binder\Semantics\Operators\OperatorFacts.cs (1)
21case TypeKind.Struct:
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (2)
2324case TypeKind.Struct: 2701case TypeKind.Struct:
Compilation\CSharpCompilation.cs (1)
2032if (mainType is null || mainType.IsGenericType || (mainType.TypeKind != TypeKind.Class && mainType.TypeKind != TypeKind.Struct && !mainType.IsInterface))
Compiler\ClsComplianceChecker.cs (1)
1001case TypeKind.Struct:
Compiler\MethodCompiler.cs (1)
643containingType is { IsImplicitlyDeclared: false, TypeKind: TypeKind.Class or TypeKind.Struct or TypeKind.Interface } &&
Emitter\NoPia\EmbeddedTypesManager.cs (6)
344goto case TypeKind.Struct; 345case TypeKind.Struct: 453Debug.Assert(namedType.TypeKind == TypeKind.Struct || namedType.TypeKind == TypeKind.Enum || namedType.TypeKind == TypeKind.Delegate); 456if (namedType.TypeKind == TypeKind.Struct || namedType.TypeKind == TypeKind.Enum) 510(containerKind == TypeKind.Struct && (field.AdaptedFieldSymbol.IsStatic || field.AdaptedFieldSymbol.DeclaredAccessibility != Accessibility.Public))) 545case TypeKind.Struct:
FlowAnalysis\AbstractFlowPass.cs (2)
949InputType: NamedTypeSymbol { TypeKind: TypeKind.Struct, IsUnionType: true } inputType, 2292fieldSymbol.ContainingType.TypeKind == TypeKind.Struct &&
FlowAnalysis\DefiniteAssignment.cs (6)
103&& CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }; 1006variableBySlot[slot].Symbol.GetTypeOrReturnType().TypeKind == TypeKind.Struct; 1084(_trackClassFields || type.TypeKind == TypeKind.Struct); 1211Debug.Assert(CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }); 1264if (CurrentSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }) 2598case TypeKind.Struct:
FlowAnalysis\EmptyStructTypeCache.cs (1)
236case TypeKind.Struct:
FlowAnalysis\NullableWalker.cs (1)
4969if (type.TypeKind != TypeKind.Struct)
Lowering\AsyncRewriter\AsyncRewriter.cs (1)
74var typeKind = (compilationState.Compilation.Options.EnableEditAndContinue || method.IsIterator) ? TypeKind.Class : TypeKind.Struct;
Lowering\ClosureConversion\SynthesizedClosureEnvironment.cs (1)
56TypeKind = isStruct ? TypeKind.Struct : TypeKind.Class;
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
241_ when variableType.TypeKind is TypeKind.Struct
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
71if (!method.IsStatic && method.ContainingType.TypeKind == TypeKind.Struct && !isRuntimeAsync)
SymbolDisplay\SymbolDisplayVisitor.Types.cs (4)
645case TypeKind.Struct when symbol.IsRecord: 659case TypeKind.Struct: 748case TypeKind.Struct when symbol.IsRecord: 785case TypeKind.Struct:
Symbols\BaseTypeAnalysis.cs (1)
118if (fieldType is null || fieldType.TypeKind != TypeKind.Struct || field.IsStatic)
Symbols\ConstraintsHelper.cs (4)
238case TypeKind.Struct: 1483case TypeKind.Struct: 1515Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 1569case TypeKind.Struct:
Symbols\EnumConversions.cs (1)
38return TypeKind.Struct;
Symbols\Metadata\PE\MetadataDecoder.cs (1)
413case TypeKind.Struct:
Symbols\Metadata\PE\NativeIntegerTypeDecoder.cs (1)
96case TypeKind.Struct:
Symbols\Metadata\PE\PENamedTypeSymbol.cs (7)
1793if (this.TypeKind == TypeKind.Struct) 2204case TypeKind.Struct: 2276result = TypeKind.Struct; 2492if (this.TypeKind == TypeKind.Struct) 2575var isOrdinaryEmbeddableStruct = (this.TypeKind == TypeKind.Struct) && (this.SpecialType == Microsoft.CodeAnalysis.SpecialType.None) && this.ContainingAssembly.IsLinked; 2900if (this.TypeKind == TypeKind.Struct) 2949if (this.TypeKind == TypeKind.Struct)
Symbols\NamedTypeSymbol.cs (3)
538return kind != TypeKind.Enum && kind != TypeKind.Struct && kind != TypeKind.Error; 552return kind == TypeKind.Struct || kind == TypeKind.Enum; 1873return TypeKind is TypeKind.Class or TypeKind.Struct &&
Symbols\Source\ExplicitInterfaceHelpers.cs (1)
198case TypeKind.Struct:
Symbols\Source\SourceEventSymbol.cs (2)
661else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 666else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct)
Symbols\Source\SourceFixedFieldSymbol.cs (1)
171get { return TypeKind.Struct; }
Symbols\Source\SourceMemberContainerSymbol.cs (12)
264Debug.Assert(typeKind is TypeKind.Struct or TypeKind.Class || !HasPrimaryConstructor); 340case TypeKind.Struct: 407case TypeKind.Struct: 1501case TypeKind.Struct: 2742if (TypeKind != TypeKind.Struct) 2767Debug.Assert(TypeKind == TypeKind.Struct); 2801(type.TypeKind == TypeKind.Struct) && 3132if (f is null || !f.IsStatic || f.Type.TypeKind != TypeKind.Struct) continue; 3161if (f is null || !f.IsStatic || f.Type.TypeKind != TypeKind.Struct) continue; 3696case TypeKind.Struct: 3986case TypeKind.Struct: 4880Debug.Assert(TypeKind == TypeKind.Struct);
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
525case TypeKind.Struct:
Symbols\Source\SourceMemberFieldSymbol.cs (1)
607if (ContainingType.TypeKind != TypeKind.Struct)
Symbols\Source\SourceNamedTypeSymbol.cs (6)
829case TypeKind.Struct: 1228if (TypeKind != TypeKind.Struct) 1257return builderType is NamedTypeSymbol { TypeKind: TypeKind.Class or TypeKind.Struct, IsGenericType: false }; 1554if (this.TypeKind == TypeKind.Struct) 1970if (TypeKind == TypeKind.Struct && !IsRecordStruct && HasInlineArrayAttribute(out _)) 2056if (TypeKind == TypeKind.Struct && HasExtendedLayoutAttribute)
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (2)
577baseType.TypeKind == TypeKind.Struct || 807case TypeKind.Struct:
Symbols\Source\SourceOrdinaryMethodSymbol.cs (3)
883else if (IsSealed && ContainingType.TypeKind == TypeKind.Struct) 905else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 910else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct)
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
584else if (IsVirtual && ContainingType.IsSealed && ContainingType.TypeKind != TypeKind.Struct) // error CS0106 on struct already
Symbols\Source\SourcePropertySymbolBase.cs (2)
1126else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 1131else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct)
Symbols\Source\ThisParameterSymbol.cs (1)
157if (ContainingType?.TypeKind != TypeKind.Struct)
Symbols\Symbol_Attributes.cs (1)
82case TypeKind.Struct:
Symbols\Synthesized\SynthesizedContainer.cs (2)
94public override bool IsAbstract => (object)Constructor == null && this.TypeKind != TypeKind.Struct; 168internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => ContainingAssembly.GetSpecialType(this.TypeKind == TypeKind.Struct ? SpecialType.System_ValueType : SpecialType.System_Object);
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (1)
64public override TypeKind TypeKind => TypeKind.Struct;
Symbols\TypeSymbol.cs (1)
2556if (this.TypeKind == TypeKind.Struct)
Symbols\TypeSymbolExtensions.cs (6)
364return type.TypeKind == TypeKind.Struct; 462case TypeKind.Struct: 748case TypeKind.Struct: 823case TypeKind.Struct: 897case TypeKind.Struct: 1594case TypeKind.Struct:
Symbols\VarianceSafety.cs (2)
76case TypeKind.Struct: 374case TypeKind.Struct:
Utilities\TypeSymbolExtensions.cs (2)
187case TypeKind.Struct: 283case TypeKind.Struct:
Microsoft.CodeAnalysis.CSharp.CodeStyle (10)
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\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)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
44TypeKind: TypeKind.Class or TypeKind.Struct,
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\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
211var kind = namedType.TypeKind == TypeKind.Struct ? SyntaxKind.StructDeclaration :
Microsoft.CodeAnalysis.CSharp.Features (20)
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 (3)
963return method.ContainingType.TypeKind != TypeKind.Struct; 967if (method.ContainingType.TypeKind == TypeKind.Struct) 1965TypeKind.Struct => symbol.IsRecord ? CSharpFeaturesResources.record_struct : FeaturesResources.struct_,
SignatureHelp\ConstructorInitializerSignatureHelpProvider.cs (1)
71if (within.TypeKind is not TypeKind.Struct and not TypeKind.Class)
Snippets\CSharpStructSnippetProvider.cs (1)
19: AbstractCSharpTypeSnippetProvider<StructDeclarationSyntax>(TypeKind.Struct)
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\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 (1)
44TypeKind: TypeKind.Class or TypeKind.Struct,
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;
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
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 (1)
211var kind = namedType.TypeKind == TypeKind.Struct ? SyntaxKind.StructDeclaration :
Microsoft.CodeAnalysis.Extensions.Package (4)
Symbols\INamedTypeSymbolExtensions.cs (2)
351if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 555TypeKind: TypeKind.Class or TypeKind.Struct
Symbols\ITypeSymbolExtensions.cs (2)
90=> symbol?.TypeKind == TypeKind.Struct; 694if (type.TypeKind != TypeKind.Struct)
Microsoft.CodeAnalysis.Features (21)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
106=> typeSymbol.TypeKind is TypeKind.Class or TypeKind.Struct;
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))
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
918TypeKind.Struct, structName, typeParameters, members: members, containingAssembly: containingAssembly);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (3)
5345(newSymbol.ContainingType.TypeKind == TypeKind.Struct) ? RudeEditKind.InsertOrMoveStructMember : RudeEditKind.InsertOrMoveTypeWithLayoutMember, 5435if (type.TypeKind == TypeKind.Struct) 6357=> (parameter.ContainingType.TypeKind == TypeKind.Struct) ? FeaturesResources.struct_ : FeaturesResources.class_with_explicit_or_sequential_layout;
ExtractMethod\MethodExtractor.Analyzer.cs (1)
117&& thisParameterBeingRead is { Type: { TypeKind: TypeKind.Struct, IsReadOnly: false } };
GenerateConstructors\AbstractGenerateConstructorsCodeRefactoringProvider.cs (1)
212if (containingType?.TypeKind is not TypeKind.Class and not TypeKind.Struct)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (2)
90if (containingType?.TypeKind is not TypeKind.Class and not TypeKind.Struct) 300if (generateEquals && containingType.TypeKind == TypeKind.Struct)
GenerateType\AbstractGenerateTypeService.GenerateNamedType.cs (2)
219if (!(parameters.Count == 0 && options is { TypeKind: TypeKind.Struct })) 314? TypeKind.Struct
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);
Shared\Extensions\ISymbolExtensions_2.cs (1)
82case TypeKind.Struct:
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\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.State.cs (1)
108if (classType.TypeKind == TypeKind.Struct)
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
24TypeKind.Struct,
Microsoft.CodeAnalysis.ResxSourceGenerator (11)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
146case TypeKind.Struct:
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\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
105private static readonly SymbolKindOrTypeKind s_struct = new(TypeKind.Struct); 332case TypeKind.Struct:
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 (2)
63new SymbolKindOrTypeKind(TypeKind.Struct), 383CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct),
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\ITypeSymbolExtensions.cs (2)
90=> symbol?.TypeKind == TypeKind.Struct; 694if (type.TypeKind != TypeKind.Struct)
Microsoft.CodeAnalysis.VisualBasic (7)
Lowering\AsyncRewriter\AsyncRewriter.vb (1)
91Dim kind = If(compilationState.Compilation.Options.EnableEditAndContinue, TypeKind.Class, TypeKind.Struct)
Lowering\AsyncRewriter\AsyncStateMachine.vb (1)
22asyncMethod.ContainingAssembly.GetSpecialType(If(typeKind = TypeKind.Struct, SpecialType.System_ValueType, SpecialType.System_Object)),
SymbolDisplay\SymbolDisplayVisitor.Types.vb (2)
269Case TypeKind.Struct 468Case TypeKind.Struct
Symbols\Tuples\TupleTypeSymbol.vb (1)
153Return TypeKind.Struct
Symbols\TypeSymbolExtensions.vb (2)
831TypeKind.Struct, 864TypeKind.Struct,
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (2)
101Dim isStruct = namedType.TypeKind = TypeKind.Struct 205If namedType.TypeKind = TypeKind.Struct OrElse
Microsoft.CodeAnalysis.VisualBasic.Features (1)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (1)
631Return method.ContainingType.TypeKind <> TypeKind.Struct
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
Recommendations\VisualBasicRecommendationServiceRunner.vb (1)
503type.TypeKind = TypeKind.Struct Then
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (2)
101Dim isStruct = namedType.TypeKind = TypeKind.Struct 205If namedType.TypeKind = TypeKind.Struct OrElse
Microsoft.CodeAnalysis.Workspaces (17)
Classification\ClassificationExtensions.cs (1)
14TypeKind.Struct => type.IsRecord ? ClassificationTypeNames.RecordStructName : ClassificationTypeNames.StructName,
Editing\SyntaxGenerator.cs (2)
778TypeKind.Struct => StructDeclaration( 898case TypeKind.Struct:
FindSymbols\FindReferences\DependentTypeFinder_ImplementingTypes.cs (1)
55TypeKind.Struct or
FindSymbols\SymbolFinder_Hierarchy.cs (1)
129if (symbol is { DeclaredAccessibility: Accessibility.Public, ContainingType.TypeKind: TypeKind.Class or TypeKind.Struct })
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\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
105private static readonly SymbolKindOrTypeKind s_struct = new(TypeKind.Struct); 332case TypeKind.Struct:
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 (2)
63new SymbolKindOrTypeKind(TypeKind.Struct), 383CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct),
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\ITypeSymbolExtensions.cs (2)
90=> symbol?.TypeKind == TypeKind.Struct; 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
37public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
518if (containingType?.TypeKind == TypeKind.Struct)
Microsoft.Gen.Logging (1)
Parsing\Parser.LogProperties.cs (1)
19private static readonly HashSet<TypeKind> _allowedTypeKinds = [TypeKind.Class, TypeKind.Struct, TypeKind.Interface];
Microsoft.Gen.MetadataExtractor (1)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
827if (kind == TypeKind.Struct && specialType == SpecialType.None)
Microsoft.Gen.Metrics (1)
Parser.cs (1)
827if (kind == TypeKind.Struct && specialType == SpecialType.None)
Microsoft.Gen.MetricsReports (1)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
827if (kind == TypeKind.Struct && specialType == SpecialType.None)
Microsoft.Interop.ComInterfaceGenerator (1)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
269if (methodSymbol.ReturnType is { TypeKind: TypeKind.Struct }
Microsoft.Interop.LibraryImportGenerator (1)
src\runtime\src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
269if (methodSymbol.ReturnType is { TypeKind: TypeKind.Struct }
Microsoft.Interop.SourceGeneration (2)
CustomMarshallingInfoHelper.cs (2)
30&& entryPointType.TypeKind != TypeKind.Struct) 146&& entryPointType.TypeKind != TypeKind.Struct)
Roslyn.Diagnostics.Analyzers (17)
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) 122case TypeKind.Struct:
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.NamedTypeMetricData.cs (1)
146case TypeKind.Struct:
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\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
105private static readonly SymbolKindOrTypeKind s_struct = new(TypeKind.Struct); 332case TypeKind.Struct:
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 (2)
63new SymbolKindOrTypeKind(TypeKind.Struct), 383CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct),
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\ITypeSymbolExtensions.cs (2)
90=> symbol?.TypeKind == TypeKind.Struct; 694if (type.TypeKind != TypeKind.Struct)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
37public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
518if (containingType?.TypeKind == TypeKind.Struct)
Roslyn.Diagnostics.CSharp.Analyzers (2)
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 (1)
211var kind = namedType.TypeKind == TypeKind.Struct ? SyntaxKind.StructDeclaration :