3 implementations of IsValueType
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\TypeSymbol.cs (1)
127bool ITypeSymbol.IsValueType
Microsoft.CodeAnalysis.Features (1)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
63public bool IsValueType => _symbol.IsValueType;
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\TypeSymbol.vb (1)
246Public MustOverride ReadOnly Property IsValueType As Boolean Implements ITypeSymbol.IsValueType, ITypeSymbolInternal.IsValueType
113 references to IsValueType
ConfigurationSchemaGenerator (8)
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (3)
632bool hasPublicParameterlessCtor = typeSymbol.IsValueType || parameterlessCtor is not null; 639ctor = typeSymbol.IsValueType 726if (typeSymbol.IsValueType)
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (1)
95if (type.IsValueType)
RuntimeSource\Configuration.Binder\Parser\OptionsBuilderConfigurationExtensions.cs (1)
30Debug.Assert(typeSymbol?.IsValueType is not true);
RuntimeSource\Configuration.Binder\Parser\OptionsConfigurationServiceCollectionExtensions.cs (1)
74Debug.Assert(typeSymbol?.IsValueType is not true);
RuntimeSource\Configuration.Binder\Specs\Types\TypeSpec.cs (1)
19IsValueType = type.IsValueType;
RuntimeSource\SourceGenerators\TypeRef.cs (1)
20IsValueType = type.IsValueType;
ILLink.RoslynAnalyzer (2)
COMAnalyzer.cs (1)
102 if (typeSymbol.IsValueType) {
TrimAnalysis\ParameterProxy.cs (1)
21 return Method.Method.ContainingType.IsValueType
Microsoft.AspNetCore.Http.RequestDelegateGenerator (6)
StaticRouteHandlerModel\Emitters\EmitterExtensions.cs (1)
45endpointParameter.Type.IsValueType && endpointParameter.GetBindAsyncReturnType().IsNullableOfT()
StaticRouteHandlerModel\Emitters\EndpointJsonPreparationEmitter.cs (1)
49(endpointResponse.ResponseType.IsSealed || endpointResponse.ResponseType.IsValueType))
StaticRouteHandlerModel\Emitters\EndpointParameterEmitter.cs (2)
368if (endpointParameter.Type.IsValueType && !endpointParameter.GetBindAsyncReturnType().IsNullableOfT()) 372codeWriter.WriteLine(endpointParameter.Type.IsValueType && endpointParameter.GetBindAsyncReturnType().IsNullableOfT()
StaticRouteHandlerModel\EndpointParameter.cs (1)
514if (type.IsValueType)
StaticRouteHandlerModel\Model\EndpointParameterExtensions.cs (1)
35if (handlerParameterType.IsValueType)
Microsoft.CodeAnalysis (7)
Operations\ControlFlowGraphBuilder.cs (2)
4206return type?.IsValueType == true && !ITypeSymbolHelpers.IsNullableType(type); 7926if (operation.Type.IsValueType)
Symbols\ISymbolExtensions.cs (1)
152if (scopeType is not INamedTypeSymbol { Name: WellKnownMemberNames.LockScopeTypeName, Arity: 0, IsValueType: true, IsRefLikeType: true, DeclaredAccessibility: Accessibility.Public } ||
Symbols\ITypeSymbol.cs (4)
56/// <see cref="IsReferenceType"/> and <see cref="IsValueType"/> both return true. However, for an unconstrained type 57/// parameter, <see cref="IsReferenceType"/> and <see cref="IsValueType"/> will both return false. 63/// <see cref="IsReferenceType"/> and <see cref="IsValueType"/> both return true. However, for an unconstrained type 64/// parameter, <see cref="IsReferenceType"/> and <see cref="IsValueType"/> will both return false.
Microsoft.CodeAnalysis.CodeStyle (6)
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
113if (genericParameterSymbol.IsValueType)
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
160if (type?.IsValueType == true)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (3)
65=> symbol is { IsValueType: true } && !symbol.IsNullable(); 258if (typeSymbol.IsSealed || typeSymbol.IsValueType) 635if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1017if (newReceiverType.IsValueType)
Microsoft.CodeAnalysis.CodeStyle.Fixes (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (3)
150else if (containingType.IsValueType) 192if (!containingType.IsValueType && HasExistingBaseEqualsMethod(containingType)) 287if (!containingType.IsValueType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (1)
194if (containingType.IsValueType)
Microsoft.CodeAnalysis.CSharp (2)
SymbolDisplay\SymbolDisplayVisitor.Types.cs (2)
84!ITypeSymbolHelpers.IsNullableType(type) && !type.IsValueType) 92!type.IsValueType &&
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (1)
148else if (symbolInfo.Symbol is INamedTypeSymbol { IsValueType: true, IsGenericType: false })
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
626semanticModel.GetTypeInfo(expression, cancellationToken).Type?.IsValueType == true;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
1312rewrittenType.IsValueType ||
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
292if (constraintType.IsValueType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
308if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.Annotated }) 363if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.Annotated })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1148else if (symbol.IsValueType)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (11)
CodeGen\CodeGenLocalFunctionTests.cs (11)
3137Assert.True(goo.Parameters[0].Type.IsValueType); 3164Assert.True(goo.Parameters[0].Type.IsValueType); 3165Assert.True(bar.Parameters[0].Type.IsValueType); 3166Assert.True(bar.Parameters[1].Type.IsValueType); 3217Assert.True(inner.Parameters[0].Type.IsValueType); 3218Assert.True(inner.Parameters[1].Type.IsValueType); 3219Assert.True(middle.Parameters[0].Type.IsValueType); 3280Assert.True(goo.Parameters[0].Type.IsValueType); 3321Assert.True(goo.Parameters[1].Type.IsValueType); 3322Assert.True(bar.Parameters[1].Type.IsValueType); 3323Assert.True(bar.Parameters[2].Type.IsValueType);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Semantics\InlineArrayTests.cs (1)
116Assert.Equal(t.IsValueType, SpecialType.System_Runtime_CompilerServices_InlineArrayAttribute.IsValueType());
Microsoft.CodeAnalysis.CSharp.Features (3)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (1)
131if (typeInfo.Type?.IsValueType == true)
src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (1)
148else if (symbolInfo.Symbol is INamedTypeSymbol { IsValueType: true, IsGenericType: false })
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
626semanticModel.GetTypeInfo(expression, cancellationToken).Type?.IsValueType == true;
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (1)
Symbols\Source\DelegateTests.cs (1)
132Assert.False(v.IsValueType);
Microsoft.CodeAnalysis.CSharp.Workspaces (8)
Recommendations\CSharpRecommendationServiceRunner_Operators.cs (3)
62if (symbol.IsUserDefinedOperator() && symbol.Parameters.All(p => p.Type.IsValueType)) 73return symbol.Parameters.Length == 1 && symbol.ReturnType.IsValueType; 87return symbol.Parameters.Length == 2 && symbol.ReturnType.IsValueType;
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
1312rewrittenType.IsValueType ||
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
292if (constraintType.IsValueType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
308if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.Annotated }) 363if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.Annotated })
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1148else if (symbol.IsValueType)
Microsoft.CodeAnalysis.Features (7)
Common\SymbolDisplayPartKindTags.cs (1)
23return namedType.IsValueType ? SymbolDisplayPartKind.RecordStructName : SymbolDisplayPartKind.RecordClassName;
ExtractMethod\MethodExtractor.Analyzer.cs (1)
706if (type.IsValueType && !IsWrittenInsideForFrameworkValueType(symbolMap, model, symbol, writtenInside))
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (1)
70if (containingType.IsValueType)
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.cs (1)
102if (structuralType.IsValueType)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
63public bool IsValueType => _symbol.IsValueType;
src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
113if (genericParameterSymbol.IsValueType)
src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (1)
160if (type?.IsValueType == true)
Microsoft.CodeAnalysis.Test.Utilities (5)
Compilation\TestOperationVisitor.cs (1)
1026if (!operation.Type.IsValueType)
Diagnostics\BoxingOperationAnalyzer.cs (2)
50conversion.Operand.Type.IsValueType && 63invocation.Instance.Type.IsValueType &&
Diagnostics\FieldCouldBeReadOnlyAnalyzer.cs (1)
135if (fieldReference.Instance != null && fieldReference.Instance.Type.IsValueType)
Diagnostics\LocalCouldBeConstAnalyzer.cs (1)
126if (fieldReference.Instance != null && fieldReference.Instance.Type.IsValueType)
Microsoft.CodeAnalysis.UnitTests (1)
CorLibTypesTests.cs (1)
87Assert.Equal(symbol.IsValueType, specialType.IsValueType());
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\TypeSymbol.vb (1)
246Public MustOverride ReadOnly Property IsValueType As Boolean Implements ITypeSymbol.IsValueType, ITypeSymbolInternal.IsValueType
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (6)
Semantics\GetSemanticInfoTests.vb (6)
4704Assert.False(tpSymbol1.IsValueType) 4711Assert.False(tpSymbol1.IsValueType) 4714Assert.False(tpSymbol1.IsValueType) 4717Assert.True(tpSymbol1.IsValueType) 4720Assert.False(tpSymbol1.IsValueType) 4723Assert.True(tpSymbol1.IsValueType)
Microsoft.CodeAnalysis.Workspaces (10)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (3)
65=> symbol is { IsValueType: true } && !symbol.IsNullable(); 258if (typeSymbol.IsSealed || typeSymbol.IsValueType) 635if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1017if (newReceiverType.IsValueType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (4)
150else if (containingType.IsValueType) 192if (!containingType.IsValueType && HasExistingBaseEqualsMethod(containingType)) 244var valueIEquatable = memberType?.IsValueType == true && ImplementsIEquatable(memberType, iequatableType); 287if (!containingType.IsValueType)
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (2)
194if (containingType.IsValueType) 234if (member.GetSymbolType()?.IsValueType ?? false)
Microsoft.Extensions.Options.SourceGeneration (2)
Parser.cs (2)
419enumeratedIsValueType = enumeratedType.IsValueType; 589memberType.IsValueType,
Microsoft.Gen.Logging (1)
Parsing\Parser.LogProperties.cs (1)
220if (property.Type.IsValueType && !property.Type.IsNullableOfT())
Microsoft.Interop.LibraryImportGenerator (2)
Analyzers\CustomMarshallerAttributeAnalyzer.cs (1)
714else if (marshallerType.IsValueType)
Analyzers\CustomMarshallerAttributeFixer.cs (1)
198if (marshallerType.IsValueType)
Microsoft.Interop.SourceGeneration (3)
ManagedTypeInfo.cs (1)
72if (type.IsValueType)
ManualTypeMarshallingHelper.cs (1)
416if (marshallerType.IsValueType)
TypeSymbolExtensions.cs (1)
68else if (t.IsValueType)
Microsoft.Maui.Controls.BindingSourceGen (2)
ITypeSymbolExtensions.cs (2)
21 GlobalName: GetGlobalName(typeSymbol, isNullable, typeSymbol.IsValueType), 24 IsValueType: typeSymbol.IsValueType);
System.Text.Json.SourceGeneration (7)
Helpers\RoslynExtensions.cs (4)
113return constructorInfo != null || type.IsValueType; 117=> type.Constructors.Where(ctor => !ctor.IsStatic && !(ctor.IsImplicitlyDeclared && type.IsValueType && ctor.Parameters.Length == 0)); 199=> !type.IsValueType || type.OriginalDefinition.SpecialType is SpecialType.System_Nullable_T; 203if (type.IsValueType && type is INamedTypeSymbol { OriginalDefinition.SpecialType: SpecialType.System_Nullable_T })
JsonSourceGenerator.Parser.cs (2)
1443if ((constructor is null && !type.IsValueType) || type.IsAbstract) 1771if (useDefaultCtorInAnnotatedStructs && type.IsValueType && ctorWithAttribute == null)
src\libraries\Common\src\SourceGenerators\TypeRef.cs (1)
20IsValueType = type.IsValueType;