8 implementations of IsValueType
GenerateDocumentationAndConfigFiles (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
39public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
Microsoft.CodeAnalysis.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
39public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
Microsoft.CodeAnalysis.CodeStyle.Fixes (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
39public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
Microsoft.CodeAnalysis.CSharp (1)
Symbols\PublicModel\TypeSymbol.cs (1)
141bool 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
Microsoft.CodeAnalysis.Workspaces (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
39public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
Roslyn.Diagnostics.Analyzers (1)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationTypeSymbol.cs (1)
39public bool IsValueType => TypeKind is TypeKind.Struct or TypeKind.Enum;
238 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;
GenerateDocumentationAndConfigFiles (15)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
533!method.Parameters[0].Type.IsValueType;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
249=> typeSymbol.IsValueType || typeSymbol.SpecialType == SpecialType.System_String; 254typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType; 257=> typeSymbol != null && typeSymbol.IsValueType && typeSymbol.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1012if (newReceiverType.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
61=> symbol is { IsValueType: true } && !symbol.IsNullable(); 255if (typeSymbol.IsSealed || typeSymbol.IsValueType) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (5)
153if (!containingType.IsValueType) 169else if (containingType.IsValueType) 212if (!containingType.IsValueType && HasExistingBaseEqualsMethod(containingType)) 264var valueIEquatable = memberType?.IsValueType == true && ImplementsIEquatable(memberType, iequatableType); 307if (!containingType.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (2)
194if (containingType.IsValueType) 234if (member.GetSymbolType()?.IsValueType ?? false)
ILLink.RoslynAnalyzer (2)
COMAnalyzer.cs (1)
111if (typeSymbol.IsValueType)
TrimAnalysis\ParameterProxy.cs (1)
23return 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)
371if (endpointParameter.Type.IsValueType && !endpointParameter.GetBindAsyncReturnType().IsNullableOfT()) 375codeWriter.WriteLine(endpointParameter.Type.IsValueType && endpointParameter.GetBindAsyncReturnType().IsNullableOfT()
StaticRouteHandlerModel\EndpointParameter.cs (1)
521if (type.IsValueType)
StaticRouteHandlerModel\Model\EndpointParameterExtensions.cs (1)
35if (handlerParameterType.IsValueType)
Microsoft.CodeAnalysis (7)
Operations\ControlFlowGraphBuilder.cs (2)
4217return type?.IsValueType == true && !ITypeSymbolHelpers.IsNullableType(type); 7968if (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)
57/// <see cref="IsReferenceType"/> and <see cref="IsValueType"/> both return true. However, for an unconstrained type 58/// parameter, <see cref="IsReferenceType"/> and <see cref="IsValueType"/> will both return false. 64/// <see cref="IsReferenceType"/> and <see cref="IsValueType"/> both return true. However, for an unconstrained type 65/// parameter, <see cref="IsReferenceType"/> and <see cref="IsValueType"/> will both return false.
Microsoft.CodeAnalysis.Analyzers (15)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
533!method.Parameters[0].Type.IsValueType;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
249=> typeSymbol.IsValueType || typeSymbol.SpecialType == SpecialType.System_String; 254typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType; 257=> typeSymbol != null && typeSymbol.IsValueType && typeSymbol.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1012if (newReceiverType.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
61=> symbol is { IsValueType: true } && !symbol.IsNullable(); 255if (typeSymbol.IsSealed || typeSymbol.IsValueType) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (5)
153if (!containingType.IsValueType) 169else if (containingType.IsValueType) 212if (!containingType.IsValueType && HasExistingBaseEqualsMethod(containingType)) 264var valueIEquatable = memberType?.IsValueType == true && ImplementsIEquatable(memberType, iequatableType); 307if (!containingType.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (2)
194if (containingType.IsValueType) 234if (member.GetSymbolType()?.IsValueType ?? false)
Microsoft.CodeAnalysis.AnalyzerUtilities (24)
src\a172c07bebba4cd8\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (1)
70(!location.LocationType.IsValueType || location.LocationType.IsRefLikeType) &&
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
533!method.Parameters[0].Type.IsValueType;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
249=> typeSymbol.IsValueType || typeSymbol.SpecialType == SpecialType.System_String; 254typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType; 257=> typeSymbol != null && typeSymbol.IsValueType && typeSymbol.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAbstractValue.cs (2)
25Debug.Assert(kind != CopyAbstractValueKind.KnownReferenceCopy || analysisEntities.All(a => !a.Type.IsValueType)); 29!analysisEntities.First().Type.IsValueType)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysis.CopyDataFlowOperationVisitor.cs (3)
203newKind = analysisEntity.Type.IsValueType ? 210!analysisEntity.Type.IsValueType && 263else if (assignedValue.AnalysisEntity == null || assignedValue.AnalysisEntity.Type.IsValueType)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AddressSharedEntitiesProvider.cs (1)
50var isReferenceCopy = !addressSharedEntities.Any(a => a.Type.IsValueType);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (5)
211analysisEntity.Type.IsValueType == capturedEntity.Type.IsValueType) 224var kind = capturedEntity.Type.IsValueType ? CopyAbstractValueKind.KnownValueCopy : CopyAbstractValueKind.KnownReferenceCopy; 459if (instance.Type.IsValueType) 462instanceEntityOpt.Type.IsValueType)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\ConversionInference.cs (4)
40!targetType.IsValueType && 41sourceType?.IsValueType == true, 43targetType.IsValueType && 45!sourceType.IsValueType
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1012if (newReceiverType.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
61=> symbol is { IsValueType: true } && !symbol.IsNullable(); 255if (typeSymbol.IsSealed || typeSymbol.IsValueType) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum)
Microsoft.CodeAnalysis.CodeStyle (9)
src\roslyn\src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
248return operation is { Type.IsValueType: true, Parent: IPropertyReferenceOperation }
src\roslyn\src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (1)
91if (nullCheckedExpression is { Type.IsValueType: true })
src\roslyn\src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
113if (genericParameterSymbol.IsValueType)
src\roslyn\src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (2)
197if (type?.IsValueType == true) 225IsValueType: false,
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1012if (newReceiverType.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
61=> symbol is { IsValueType: true } && !symbol.IsNullable(); 255if (typeSymbol.IsSealed || typeSymbol.IsValueType) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum)
Microsoft.CodeAnalysis.CodeStyle.Fixes (7)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (5)
153if (!containingType.IsValueType) 169else if (containingType.IsValueType) 212if (!containingType.IsValueType && HasExistingBaseEqualsMethod(containingType)) 264var valueIEquatable = memberType?.IsValueType == true && ImplementsIEquatable(memberType, iequatableType); 307if (!containingType.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (2)
194if (containingType.IsValueType) 234if (member.GetSymbolType()?.IsValueType ?? false)
Microsoft.CodeAnalysis.CSharp (2)
SymbolDisplay\SymbolDisplayVisitor.Types.cs (2)
83!ITypeSymbolHelpers.IsNullableType(type) && !type.IsValueType) 91!type.IsValueType &&
Microsoft.CodeAnalysis.CSharp.CodeStyle (3)
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (1)
152else if (symbolInfo.Symbol is INamedTypeSymbol { IsValueType: true, IsGenericType: false })
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
595semanticModel.GetTypeInfo(expression, cancellationToken).Type?.IsValueType == true;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
1483rewrittenType.IsValueType ||
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (4)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
287if (constraintType.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
302if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.Annotated }) 357if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.Annotated })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1152else if (symbol.IsValueType)
Microsoft.CodeAnalysis.CSharp.Features (4)
QuickInfo\CSharpSemanticQuickInfoProvider.cs (2)
253if (symbol.GetMemberType() is { IsValueType: false, NullableAnnotation: NullableAnnotation.None }) 262if (typeInfo.Type is { IsValueType: true })
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnnecessaryNullableDirective\NullableImpactingSpanWalker.cs (1)
152else if (symbolInfo.Symbol is INamedTypeSymbol { IsValueType: true, IsGenericType: false })
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\UseCollectionExpressionHelpers.cs (1)
595semanticModel.GetTypeInfo(expression, cancellationToken).Type?.IsValueType == true;
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (1)
Microsoft.NetCore.Analyzers\Runtime\CSharpForwardCancellationTokenToInvocationsFixer.TypeNameVisitor.cs (1)
81!symbol.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\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
1483rewrittenType.IsValueType ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
287if (constraintType.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
302if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.Annotated }) 357if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.Annotated })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1152else if (symbol.IsValueType)
Microsoft.CodeAnalysis.Extensions.Package (3)
Symbols\ITypeSymbolExtensions.cs (3)
61=> symbol is { IsValueType: true } && !symbol.IsNullable(); 255if (typeSymbol.IsSealed || typeSymbol.IsValueType) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum)
Microsoft.CodeAnalysis.Features (14)
Common\SymbolDisplayPartKindTags.cs (1)
23return namedType.IsValueType ? SymbolDisplayPartKind.RecordStructName : SymbolDisplayPartKind.RecordClassName;
ExtractMethod\MethodExtractor.Analyzer.cs (1)
629if (type.IsValueType && !IsWrittenInsideForFrameworkValueType(symbolMap, symbol, writtenInside))
GenerateEqualsAndGetHashCodeFromMembers\AbstractGenerateEqualsAndGetHashCodeService.cs (1)
70if (containingType.IsValueType)
GenerateEqualsAndGetHashCodeFromMembers\GenerateEqualsAndGetHashCodeAction.cs (4)
107!_containingType.IsValueType 134CodeGenerationSymbolFactory.CreateParameterSymbol(_containingType.IsValueType ? _containingType : _containingType.WithNullableAnnotation(NullableAnnotation.Annotated), LeftName), 135CodeGenerationSymbolFactory.CreateParameterSymbol(_containingType.IsValueType ? _containingType : _containingType.WithNullableAnnotation(NullableAnnotation.Annotated), RightName)); 147var expression = _containingType.IsValueType
LanguageServices\AnonymousTypeDisplayService\AbstractStructuralTypeDisplayService.cs (1)
103if (structuralType.IsValueType)
MetadataAsSource\AbstractMetadataAsSourceService.WrappedNamedTypeSymbol.cs (1)
63public bool IsValueType => _symbol.IsValueType;
src\roslyn\src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (1)
248return operation is { Type.IsValueType: true, Parent: IPropertyReferenceOperation }
src\roslyn\src\Analyzers\Core\Analyzers\UseConditionalExpression\ForAssignment\UseConditionalExpressionForAssignmentHelpers.cs (1)
91if (nullCheckedExpression is { Type.IsValueType: true })
src\roslyn\src\Analyzers\Core\Analyzers\UseIsNullCheck\AbstractUseIsNullForReferenceEqualsDiagnosticAnalyzer.cs (1)
113if (genericParameterSymbol.IsValueType)
src\roslyn\src\Analyzers\Core\Analyzers\UseNullPropagation\AbstractUseNullPropagationDiagnosticAnalyzer.cs (2)
197if (type?.IsValueType == true) 225IsValueType: false,
Microsoft.CodeAnalysis.NetAnalyzers (34)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverloadOperatorEqualsOnOverridingValueTypeEquals.cs (1)
42if (namedTypeSymbol.IsValueType &&
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OverrideEqualsAndOperatorEqualsOnValueTypes.cs (1)
70if (!namedType.IsValueType ||
Microsoft.CodeQuality.Analyzers\QualityGuidelines\DoNotInitializeUnnecessarily.cs (1)
109(type.IsValueType && value is IObjectCreationOperation oco && oco.Arguments.IsEmpty && oco.Initializer is null && oco.Constructor?.IsImplicitlyDeclared == true))
Microsoft.NetCore.Analyzers\InteropServices\DisableRuntimeMarshalling.cs (1)
201if (type.IsValueType && autoLayoutCache.TypeIsAutoLayoutOrContainsAutoLayout(type))
Microsoft.NetCore.Analyzers\InteropServices\DisableRuntimeMarshallingAnalyzer.AutoLayoutTypeCache.cs (2)
38Debug.Assert(type.IsValueType); 80if (member is IFieldSymbol { IsStatic: false, Type.IsValueType: true } valueTypeField
Microsoft.NetCore.Analyzers\Performance\AvoidPotentiallyExpensiveCallWhenLogging.cs (1)
248conversionOperation.Operand.Type?.IsValueType is true;
Microsoft.NetCore.Analyzers\Performance\UseConcreteTypeAnalyzer.Collector.cs (1)
707=> target.Type == null || (!target.Type.IsSealed && !target.Type.IsValueType);
Microsoft.NetCore.Analyzers\Performance\UseSpanClearInsteadOfFill.cs (1)
137return objectCreation.Type?.IsValueType == true
Microsoft.NetCore.Analyzers\Runtime\AvoidRedundantRegexIsMatchBeforeMatch.cs (2)
576return leftInstance.Type is { IsValueType: false } && 577rightInstance.Type is { IsValueType: false };
Microsoft.NetCore.Analyzers\Runtime\DisposableTypesShouldDeclareFinalizer.cs (1)
86if (containingType == null || containingType.IsValueType)
Microsoft.NetCore.Analyzers\Runtime\DoNotUseReferenceEqualsWithValueTypes.cs (1)
121if (val.Type?.IsValueType == true)
src\0437c1690f5501bd\CopyAnalysis.CopyDataFlowOperationVisitor.cs (3)
203newKind = analysisEntity.Type.IsValueType ? 210!analysisEntity.Type.IsValueType && 263else if (assignedValue.AnalysisEntity == null || assignedValue.AnalysisEntity.Type.IsValueType)
src\afc74d572e54ec72\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (1)
67(!location.LocationType.IsValueType || location.LocationType.IsRefLikeType) &&
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
727!method.Parameters[0].Type.IsValueType;
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (4)
298=> typeSymbol.IsValueType || typeSymbol.SpecialType == SpecialType.System_String; 304typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType; 308=> typeSymbol != null && typeSymbol.IsValueType && typeSymbol.OriginalDefinition.SpecialType != SpecialType.System_Nullable_T; 311=> typeSymbol != null && typeSymbol.IsValueType && typeSymbol.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAbstractValue.cs (2)
24Debug.Assert(kind != CopyAbstractValueKind.KnownReferenceCopy || analysisEntities.All(a => !a.Type.IsValueType)); 28!analysisEntities.First().Type.IsValueType)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AddressSharedEntitiesProvider.cs (1)
48var isReferenceCopy = !addressSharedEntities.Any(a => a.Type.IsValueType);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (5)
209analysisEntity.Type.IsValueType == capturedEntity.Type.IsValueType) 222var kind = capturedEntity.Type.IsValueType ? CopyAbstractValueKind.KnownValueCopy : CopyAbstractValueKind.KnownReferenceCopy; 457if (instance.Type.IsValueType) 460instanceEntityOpt.Type.IsValueType)
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\ConversionInference.cs (4)
39!targetType.IsValueType && 40sourceType?.IsValueType == true, 42targetType.IsValueType && 44!sourceType.IsValueType
Microsoft.CodeAnalysis.ResxSourceGenerator (8)
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
533!method.Parameters[0].Type.IsValueType;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
249=> typeSymbol.IsValueType || typeSymbol.SpecialType == SpecialType.System_String; 254typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType; 257=> typeSymbol != null && typeSymbol.IsValueType && typeSymbol.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1012if (newReceiverType.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
61=> symbol is { IsValueType: true } && !symbol.IsNullable(); 255if (typeSymbol.IsSealed || typeSymbol.IsValueType) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum)
Microsoft.CodeAnalysis.VisualBasic (1)
Symbols\TypeSymbol.vb (1)
246Public MustOverride ReadOnly Property IsValueType As Boolean Implements ITypeSymbol.IsValueType, ITypeSymbolInternal.IsValueType
Microsoft.CodeAnalysis.Workspaces (11)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1012if (newReceiverType.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
61=> symbol is { IsValueType: true } && !symbol.IsNullable(); 255if (typeSymbol.IsSealed || typeSymbol.IsValueType) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (5)
153if (!containingType.IsValueType) 169else if (containingType.IsValueType) 212if (!containingType.IsValueType && HasExistingBaseEqualsMethod(containingType)) 264var valueIEquatable = memberType?.IsValueType == true && ImplementsIEquatable(memberType, iequatableType); 307if (!containingType.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (2)
194if (containingType.IsValueType) 234if (member.GetSymbolType()?.IsValueType ?? false)
Microsoft.Extensions.Configuration.Binder.SourceGeneration (10)
ConfigurationBindingGenerator.Parser.cs (5)
442Debug.Assert(!shouldTryCast || !type.IsValueType, "Should not test cast for value types."); 538Debug.Assert(!shouldTryCast || !type.IsValueType, "Should not test cast for value types."); 684bool hasPublicParameterlessCtor = typeSymbol.IsValueType || parameterlessCtor is not null; 691ctor = typeSymbol.IsValueType 805if (typeSymbol.IsValueType)
Parser\ConfigurationBinder.cs (1)
95if (type.IsValueType)
Parser\OptionsBuilderConfigurationExtensions.cs (1)
30Debug.Assert(typeSymbol?.IsValueType is not true);
Parser\OptionsConfigurationServiceCollectionExtensions.cs (1)
74Debug.Assert(typeSymbol?.IsValueType is not true);
Specs\Types\TypeSpec.cs (1)
19IsValueType = type.IsValueType;
src\runtime\src\libraries\Common\src\SourceGenerators\TypeRef.cs (1)
20IsValueType = type.IsValueType;
Microsoft.Extensions.Options.SourceGeneration (2)
Parser.cs (2)
431enumeratedIsValueType = enumeratedType.IsValueType; 601memberType.IsValueType,
Microsoft.Gen.Logging (1)
Parsing\Parser.LogProperties.cs (1)
219if (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);
Roslyn.Diagnostics.Analyzers (17)
AbstractDoNotCopyValue.cs (2)
281&& symbol.ContainingType.IsValueType) 1685if (symbol is not { IsValueType: true })
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (1)
533!method.Parameters[0].Type.IsValueType;
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\ITypeSymbolExtensions.cs (3)
249=> typeSymbol.IsValueType || typeSymbol.SpecialType == SpecialType.System_String; 254typeSymbol is ITypeParameterSymbol typeParameter && !typeParameter.IsValueType; 257=> typeSymbol != null && typeSymbol.IsValueType && typeSymbol.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T;
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (1)
1012if (newReceiverType.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (3)
61=> symbol is { IsValueType: true } && !symbol.IsNullable(); 255if (typeSymbol.IsSealed || typeSymbol.IsValueType) 637if (type != null && type.IsValueType && type.TypeKind == TypeKind.Enum)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateEqualsMethod.cs (5)
153if (!containingType.IsValueType) 169else if (containingType.IsValueType) 212if (!containingType.IsValueType && HasExistingBaseEqualsMethod(containingType)) 264var valueIEquatable = memberType?.IsValueType == true && ImplementsIEquatable(memberType, iequatableType); 307if (!containingType.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\SyntaxGeneratorExtensions_CreateGetHashCodeMethod.cs (2)
194if (containingType.IsValueType) 234if (member.GetSymbolType()?.IsValueType ?? false)
Roslyn.Diagnostics.CSharp.Analyzers (6)
PreferNullLiteral.cs (1)
65else if (type.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (1)
1483rewrittenType.IsValueType ||
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
287if (constraintType.IsValueType)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\ITypeSymbolExtensions.TypeSyntaxGeneratorVisitor.cs (2)
302if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.Annotated }) 357if (symbol is { IsValueType: false, NullableAnnotation: NullableAnnotation.Annotated })
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1152else if (symbol.IsValueType)
System.Text.Json.SourceGeneration (9)
Helpers\RoslynExtensions.cs (6)
116return constructorInfo != null || type.IsValueType; 120=> type.Constructors.Where(ctor => !ctor.IsStatic && !(ctor.IsImplicitlyDeclared && type.IsValueType && ctor.Parameters.Length == 0)); 420if (arg.IsValueType) 484if (!arg.IsValueType || arg is INamedTypeSymbol { OriginalDefinition.SpecialType: SpecialType.System_Nullable_T }) 609=> !type.IsValueType || type.OriginalDefinition.SpecialType is SpecialType.System_Nullable_T; 613if (type.IsValueType && type is INamedTypeSymbol { OriginalDefinition.SpecialType: SpecialType.System_Nullable_T })
JsonSourceGenerator.Parser.cs (2)
2751if ((constructor is null && !type.IsValueType) || type.IsAbstract) 3269if (useDefaultCtorInAnnotatedStructs && type.IsValueType && ctorWithAttribute == null)
src\runtime\src\libraries\Common\src\SourceGenerators\TypeRef.cs (1)
20IsValueType = type.IsValueType;