518 references to Struct
ILLink.RoslynAnalyzer (1)
TrimAnalysis\SingleValueExtensions.cs (1)
24 TypeKind.Class or TypeKind.Enum or TypeKind.Interface or TypeKind.Struct =>
Microsoft.CodeAnalysis (2)
Emit\EditAndContinue\DefinitionMap.cs (1)
602if (displayClass.TypeKind == TypeKind.Struct)
Symbols\INamedTypeSymbolInternal.cs (1)
77case TypeKind.Struct:
Microsoft.CodeAnalysis.CodeStyle (10)
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
184if (namedType.TypeKind is not TypeKind.Class and not TypeKind.Struct and not TypeKind.Module)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (2)
335if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 541TypeKind: TypeKind.Class or TypeKind.Struct
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (2)
94=> symbol?.TypeKind == TypeKind.Struct; 687if (type.TypeKind != TypeKind.Struct)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
126private static readonly SymbolKindOrTypeKind _struct = new(TypeKind.Struct); 383case TypeKind.Struct:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
68if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
68new SymbolKindOrTypeKind(TypeKind.Struct), 388CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct),
Microsoft.CodeAnalysis.CodeStyle.Fixes (5)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
405return TypeToGenerateIn?.TypeKind is (TypeKind?)TypeKind.Class or (TypeKind?)TypeKind.Struct;
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.State.cs (1)
109if (classType.TypeKind == TypeKind.Struct)
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
28TypeKind.Struct,
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
48public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
498if (containingType?.TypeKind == TypeKind.Struct)
Microsoft.CodeAnalysis.CSharp (108)
Binder\Binder_Constraints.cs (2)
599goto case TypeKind.Struct; 611case TypeKind.Struct:
Binder\Binder_Crefs.cs (1)
579case TypeKind.Struct:
Binder\Binder_Expressions.cs (5)
4779if ((containingType.TypeKind == TypeKind.Enum || containingType.TypeKind == TypeKind.Struct) && initializerArgumentListOpt == null) 4830else if (initializerArgumentListOpt != null && containingType.TypeKind == TypeKind.Struct) 5153case TypeKind.Struct: 5500Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 9297case TypeKind.Struct:
Binder\Binder_Lookup.cs (2)
193case TypeKind.Struct: 1876case TypeKind.Struct:
Binder\ForEachLoopBinder.cs (1)
1602case TypeKind.Struct:
Binder\Semantics\AccessCheck.cs (1)
698return containingType.TypeKind == TypeKind.Struct ? ErrorCode.ERR_ProtectedInStruct : ErrorCode.WRN_ProtectedInSealed;
Binder\Semantics\Conversions\Conversions.cs (1)
501if (spanType.TypeKind == TypeKind.Struct && spanType.IsRefLikeType)
Binder\Semantics\Operators\OperatorFacts.cs (1)
21case TypeKind.Struct:
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (2)
2294case TypeKind.Struct: 2671case TypeKind.Struct:
Compilation\CSharpCompilation.cs (1)
1951if (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)
618containingType is { IsImplicitlyDeclared: false, TypeKind: TypeKind.Class or TypeKind.Struct or TypeKind.Interface } &&
Emitter\NoPia\EmbeddedTypesManager.cs (6)
292goto case TypeKind.Struct; 293case TypeKind.Struct: 401Debug.Assert(namedType.TypeKind == TypeKind.Struct || namedType.TypeKind == TypeKind.Enum || namedType.TypeKind == TypeKind.Delegate); 404if (namedType.TypeKind == TypeKind.Struct || namedType.TypeKind == TypeKind.Enum) 458(containerKind == TypeKind.Struct && (field.AdaptedFieldSymbol.IsStatic || field.AdaptedFieldSymbol.DeclaredAccessibility != Accessibility.Public))) 493case TypeKind.Struct:
FlowAnalysis\AbstractFlowPass.cs (1)
2236fieldSymbol.ContainingType.TypeKind == TypeKind.Struct &&
FlowAnalysis\DefiniteAssignment.cs (6)
102&& CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }; 1053variableBySlot[slot].Symbol.GetTypeOrReturnType().TypeKind == TypeKind.Struct; 1131(_trackClassFields || type.TypeKind == TypeKind.Struct); 1258Debug.Assert(CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }); 1311if (CurrentSymbol is not MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }) 2639case TypeKind.Struct:
FlowAnalysis\EmptyStructTypeCache.cs (1)
235case TypeKind.Struct:
FlowAnalysis\NullableWalker.cs (1)
4425if (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)
55TypeKind = isStruct ? TypeKind.Struct : TypeKind.Class;
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (1)
241_ when variableType.TypeKind is TypeKind.Struct
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (1)
64if (!method.IsStatic && method.ContainingType.TypeKind == TypeKind.Struct)
SymbolDisplay\SymbolDisplayVisitor.Types.cs (4)
600case TypeKind.Struct when symbol.IsRecord: 614case TypeKind.Struct: 703case TypeKind.Struct when symbol.IsRecord: 740case TypeKind.Struct:
Symbols\BaseTypeAnalysis.cs (1)
118if (fieldType is null || fieldType.TypeKind != TypeKind.Struct || field.IsStatic)
Symbols\ConstraintsHelper.cs (4)
238case TypeKind.Struct: 1456case TypeKind.Struct: 1488Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 1542case TypeKind.Struct:
Symbols\EnumConversions.cs (1)
37return 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)
1343if (this.TypeKind == TypeKind.Struct) 1729case TypeKind.Struct: 1794result = TypeKind.Struct; 1905if (this.TypeKind == TypeKind.Struct) 1988var isOrdinaryEmbeddableStruct = (this.TypeKind == TypeKind.Struct) && (this.SpecialType == Microsoft.CodeAnalysis.SpecialType.None) && this.ContainingAssembly.IsLinked; 2291if (this.TypeKind == TypeKind.Struct) 2319if (this.TypeKind == TypeKind.Struct)
Symbols\NamedTypeSymbol.cs (3)
364(thisParam.RefKind is RefKind.In or RefKind.RefReadOnlyParameter && thisParam.Type.TypeKind != TypeKind.Struct)) 390return kind != TypeKind.Enum && kind != TypeKind.Struct && kind != TypeKind.Error; 404return kind == TypeKind.Struct || kind == TypeKind.Enum;
Symbols\Source\ExplicitInterfaceHelpers.cs (1)
194case TypeKind.Struct:
Symbols\Source\SourceEventSymbol.cs (2)
557else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 562else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct)
Symbols\Source\SourceFixedFieldSymbol.cs (1)
170get { return TypeKind.Struct; }
Symbols\Source\SourceMemberContainerSymbol.cs (12)
260Debug.Assert(typeKind is TypeKind.Struct or TypeKind.Class || !HasPrimaryConstructor); 328case TypeKind.Struct: 372case TypeKind.Struct: 1382case TypeKind.Struct: 2346if (TypeKind != TypeKind.Struct) 2371Debug.Assert(TypeKind == TypeKind.Struct); 2405(type.TypeKind == TypeKind.Struct) && 2699if (f is null || !f.IsStatic || f.Type.TypeKind != TypeKind.Struct) continue; 2728if (f is null || !f.IsStatic || f.Type.TypeKind != TypeKind.Struct) continue; 3246case TypeKind.Struct: 3486case TypeKind.Struct: 4124Debug.Assert(TypeKind == TypeKind.Struct);
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
518case TypeKind.Struct:
Symbols\Source\SourceMemberFieldSymbol.cs (1)
563if (ContainingType.TypeKind != TypeKind.Struct)
Symbols\Source\SourceNamedTypeSymbol.cs (5)
819case TypeKind.Struct: 1211if (TypeKind != TypeKind.Struct) 1232return builderType is NamedTypeSymbol { TypeKind: TypeKind.Class or TypeKind.Struct, IsGenericType: false }; 1491if (this.TypeKind == TypeKind.Struct) 1823if (TypeKind == TypeKind.Struct && !IsRecordStruct && HasInlineArrayAttribute(out _))
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (2)
522baseType.TypeKind == TypeKind.Struct || 738case TypeKind.Struct:
Symbols\Source\SourceOrdinaryMethodSymbol.cs (4)
222else if (parameter0RefKind is RefKind.In or RefKind.RefReadOnlyParameter && parameter0Type.TypeKind != TypeKind.Struct) 837else if (IsSealed && ContainingType.TypeKind == TypeKind.Struct) 859else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 864else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct)
Symbols\Source\SourcePropertyAccessorSymbol.cs (1)
534else if (IsVirtual && ContainingType.IsSealed && ContainingType.TypeKind != TypeKind.Struct) // error CS0106 on struct already
Symbols\Source\SourcePropertySymbolBase.cs (2)
1094else if (IsAbstract && ContainingType.TypeKind == TypeKind.Struct) 1099else if (IsVirtual && ContainingType.TypeKind == TypeKind.Struct)
Symbols\Source\ThisParameterSymbol.cs (1)
147if (ContainingType?.TypeKind != TypeKind.Struct)
Symbols\Symbol_Attributes.cs (1)
82case TypeKind.Struct:
Symbols\Synthesized\SynthesizedContainer.cs (2)
96public override bool IsAbstract => (object)Constructor == null && this.TypeKind != TypeKind.Struct; 162internal override NamedTypeSymbol BaseTypeNoUseSiteDiagnostics => ContainingAssembly.GetSpecialType(this.TypeKind == TypeKind.Struct ? SpecialType.System_ValueType : SpecialType.System_Object);
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (1)
63public override TypeKind TypeKind => TypeKind.Struct;
Symbols\TypeSymbol.cs (1)
2521if (this.TypeKind == TypeKind.Struct)
Symbols\TypeSymbolExtensions.cs (6)
341return type.TypeKind == TypeKind.Struct; 421case TypeKind.Struct: 702case TypeKind.Struct: 777case TypeKind.Struct: 851case TypeKind.Struct: 1509case TypeKind.Struct:
Symbols\VarianceSafety.cs (2)
76case TypeKind.Struct: 371case TypeKind.Struct:
Utilities\TypeSymbolExtensions.cs (2)
187case TypeKind.Struct: 282case TypeKind.Struct:
Microsoft.CodeAnalysis.CSharp.CodeStyle (10)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
57if (namedTypeSymbol.TypeKind != TypeKind.Struct)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
60TypeKind: TypeKind.Struct, 259return instance is { Type.TypeKind: TypeKind.Struct } ||
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
83if (typeSymbol.TypeKind is not TypeKind.Struct)
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
133if (symbolInfo.GetAnySymbol() is not IFieldSymbol { ContainingType.TypeKind: TypeKind.Struct })
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
360if (!(namedType.TypeKind == TypeKind.Struct && noArgConstructor.IsImplicitlyDeclared))
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
274if (namedType.TypeKind is not (TypeKind.Class or TypeKind.Struct))
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (2)
68if (lockType.GetTypeMembers("Scope").FirstOrDefault() is not { TypeKind: TypeKind.Struct, IsRefLikeType: true, DeclaredAccessibility: Accessibility.Public }) 80if (namedType is not { TypeKind: TypeKind.Class or TypeKind.Struct })
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\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
44TypeKind: TypeKind.Class or TypeKind.Struct,
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
179if (containingType.TypeKind == TypeKind.Struct && !containingType.IsReadOnly)
src\Analyzers\CSharp\CodeFixes\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsService.cs (1)
39return classType?.TypeKind is TypeKind.Class or TypeKind.Struct;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
209var kind = namedType.TypeKind == TypeKind.Struct ? SyntaxKind.StructDeclaration :
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
src\Analyzers\CSharp\Tests\NamingStyles\NamingStylesTests.cs (1)
235[InlineData("struct [|c2|] { }", "struct C2 { }", TypeKind.Struct, Accessibility.Private)]
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (3)
CodeActions\GenerateType\GenerateTypeTests_Dialog.cs (1)
396typeKind: TypeKind.Struct,
Diagnostics\NamingStyles\EditorConfigNamingStyleParserTests.cs (2)
344[InlineData("*", new object[] { SymbolKind.Namespace, TypeKind.Class, TypeKind.Struct, TypeKind.Interface, TypeKind.Enum, SymbolKind.Property, MethodKind.Ordinary, MethodKind.LocalFunction, SymbolKind.Field, SymbolKind.Event, TypeKind.Delegate, SymbolKind.Parameter, SymbolKind.TypeParameter, SymbolKind.Local })] 345[InlineData(null, new object[] { SymbolKind.Namespace, TypeKind.Class, TypeKind.Struct, TypeKind.Interface, TypeKind.Enum, SymbolKind.Property, MethodKind.Ordinary, MethodKind.LocalFunction, SymbolKind.Field, SymbolKind.Event, TypeKind.Delegate, SymbolKind.Parameter, SymbolKind.TypeParameter, SymbolKind.Local })]
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
CodeGen\CodeGenAsyncTests.cs (2)
71Assert.Equal(TypeKind.Struct, stateMachine.TypeKind); 80Assert.Equal(TypeKind.Struct, stateMachine.TypeKind);
CodeGen\CodeGenTupleTest.cs (3)
11154Assert.Equal(TypeKind.Struct, m1Tuple.TypeKind); 11418Assert.Equal(TypeKind.Struct, m1Tuple.TypeKind); 12736Assert.Equal(TypeKind.Struct, m1Tuple.TypeKind);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (4)
Semantics\PrimaryConstructorTests.cs (4)
437if (c.TypeKind == TypeKind.Struct) 523Assert.Equal(c.TypeKind != TypeKind.Struct ? 1 : 2, c.InstanceConstructors.Length); 532if (c.TypeKind == TypeKind.Struct) 627if (c.TypeKind == TypeKind.Struct)
Microsoft.CodeAnalysis.CSharp.Features (18)
Completion\CompletionProviders\EnumAndCompletionListTagCompletionProvider.cs (1)
349if (type.TypeKind is TypeKind.Struct or TypeKind.Class)
Completion\CompletionProviders\NamedParameterCompletionProvider.cs (1)
213if (within is { TypeKind: TypeKind.Struct or TypeKind.Class })
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (3)
974return method.ContainingType.TypeKind != TypeKind.Struct; 978if (method.ContainingType.TypeKind == TypeKind.Struct) 1970TypeKind.Struct => symbol.IsRecord ? CSharpFeaturesResources.record_struct : CSharpFeaturesResources.struct_,
SignatureHelp\ConstructorInitializerSignatureHelpProvider.cs (1)
81if (within.TypeKind is not TypeKind.Struct and not TypeKind.Class)
src\Analyzers\CSharp\Analyzers\MakeStructFieldsWritable\CSharpMakeStructFieldsWritableDiagnosticAnalyzer.cs (1)
57if (namedTypeSymbol.TypeKind != TypeKind.Struct)
src\Analyzers\CSharp\Analyzers\MakeStructMemberReadOnly\CSharpMakeStructMemberReadOnlyAnalyzer.cs (2)
60TypeKind: TypeKind.Struct, 259return instance is { Type.TypeKind: TypeKind.Struct } ||
src\Analyzers\CSharp\Analyzers\MakeStructReadOnly\CSharpMakeStructReadOnlyDiagnosticAnalyzer.cs (1)
83if (typeSymbol.TypeKind is not TypeKind.Struct)
src\Analyzers\CSharp\Analyzers\UseAutoProperty\CSharpUseAutoPropertyAnalyzer.cs (1)
133if (symbolInfo.GetAnySymbol() is not IFieldSymbol { ContainingType.TypeKind: TypeKind.Struct })
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
360if (!(namedType.TypeKind == TypeKind.Struct && noArgConstructor.IsImplicitlyDeclared))
src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
274if (namedType.TypeKind is not (TypeKind.Class or TypeKind.Struct))
src\Analyzers\CSharp\Analyzers\UseSystemThreadingLock\CSharpUseSystemThreadingLockDiagnosticAnalyzer.cs (2)
68if (lockType.GetTypeMembers("Scope").FirstOrDefault() is not { TypeKind: TypeKind.Struct, IsRefLikeType: true, DeclaredAccessibility: Accessibility.Public }) 80if (namedType is not { TypeKind: TypeKind.Class or TypeKind.Struct })
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\ConvertToRecordEngine.cs (1)
44TypeKind: TypeKind.Class or TypeKind.Struct,
src\Analyzers\CSharp\CodeFixes\ConvertToRecord\PositionalParameterInfo.cs (1)
179if (containingType.TypeKind == TypeKind.Struct && !containingType.IsReadOnly)
src\Analyzers\CSharp\CodeFixes\GenerateDefaultConstructors\CSharpGenerateDefaultConstructorsService.cs (1)
39return classType?.TypeKind is TypeKind.Class or TypeKind.Struct;
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
src\Analyzers\CSharp\Tests\NamingStyles\NamingStylesTests.cs (1)
235[InlineData("struct [|c2|] { }", "struct C2 { }", TypeKind.Struct, Accessibility.Private)]
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (17)
Semantics\DeconstructionTests.cs (2)
4272Assert.Equal(TypeKind.Struct, typeInfo.Type.TypeKind); 4531Assert.Equal(TypeKind.Struct, typeInfo.Type.TypeKind);
Semantics\LambdaTests.cs (1)
2338Assert.Equal(TypeKind.Struct, typeInfo.Type.TypeKind);
Semantics\NativeIntegerTests.cs (2)
224Assert.Equal(TypeKind.Struct, type.TypeKind); 239Assert.Equal(TypeKind.Struct, type.TypeKind);
Semantics\NullableReferenceTypesTests.cs (4)
116619Assert.Equal(TypeKind.Struct, compilation1.GetTypeByMetadataName("A").TypeKind); 116639Assert.Equal(TypeKind.Struct, compilation2.GetTypeByMetadataName("A").TypeKind); 116650Assert.Equal(TypeKind.Struct, compilation3.GetTypeByMetadataName("A").TypeKind); 116759Assert.Equal(TypeKind.Struct, compilation7.GetTypeByMetadataName("A").TypeKind);
Semantics\RecordStructTests.cs (2)
394Assert.Equal(TypeKind.Struct, point.TypeKind); 484Assert.Equal(TypeKind.Struct, point.TypeKind);
Semantics\ScriptSemanticsTests.cs (1)
467Assert.Equal(TypeKind.Struct, members[0].TypeKind);
Semantics\UseSiteErrorTests.cs (5)
2309Assert.Equal(TypeKind.Struct, compilation1.GetTypeByMetadataName("A").TypeKind); 2327Assert.Equal(TypeKind.Struct, compilation2.GetTypeByMetadataName("A").TypeKind); 2338Assert.Equal(TypeKind.Struct, compilation3.GetTypeByMetadataName("A").TypeKind); 2383Assert.Equal(TypeKind.Struct, compilation5.GetTypeByMetadataName("A").TypeKind); 2424Assert.Equal(TypeKind.Struct, compilation7.GetTypeByMetadataName("A").TypeKind);
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (237)
Compilation\GetSemanticInfoTests.cs (1)
1498Assert.Equal(TypeKind.Struct, bindInfo.ConvertedType.TypeKind);
Compilation\SemanticModelGetDeclaredSymbolAPITests.cs (2)
2989Assert.Equal(TypeKind.Struct, dsym3.TypeKind); 4778Assert.Equal(TypeKind.Struct, structSymbol.TypeKind);
Compilation\SemanticModelGetSemanticInfoTests.cs (216)
272Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 274Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 309Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 311Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 696Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 1719Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 1721Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 1779Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 1781Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 1808Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 1810Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 1838Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 1840Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 1868Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 1870Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 1987Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 1989Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 2017Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 2019Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 2049Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 2051Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 2081Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 2083Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 2151Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 2153Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 2348Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 2350Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 2394Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 2396Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 2437Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 2439Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 2492Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 2494Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 2544Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 2546Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 2690Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 2692Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 2870Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 2872Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 2946Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 2948Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 3394Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 3396Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 3425Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 3457Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 3459Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 3492Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 3494Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 4038Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 4040Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 4135Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 4137Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 4280Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 4282Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 4318Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 4320Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 4569Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 4571Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 4607Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 4609Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 4643Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 4645Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 4816Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 4878Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 4880Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 5480Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 5482Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 5509Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 5511Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 5542Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 5544Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 5574Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 5576Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 5606Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 5608Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 5761Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 5763Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 5795Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 5797Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 5828Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 5830Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 5862Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 5864Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 5896Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 5898Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 5931Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 5933Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 5964Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 5966Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 5998Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 6000Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 6031Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 6033Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 6059Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 6061Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 6091Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 6093Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 6117Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 6119Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 6144Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 6146Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 6177Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 6179Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 6365Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 6367Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 6806Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 6808Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 6920Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 6922Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 6965Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 6967Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 7078Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 7080Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 7288Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 7290Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 7316Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 7318Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 7343Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 7345Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 7378Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 7380Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 7399Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 7401Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 7482Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 7484Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 7727Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 8514Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 8516Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 8726Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 8728Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 8809Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 8811Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 8851Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 8853Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 8893Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 8895Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 8933Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 8935Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 10466Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 10468Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 10558Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 10560Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 10600Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 10602Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 10637Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 10639Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 10674Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 10676Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 10756Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 10758Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 11011Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 11013Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 11042Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 11044Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 11075Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 11077Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 11108Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 11110Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 11266Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 11268Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 11303Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 11305Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 11340Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 11342Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 11380Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 11382Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 11427Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 11429Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 11460Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 11462Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 11572Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 11574Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 11710Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 11712Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 12526Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 12528Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 12572Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 12610Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 12612Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 12644Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 12646Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 12739Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 12741Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 12771Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 12773Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 12803Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 12805Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 12846Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 12848Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 12922Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 12924Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 12958Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 12960Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 12996Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 12998Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 13098Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 13100Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 13263Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 13265Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 13442Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 13444Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 13503Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 13505Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 13839Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 13841Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 14626Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 14628Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 15084Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 15086Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 15183Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 15185Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 15214Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 15245Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 15247Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind); 15276Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind); 15278Assert.Equal(TypeKind.Struct, semanticInfo.ConvertedType.TypeKind);
Symbols\CompilationCreationTests.cs (4)
2619Assert.False(HasSingleTypeOfKind(c, TypeKind.Struct, "System.Int32")); 2621Assert.True(HasSingleTypeOfKind(c, TypeKind.Struct, "System.Int32")); 2631Assert.True(HasSingleTypeOfKind(c, TypeKind.Struct, "System.Int32")); 2633Assert.False(HasSingleTypeOfKind(c, TypeKind.Struct, "System.Int32"));
Symbols\Metadata\MetadataTypeTests.cs (1)
237Assert.Equal(TypeKind.Struct, type1.TypeKind);
Symbols\Metadata\PE\LoadingMethods.cs (1)
377Assert.Equal(TypeKind.Struct, byrefReturnMethod.ReturnType.TypeKind);
Symbols\Metadata\PE\NoPiaInstantiationOfGenericClassAndStruct.cs (2)
143if (m.ReturnType.TypeKind != TypeKind.Struct) 448if (m.ReturnType.TypeKind != TypeKind.Struct)
Symbols\Metadata\PE\TypeKindTests.cs (1)
52Assert.Equal(TypeKind.Struct, int32.TypeKind);
Symbols\MissingSpecialMember.cs (2)
236Assert.Equal(TypeKind.Struct, specialType.TypeKind); 240Assert.Equal(TypeKind.Struct, lookupType.TypeKind);
Symbols\Source\FieldTests.cs (2)
180Assert.Equal(TypeKind.Struct, sym.Type.TypeKind); 219Assert.Equal(TypeKind.Struct, sym.Type.TypeKind);
Symbols\Source\MethodTests.cs (2)
375Assert.Equal(TypeKind.Struct, outP.TypeKind); 406Assert.Equal(TypeKind.Struct, m.ReturnType.TypeKind);
Symbols\SymbolErrorTests.cs (1)
1578Assert.Equal(TypeKind.Struct, (n as FieldSymbol).Type.TypeKind);
Symbols\TypeTests.cs (2)
282Assert.Equal(TypeKind.Struct, type3.TypeKind); 881Assert.Equal(TypeKind.Struct, structS.TypeKind);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (5)
Parsing\ReadOnlyStructs.cs (5)
48Assert.Equal(TypeKind.Struct, s1.TypeKind); 54Assert.Equal(TypeKind.Struct, s2.TypeKind); 60Assert.Equal(TypeKind.Struct, s3.TypeKind); 157Assert.Equal(TypeKind.Struct, s1.TypeKind); 163Assert.Equal(TypeKind.Struct, s2.TypeKind);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (3)
Extensions.cs (1)
473if ((typeSym.TypeKind == TypeKind.Interface || typeSym.TypeKind == TypeKind.Class || typeSym.TypeKind == TypeKind.Struct || typeSym.TypeKind == TypeKind.Delegate))
UsesIsNullableVisitor.cs (2)
173case TypeKind.Struct: 189case TypeKind.Struct:
Microsoft.CodeAnalysis.CSharp.Workspaces (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
42if (typeSymbol.TypeKind is TypeKind.Class or TypeKind.Struct)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\NamedTypeGenerator.cs (1)
209var kind = namedType.TypeKind == TypeKind.Struct ? SyntaxKind.StructDeclaration :
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (5)
CodeGeneration\CodeGenerationTests.CSharp.cs (3)
261[InlineData("struct", TypeKind.Struct)] 321typeKind: TypeKind.Struct); 338typeKind: TypeKind.Struct);
CodeGeneration\CodeGenerationTests.VisualBasic.cs (2)
236typeKind: TypeKind.Struct); 251typeKind: TypeKind.Struct);
Microsoft.CodeAnalysis.Features (16)
AddDebuggerDisplay\AbstractAddDebuggerDisplayCodeRefactoringProvider.cs (1)
106=> typeSymbol.TypeKind is TypeKind.Class or TypeKind.Struct;
Completion\Providers\AbstractPartialMethodCompletionProvider.cs (1)
90if (enclosingSymbol.TypeKind is not (TypeKind.Struct or TypeKind.Class))
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (1)
918TypeKind.Struct, structName, typeParameters, members: members, containingAssembly: containingAssembly);
ExtractMethod\MethodExtractor.Analyzer.cs (1)
170&& thisParameterBeingRead.Type is { TypeKind: TypeKind.Struct, IsReadOnly: false };
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeFromMembersCodeRefactoringProvider.cs (2)
88if (containingType?.TypeKind is not TypeKind.Class and not TypeKind.Struct) 299if (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)
20TypeKind: TypeKind.Class or TypeKind.Interface or TypeKind.Struct,
InheritanceMargin\AbstractInheritanceMarginService.cs (1)
72return !symbol.IsStatic && namedType.TypeKind is TypeKind.Interface or TypeKind.Class or TypeKind.Struct;
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
328Debug.Assert(memberSymbol.TypeKind is TypeKind.Class or TypeKind.Struct);
Shared\Extensions\ISymbolExtensions_2.cs (1)
80case TypeKind.Struct:
src\Analyzers\Core\Analyzers\UseAutoProperty\AbstractUseAutoPropertyAnalyzer.cs (1)
184if (namedType.TypeKind is not TypeKind.Class and not TypeKind.Struct and not TypeKind.Module)
src\Analyzers\Core\CodeFixes\GenerateConstructor\AbstractGenerateConstructorService.State.cs (1)
405return TypeToGenerateIn?.TypeKind is (TypeKind?)TypeKind.Class or (TypeKind?)TypeKind.Struct;
src\Analyzers\Core\CodeFixes\GenerateDefaultConstructors\AbstractGenerateDefaultConstructorsService.State.cs (1)
109if (classType.TypeKind == TypeKind.Struct)
src\Analyzers\Core\CodeFixes\GenerateMember\AbstractGenerateMemberService.cs (1)
28TypeKind.Struct,
Microsoft.CodeAnalysis.Test.Utilities (1)
Compilation\CompilationDifference.cs (1)
159$"{(displayTypeKind && container is INamedTypeSymbolInternal type ? (type.TypeKind == TypeKind.Struct ? "struct " : "class ") : "")}{container}: " +
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)
265Case TypeKind.Struct 461Case TypeKind.Struct
Symbols\Tuples\TupleTypeSymbol.vb (1)
148Return TypeKind.Struct
Symbols\TypeSymbolExtensions.vb (2)
831TypeKind.Struct, 864TypeKind.Struct,
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (2)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (2)
101Dim isStruct = namedType.TypeKind = TypeKind.Struct 205If namedType.TypeKind = TypeKind.Struct OrElse
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (3)
CodeGen\CodeGenTuples.vb (3)
5752Assert.Equal(TypeKind.Struct, mTuple.TypeKind) 15034Assert.Equal(TypeKind.Struct, m1Tuple.TypeKind) 16292Assert.Equal(TypeKind.Struct, m1Tuple.TypeKind)
Microsoft.CodeAnalysis.VisualBasic.Features (1)
EditAndContinue\VisualBasicEditAndContinueAnalyzer.vb (1)
655Return method.ContainingType.TypeKind <> TypeKind.Struct
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (7)
Semantics\GetExtendedSemanticInfoTests.vb (1)
2078Assert.Equal(TypeKind.Struct, semanticInfo.Type.TypeKind)
Semantics\NativeIntegerTests.vb (1)
53Assert.Equal(TypeKind.Struct, type.TypeKind)
Semantics\UseSiteErrorTests.vb (5)
598Assert.Equal(TypeKind.Struct, compilation1.GetTypeByMetadataName("A").TypeKind) 618Assert.Equal(TypeKind.Struct, compilation2.GetTypeByMetadataName("A").TypeKind) 629Assert.Equal(TypeKind.Struct, compilation3.GetTypeByMetadataName("A").TypeKind) 671Assert.Equal(TypeKind.Struct, compilation5.GetTypeByMetadataName("A").TypeKind) 712Assert.Equal(TypeKind.Struct, compilation7.GetTypeByMetadataName("A").TypeKind)
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
Recommendations\VisualBasicRecommendationServiceRunner.vb (1)
503type.TypeKind = TypeKind.Struct Then
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\VisualBasic\CodeGeneration\NamedTypeGenerator.vb (2)
101Dim isStruct = namedType.TypeKind = TypeKind.Struct 205If namedType.TypeKind = TypeKind.Struct OrElse
Microsoft.CodeAnalysis.Workspaces (16)
Classification\ClassificationExtensions.cs (1)
14TypeKind.Struct => type.IsRecord ? ClassificationTypeNames.RecordStructName : ClassificationTypeNames.StructName,
Editing\SyntaxGenerator.cs (2)
770TypeKind.Struct => StructDeclaration( 848case 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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\INamedTypeSymbolExtensions.cs (2)
335if (classOrStructType.TypeKind is not TypeKind.Class and not TypeKind.Struct) 541TypeKind: TypeKind.Class or TypeKind.Struct
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (2)
94=> symbol?.TypeKind == TypeKind.Struct; 687if (type.TypeKind != TypeKind.Struct)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\EditorConfig\EditorConfigNamingStyleParser_SymbolSpec.cs (2)
126private static readonly SymbolKindOrTypeKind _struct = new(TypeKind.Struct); 383case TypeKind.Struct:
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyleRules.cs (1)
68if (containingType.TypeKind is not TypeKind.Class and not TypeKind.Struct)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\SymbolSpecification.cs (2)
68new SymbolKindOrTypeKind(TypeKind.Struct), 388CodeAnalysis.TypeKind.Structure => nameof(CodeAnalysis.TypeKind.Struct),
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
48public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (1)
498if (containingType?.TypeKind == TypeKind.Struct)
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
CodeStyle\NamingStylePreferencesUpgradeTests.cs (1)
190[InlineData(typeof(TypeKind), nameof(TypeKind.Struct), nameof(TypeKind.Structure))]
EditorConfigParsing\NamingStyleParserTests.cs (1)
158symbolKind => Assert.Equal(new SymbolKindOrTypeKind(TypeKind.Struct), symbolKind),
Microsoft.Gen.Logging (1)
Parsing\Parser.LogProperties.cs (1)
20private static readonly HashSet<TypeKind> _allowedTypeKinds = [TypeKind.Class, TypeKind.Struct, TypeKind.Interface];
Microsoft.Gen.Metrics (1)
Parser.cs (1)
814if (kind == TypeKind.Struct && specialType == SpecialType.None)
Microsoft.Gen.MetricsReports (1)
src\Generators\Microsoft.Gen.Metrics\Parser.cs (1)
814if (kind == TypeKind.Struct && specialType == SpecialType.None)
Microsoft.Interop.ComInterfaceGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
273if (methodSymbol.ReturnType is { TypeKind: TypeKind.Struct }
Microsoft.Interop.LibraryImportGenerator (1)
src\libraries\System.Runtime.InteropServices\gen\Common\ConvertToSourceGeneratedInteropFixer.cs (1)
273if (methodSymbol.ReturnType is { TypeKind: TypeKind.Struct }
Microsoft.Interop.SourceGeneration (2)
CustomMarshallingInfoHelper.cs (2)
30&& entryPointType.TypeKind != TypeKind.Struct) 146&& entryPointType.TypeKind != TypeKind.Struct)
Microsoft.VisualStudio.LanguageServices (8)
Library\ObjectBrowser\ObjectList.cs (1)
202case TypeKind.Struct:
Progression\GraphBuilder.cs (1)
597case TypeKind.Struct:
Progression\GraphProvider.cs (6)
200IsAnyTypeKind(n, TypeKind.Class, TypeKind.Interface, TypeKind.Struct, TypeKind.Enum, TypeKind.Delegate))) 227IsAnyTypeKind(n, TypeKind.Class, TypeKind.Struct))) 245IsAnyTypeKind(n, TypeKind.Class, TypeKind.Struct))) 257IsAnyTypeKind(n, TypeKind.Class, TypeKind.Struct) && 295IsAnyTypeKind(n, TypeKind.Class, TypeKind.Struct) && 307IsAnyTypeKind(n, TypeKind.Class, TypeKind.Struct) &&
Microsoft.VisualStudio.LanguageServices.CSharp (3)
CodeModel\CSharpCodeModelService.cs (1)
757TypeKind.Struct or
ObjectBrowser\DescriptionBuilder.cs (2)
75case TypeKind.Struct: 182typeSymbol.TypeKind != TypeKind.Struct &&
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (1)
GlyphExtensionsTests.cs (1)
135typeKind: TypeKind.Struct);