792 references to IsValueType
Aspire.Confluent.Kafka (1)
src\Vendoring\OpenTelemetry.Instrumentation.ConfluentKafka\Shared\PropertyFetcher.AOT.cs (1)
113if (declaringType!.IsValueType)
Aspire.Microsoft.Data.SqlClient (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\PropertyFetcher.cs (1)
109if (declaringType!.IsValueType)
Aspire.Microsoft.EntityFrameworkCore.SqlServer (1)
src\Vendoring\OpenTelemetry.Instrumentation.SqlClient\Shared\DiagnosticSourceInstrumentation\PropertyFetcher.cs (1)
109if (declaringType!.IsValueType)
Aspire.StackExchange.Redis (1)
src\Vendoring\OpenTelemetry.Instrumentation.StackExchangeRedis\Shared\PropertyFetcher.AOT.cs (1)
115if (declaringType!.IsValueType)
dotnet-svcutil-lib (56)
FrameworkFork\Microsoft.Xml\Xml\schema\GenerateConverter.cs (2)
671if (!typeSrc.GetTypeInfo().IsValueType) 832if (info.IsValueType || info.IsSealed)
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (8)
637if (methodInfo.IsVirtual && !methodInfo.DeclaringType.GetTypeInfo().IsValueType) 722return info.IsValueType && !info.IsPrimitive; 727if (GetVariableType(obj).GetTypeInfo().IsValueType) 1275if (localBuilder.LocalType.GetTypeInfo().IsValueType) 1384if (argBuilder.ArgType.GetTypeInfo().IsValueType) 1793if (targetInfo.IsValueType) 1795if (sourceInfo.IsValueType) 1822if (sourceInfo.IsValueType)
FrameworkFork\Microsoft.Xml\Xml\Serialization\SourceInfo.cs (2)
84if (eType.GetTypeInfo().IsValueType) 147if (varType.GetTypeInfo().IsValueType)
FrameworkFork\Microsoft.Xml\Xml\Serialization\TypeExtensions.cs (1)
26return !targetType.GetTypeInfo().IsValueType;
FrameworkFork\Microsoft.Xml\Xml\Serialization\Types.cs (2)
809if (!info.IsValueType) 874else if (info.IsValueType)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationReader.cs (2)
1762if (elementType.GetTypeInfo().IsValueType) 1828if (currItemType.GetTypeInfo().IsValueType)
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriterILGen.cs (2)
2316Debug.Assert(!local.LocalType.GetTypeInfo().IsValueType); 2516Debug.Assert(type.GetTypeInfo().IsValueType);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ClassDataContract.cs (6)
442if (type.GetTypeInfo().IsValueType) 799this.IsValueType = type.GetTypeInfo().IsValueType; 911if (isReference && type.GetTypeInfo().IsValueType) 1094if (CollectionDataContract.IsCollection(memberContract.MemberType, false /*isConstructorRequired*/) && !memberContract.MemberType.GetTypeInfo().IsValueType) 1396if (type.GetTypeInfo().IsValueType) 1514if (type.GetTypeInfo().IsValueType && !IsNonAttributedType)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeExporter.cs (1)
555xmlContract.IsValueType = info.IsValueType;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (10)
419if ((typeCode == TypeCode.Object && type.GetTypeInfo().IsValueType) || 594if (methodInfo.IsVirtual && !methodInfo.DeclaringType.GetTypeInfo().IsValueType) 683return objType.GetTypeInfo().IsValueType && !objType.GetTypeInfo().IsPrimitive; 768if (type.GetTypeInfo().IsValueType) 1118if (localBuilder.LocalType.GetTypeInfo().IsValueType) 1151if (argBuilder.ArgType.GetTypeInfo().IsValueType) 1508if (target.GetTypeInfo().IsValueType) 1510if (source.GetTypeInfo().IsValueType) 1533if (source.GetTypeInfo().IsValueType) 1707if (type.GetTypeInfo().IsValueType)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (1)
1084if (!type.GetTypeInfo().IsValueType)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DataContract.cs (2)
1118_isValueType = type.GetTypeInfo().IsValueType; 2053return !type.GetTypeInfo().IsValueType ||
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\ExceptionDataContract.cs (1)
155this.IsValueType = type.GetTypeInfo().IsValueType;
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\PrimitiveDataContract.cs (2)
99if (UnderlyingType.GetTypeInfo().IsValueType) 119if (UnderlyingType.GetTypeInfo().IsValueType)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlDataContract.cs (2)
359if (type.GetTypeInfo().IsValueType) 408if (type.GetTypeInfo().IsValueType)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatReaderGenerator.cs (8)
204if (type.GetTypeInfo().IsValueType && !classContract.IsNonAttributedType) 216if (type.GetTypeInfo().IsValueType) 391if ((primitiveContract != null && primitiveContract.UnderlyingType != Globals.TypeOfObject) || nullables != 0 || type.GetTypeInfo().IsValueType) 404else if (type.GetTypeInfo().IsValueType) 418if (type.GetTypeInfo().IsValueType) 434if (!type.GetTypeInfo().IsValueType) 443if (type.GetTypeInfo().IsValueType) 535if (type.GetTypeInfo().IsValueType)
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatWriterGenerator.cs (2)
467if (type.GetTypeInfo().IsValueType) 556if (memberType.GetTypeInfo().IsValueType && !isNullableOfT)
FrameworkFork\System.ServiceModel\Extensions\ReflectionExtensions.cs (1)
88return type.GetTypeInfo().IsValueType;
FrameworkFork\System.ServiceModel\System\ServiceModel\SynchronizedCollection.cs (1)
304if (typeof(T).GetTypeInfo().IsValueType)
Microsoft.Arcade.Test.Common (1)
AssertEx.cs (1)
30return !type.GetTypeInfo().IsValueType ||
Microsoft.AspNetCore.Components.Endpoints (3)
FormMapping\Metadata\FormDataMetadataFactory.cs (1)
141else if (!type.IsValueType)
src\Shared\PropertyHelper\PropertyHelper.cs (2)
218if (getMethod.DeclaringType!.IsValueType) 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType);
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
Binding\FormDataMapperTests.cs (1)
111Assert.Equal(type.IsValueType ? Activator.CreateInstance(type) : null, result);
Microsoft.AspNetCore.Components.Forms (1)
FieldIdentifier.cs (1)
48if (model.GetType().IsValueType)
Microsoft.AspNetCore.Components.Server (1)
BlazorPack\SequenceOfT.cs (1)
299private static readonly bool IsValueTypeElement = typeof(T).IsValueType;
Microsoft.AspNetCore.Connections.Abstractions (1)
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
38if (defaultValue == null && parameter.ParameterType.IsValueType
Microsoft.AspNetCore.Hosting (2)
GenericHost\GenericWebHostBuilder.cs (1)
286if (containerType.IsValueType && !RuntimeFeature.IsDynamicCodeSupported)
Internal\StartupLoader.cs (1)
72if (type.IsValueType && !RuntimeFeature.IsDynamicCodeSupported)
Microsoft.AspNetCore.Http.Abstractions (3)
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
38if (defaultValue == null && parameter.ParameterType.IsValueType
src\Shared\PropertyHelper\PropertyHelper.cs (2)
218if (getMethod.DeclaringType!.IsValueType) 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType);
Microsoft.AspNetCore.Http.Extensions (6)
RequestDelegateFactory.cs (3)
546if (returnType.IsValueType) 1214if (returnType.IsValueType) 1377if (allowEmptyRequestBody && bodyType.IsValueType)
src\Components\Endpoints\src\FormMapping\Metadata\FormDataMetadataFactory.cs (1)
141else if (!type.IsValueType)
src\Shared\Json\JsonSerializerExtensions.cs (1)
14=> jsonTypeInfo.Type.IsSealed || jsonTypeInfo.Type.IsValueType || jsonTypeInfo.PolymorphismOptions is not null;
src\Shared\ParameterBindingMethodCache.cs (1)
386if (type.IsValueType)
Microsoft.AspNetCore.Http.Results (1)
src\Shared\Json\JsonSerializerExtensions.cs (1)
14=> jsonTypeInfo.Type.IsSealed || jsonTypeInfo.Type.IsValueType || jsonTypeInfo.PolymorphismOptions is not null;
Microsoft.AspNetCore.JsonPatch (3)
Internal\ConversionResultProvider.cs (1)
83if (type.IsValueType)
Internal\DynamicObjectAdapter.cs (1)
68if (property.GetType().IsValueType
Internal\PocoAdapter.cs (1)
96if (jsonProperty.PropertyType.IsValueType
Microsoft.AspNetCore.Mvc.Abstractions (2)
ModelBinding\ModelMetadata.cs (1)
752IsReferenceOrNullableType = !ModelType.IsValueType || IsNullableValueType;
src\Shared\ParameterBindingMethodCache.cs (1)
386if (type.IsValueType)
Microsoft.AspNetCore.Mvc.Core (13)
Formatters\InputFormatter.cs (1)
30if (modelType.IsValueType)
Infrastructure\ParameterDefaultValues.cs (1)
30if (defaultValue == null && parameterInfo.ParameterType.IsValueType)
ModelBinding\Binders\ComplexObjectModelBinder.cs (1)
662if (propertyType.IsValueType)
ModelBinding\Binders\ComplexTypeModelBinder.cs (1)
432if (propertyType.IsValueType)
ModelBinding\Binders\ServicesModelBinderProvider.cs (1)
31!context.Metadata.ModelType.IsValueType &&
ModelBinding\Metadata\DefaultBindingMetadataProvider.cs (1)
82if (type.IsAbstract || type.IsValueType || type.IsInterface)
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (2)
281else if (parameterType.IsValueType) 375!containerType.IsValueType)
ModelBinding\ModelBindingHelper.cs (1)
618return type.IsValueType ? Activator.CreateInstance(type) : null;
src\Shared\Json\JsonSerializerExtensions.cs (1)
14=> jsonTypeInfo.Type.IsSealed || jsonTypeInfo.Type.IsValueType || jsonTypeInfo.PolymorphismOptions is not null;
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
38if (defaultValue == null && parameter.ParameterType.IsValueType
src\Shared\PropertyHelper\PropertyHelper.cs (2)
218if (getMethod.DeclaringType!.IsValueType) 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType);
Microsoft.AspNetCore.Mvc.Core.Test (5)
ApplicationModels\ActionModelTest.cs (1)
120else if (property.PropertyType.IsValueType ||
ApplicationModels\AttributeRouteModelTests.cs (1)
38else if (property.PropertyType.IsValueType ||
ApplicationModels\ControllerModelTest.cs (1)
122else if (property.PropertyType.IsValueType ||
ApplicationModels\ParameterModelTest.cs (1)
56else if (property.PropertyType.GetTypeInfo().IsValueType ||
ApplicationModels\PropertyModelTest.cs (1)
52else if (property.PropertyType.GetTypeInfo().IsValueType ||
Microsoft.AspNetCore.Mvc.DataAnnotations (1)
DataAnnotationsMetadataProvider.cs (1)
329!context.Key.ModelType.IsValueType &&
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\PageActionInvoker.cs (1)
237parameter.ParameterInfo.ParameterType.IsValueType)
Microsoft.AspNetCore.Mvc.RazorPages.Test (1)
Infrastructure\ExecutorFactoryTest.cs (1)
196else if (methodParameter.ParameterType.GetTypeInfo().IsValueType)
Microsoft.AspNetCore.Mvc.ViewFeatures (4)
CachedExpressionCompiler.cs (3)
216if (body.Type.IsValueType) 237var isNullableValueType = type.IsValueType && Nullable.GetUnderlyingType(type) != null; 238if (type.IsValueType && !isNullableValueType)
Filters\LifecycleProperty.cs (1)
21_isReferenceTypeOrNullable = !propertyType.IsValueType || Nullable.GetUnderlyingType(propertyType) != null;
Microsoft.AspNetCore.OpenApi (2)
Extensions\JsonNodeSchemaExtensions.cs (1)
431if (parameterInfo.ParameterType.IsValueType)
src\Shared\ParameterBindingMethodCache.cs (1)
386if (type.IsValueType)
Microsoft.AspNetCore.Routing (3)
src\Shared\Json\JsonSerializerExtensions.cs (1)
14=> jsonTypeInfo.Type.IsSealed || jsonTypeInfo.Type.IsValueType || jsonTypeInfo.PolymorphismOptions is not null;
src\Shared\PropertyHelper\PropertyHelper.cs (2)
218if (getMethod.DeclaringType!.IsValueType) 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType);
Microsoft.AspNetCore.Routing.Abstractions (2)
src\Shared\PropertyHelper\PropertyHelper.cs (2)
218if (getMethod.DeclaringType!.IsValueType) 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType);
Microsoft.AspNetCore.Shared.Tests (3)
src\Shared\ParameterDefaultValue\ParameterDefaultValue.cs (1)
38if (defaultValue == null && parameter.ParameterType.IsValueType
src\Shared\PropertyHelper\PropertyHelper.cs (2)
218if (getMethod.DeclaringType!.IsValueType) 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType);
Microsoft.AspNetCore.SignalR.Client.Core (1)
HubConnection.cs (1)
880if (!RuntimeFeature.IsDynamicCodeSupported && genericTypes[0].IsValueType)
Microsoft.AspNetCore.SignalR.Core (3)
Internal\HubMethodDescriptor.cs (2)
256if (streamReturnType.IsValueType) 297if (!RuntimeFeature.IsDynamicCodeSupported && streamType.IsValueType)
StreamTracker.cs (1)
35Debug.Assert(RuntimeFeature.IsDynamicCodeSupported || !itemType.IsValueType, "HubMethodDescriptor ensures itemType is not a ValueType when PublishAot=true.");
Microsoft.Build (8)
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupLoggingHelper.cs (1)
247else if (parameterValue.GetType().IsValueType)
Evaluation\Expander.cs (1)
3732args[i] = t.IsValueType ? Activator.CreateInstance(t) : null;
TaskParameter.cs (2)
145else if (wrappedParameterType.GetElementType().GetTypeInfo().IsValueType) 180else if (wrappedParameterType.GetTypeInfo().IsValueType)
TaskParameterTypeVerifier.cs (4)
24parameterType.GetTypeInfo().IsValueType || parameterType == typeof(string) || parameterType == typeof(ITaskItem); 31bool result = (parameterType.IsArray && parameterType.GetElementType().GetTypeInfo().IsValueType) || 52bool result = (parameterType.IsArray && parameterType.GetElementType().GetTypeInfo().IsValueType) || /* array of value types, or */ 54parameterType.GetTypeInfo().IsValueType || /* value type, or */
Microsoft.Build.BuildCheck.UnitTests (1)
EditorConfig_Tests.cs (1)
28return !type.GetTypeInfo().IsValueType ||
Microsoft.Build.Framework (4)
SegmentedDictionary`2.cs (3)
264else if (SupportsComparerDevirtualization && typeof(TValue).IsValueType) 345if (typeof(TKey).IsValueType) 493if (typeof(TKey).IsValueType)
TaskPropertyInfo.cs (1)
31IsValueTypeOutputParameter = elementType.GetTypeInfo().IsValueType || elementType.FullName.Equals("System.String");
Microsoft.CodeAnalysis (19)
Binding\BindingDiagnosticBag.cs (1)
67Debug.Assert(diagnosticBag?.GetType().IsValueType != true);
Compilation\Compilation.cs (1)
544return !(info.IsValueType || info.IsPointer || info.IsByRef || info.ContainsGenericParameters);
src\Dependencies\Collections\SegmentedDictionary`2.cs (12)
100if (!typeof(TKey).IsValueType) 327else if (SupportsComparerDevirtualization && typeof(TValue).IsValueType) 409&& typeof(TKey).IsValueType // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 522Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 523var hashCode = (uint)((SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null) ? key.GetHashCode() : comparer!.GetHashCode(key)); 530&& typeof(TKey).IsValueType // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 709Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 710var hashCode = (uint)(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? key.GetHashCode() : comparer!.GetHashCode(key)); 721(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? EqualityComparer<TKey>.Default.Equals(entry._key, key) : comparer!.Equals(entry._key, key))) 786Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 787var hashCode = (uint)(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? key.GetHashCode() : comparer!.GetHashCode(key)); 798(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? EqualityComparer<TKey>.Default.Equals(entry._key, key) : comparer!.Equals(entry._key, key)))
src\Dependencies\Collections\SegmentedHashSet`1.cs (5)
83if (!typeof(T).IsValueType) 231typeof(T).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 300Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 302SupportsComparerDevirtualization && typeof(T).IsValueType && comparer == null ? item!.GetHashCode() : 1033typeof(T).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types
Microsoft.CodeAnalysis.CodeStyle (17)
src\Dependencies\Collections\SegmentedDictionary`2.cs (12)
100if (!typeof(TKey).IsValueType) 327else if (SupportsComparerDevirtualization && typeof(TValue).IsValueType) 409&& typeof(TKey).IsValueType // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 522Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 523var hashCode = (uint)((SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null) ? key.GetHashCode() : comparer!.GetHashCode(key)); 530&& typeof(TKey).IsValueType // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 709Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 710var hashCode = (uint)(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? key.GetHashCode() : comparer!.GetHashCode(key)); 721(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? EqualityComparer<TKey>.Default.Equals(entry._key, key) : comparer!.Equals(entry._key, key))) 786Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 787var hashCode = (uint)(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? key.GetHashCode() : comparer!.GetHashCode(key)); 798(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? EqualityComparer<TKey>.Default.Equals(entry._key, key) : comparer!.Equals(entry._key, key)))
src\Dependencies\Collections\SegmentedHashSet`1.cs (5)
83if (!typeof(T).IsValueType) 231typeof(T).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 300Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 302SupportsComparerDevirtualization && typeof(T).IsValueType && comparer == null ? item!.GetHashCode() : 1033typeof(T).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types
Microsoft.CodeAnalysis.Collections.Package (17)
SegmentedDictionary`2.cs (12)
100if (!typeof(TKey).IsValueType) 327else if (SupportsComparerDevirtualization && typeof(TValue).IsValueType) 409&& typeof(TKey).IsValueType // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 522Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 523var hashCode = (uint)((SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null) ? key.GetHashCode() : comparer!.GetHashCode(key)); 530&& typeof(TKey).IsValueType // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 709Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 710var hashCode = (uint)(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? key.GetHashCode() : comparer!.GetHashCode(key)); 721(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? EqualityComparer<TKey>.Default.Equals(entry._key, key) : comparer!.Equals(entry._key, key))) 786Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 787var hashCode = (uint)(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? key.GetHashCode() : comparer!.GetHashCode(key)); 798(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? EqualityComparer<TKey>.Default.Equals(entry._key, key) : comparer!.Equals(entry._key, key)))
SegmentedHashSet`1.cs (5)
83if (!typeof(T).IsValueType) 231typeof(T).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 300Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 302SupportsComparerDevirtualization && typeof(T).IsValueType && comparer == null ? item!.GetHashCode() : 1033typeof(T).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (1)
Debugger\MemberInfo\TypeImpl.cs (1)
375return this.Type.IsValueType;
Microsoft.CodeAnalysis.Test.Utilities (5)
Assert\AssertEx.cs (1)
46return !type.GetTypeInfo().IsValueType ||
Assert\EqualityUtil`1.cs (4)
87if (typeof(T).GetTypeInfo().IsValueType) 119if (typeof(T).GetTypeInfo().IsValueType) 156if (typeof(T).GetTypeInfo().IsValueType) 217if (typeof(T).GetTypeInfo().IsValueType)
Microsoft.CodeAnalysis.UnitTests (7)
Collections\HashSet\SegmentedHashSet_Generic_Tests`1.cs (2)
448if (!typeof(T).IsValueType) 465if (!typeof(T).IsValueType)
Collections\ImmutablesTestBase.cs (4)
34if (typeof(T).GetTypeInfo().IsValueType) 65else if (first.GetType().IsValueType) 85else if (first.GetType().IsValueType) 106else if (first.GetType().IsValueType)
Collections\List\ICollection.Generic.Tests.cs (1)
353if (typeof(T).IsValueType || IsReadOnly || AddRemoveClear_ThrowsNotSupported)
Microsoft.CodeAnalysis.VisualBasic (1)
Preprocessor\ExpressionEvaluator.vb (1)
547If value.GetType().GetTypeInfo().IsValueType Then
Microsoft.CodeAnalysis.Workspaces (17)
src\Dependencies\Collections\SegmentedDictionary`2.cs (12)
100if (!typeof(TKey).IsValueType) 327else if (SupportsComparerDevirtualization && typeof(TValue).IsValueType) 409&& typeof(TKey).IsValueType // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 522Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 523var hashCode = (uint)((SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null) ? key.GetHashCode() : comparer!.GetHashCode(key)); 530&& typeof(TKey).IsValueType // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 709Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 710var hashCode = (uint)(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? key.GetHashCode() : comparer!.GetHashCode(key)); 721(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? EqualityComparer<TKey>.Default.Equals(entry._key, key) : comparer!.Equals(entry._key, key))) 786Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 787var hashCode = (uint)(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? key.GetHashCode() : comparer!.GetHashCode(key)); 798(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? EqualityComparer<TKey>.Default.Equals(entry._key, key) : comparer!.Equals(entry._key, key)))
src\Dependencies\Collections\SegmentedHashSet`1.cs (5)
83if (!typeof(T).IsValueType) 231typeof(T).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 300Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 302SupportsComparerDevirtualization && typeof(T).IsValueType && comparer == null ? item!.GetHashCode() : 1033typeof(T).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (17)
src\Dependencies\Collections\SegmentedDictionary`2.cs (12)
100if (!typeof(TKey).IsValueType) 327else if (SupportsComparerDevirtualization && typeof(TValue).IsValueType) 409&& typeof(TKey).IsValueType // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 522Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 523var hashCode = (uint)((SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null) ? key.GetHashCode() : comparer!.GetHashCode(key)); 530&& typeof(TKey).IsValueType // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 709Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 710var hashCode = (uint)(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? key.GetHashCode() : comparer!.GetHashCode(key)); 721(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? EqualityComparer<TKey>.Default.Equals(entry._key, key) : comparer!.Equals(entry._key, key))) 786Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 787var hashCode = (uint)(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? key.GetHashCode() : comparer!.GetHashCode(key)); 798(SupportsComparerDevirtualization && typeof(TKey).IsValueType && comparer == null ? EqualityComparer<TKey>.Default.Equals(entry._key, key) : comparer!.Equals(entry._key, key)))
src\Dependencies\Collections\SegmentedHashSet`1.cs (5)
83if (!typeof(T).IsValueType) 231typeof(T).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 300Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 302SupportsComparerDevirtualization && typeof(T).IsValueType && comparer == null ? item!.GetHashCode() : 1033typeof(T).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types
Microsoft.CSharp (5)
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (2)
271if (binding.Type.IsValueType && !action.ReturnType.IsValueType)
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (2)
709if (arguments[0].Type.IsValueType && callingObject is ExprCast) 1120if (argument.Type.IsValueType && callingObject is ExprCast)
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (1)
862else if (type.IsValueType)
Microsoft.DotNet.NuGetRepack.Tests (1)
TestHelpers\AssertEx.cs (1)
30return !type.GetTypeInfo().IsValueType ||
Microsoft.DotNet.SwaggerGenerator.CodeGenerator (1)
HelperFactory.cs (1)
283if (!output.IsValueType ||
Microsoft.Extensions.AI.Abstractions (6)
src\Shared\JsonSchemaExporter\JsonSchemaExporter.ReflectionHelpers.cs (2)
34public static bool CanBeNull(Type type) => !type.IsValueType || Nullable.GetUnderlyingType(type) is not null; 387if (useDefaultCtorInAnnotatedStructs && type.IsValueType && ctorWithAttribute == null)
src\Shared\JsonSchemaExporter\NullabilityInfoContext\NullabilityInfoContext.cs (4)
348if (underlyingType.IsValueType) 573return type.IsValueType ? 0 : 1; 628type.IsValueType || ((type.IsByRef || type.IsPointer) && type.GetElementType()!.IsValueType);
Microsoft.Extensions.Caching.Hybrid (3)
Internal\ImmutableTypeCache.cs (2)
57if (type.IsValueType) 66if (type.IsValueType || (type.IsClass & type.IsSealed))
Internal\ImmutableTypeCache.T.cs (1)
14public static readonly bool IsImmutable = (typeof(T).IsValueType && ImmutableTypeCache.IsBlittable<T>()) || ImmutableTypeCache.IsTypeImmutable(typeof(T));
Microsoft.Extensions.Configuration.Binder (4)
BindingPoint.cs (1)
48&& initialValueType.IsValueType
ConfigurationBinder.cs (2)
525type.IsValueType || constructors.Any(ctor => ctor.GetParameters().Length == 0); 527if (!type.IsValueType && constructors.Length == 0)
src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
34if (defaultValue == null && parameter.ParameterType.IsValueType
Microsoft.Extensions.DependencyInjection (12)
ServiceLookup\CallSiteFactory.cs (2)
275if (ServiceProvider.VerifyAotCompatibility && itemType.IsValueType) 640if (typeArg.IsValueType)
ServiceLookup\CallSiteRuntimeResolver.cs (1)
180Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !elementType.IsValueType, "VerifyAotCompatibility=true will throw during building the IEnumerableCallSite if elementType is a ValueType.");
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (4)
122Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !elementType.IsValueType, "VerifyAotCompatibility=true will throw during building the IEnumerableCallSite if elementType is a ValueType."); 131Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !elementType.IsValueType, "VerifyAotCompatibility=true will throw during building the IEnumerableCallSite if elementType is a ValueType."); 188if (callSite.ImplementationType!.IsValueType) 199&& (!expression.Type.IsValueType || !forceValueTypeConversion))
ServiceLookup\IEnumerableCallSite.cs (1)
18Debug.Assert(!ServiceProvider.VerifyAotCompatibility || !itemType.IsValueType, "If VerifyAotCompatibility=true, an IEnumerableCallSite should not be created with a ValueType.");
ServiceLookup\ILEmit\ILEmitResolverBuilder.cs (3)
156if (parameterCallSite.ServiceType.IsValueType) 163if (constructorCallSite.ImplementationType!.IsValueType) 233if (parameterCallSite.ServiceType.IsValueType)
src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
34if (defaultValue == null && parameter.ParameterType.IsValueType
Microsoft.Extensions.DependencyInjection.Abstractions (1)
src\libraries\Common\src\Extensions\ParameterDefaultValue\ParameterDefaultValue.cs (1)
34if (defaultValue == null && parameter.ParameterType.IsValueType
Microsoft.Extensions.Features (1)
FeatureCollection.cs (1)
123if (typeof(TFeature).IsValueType)
Microsoft.Extensions.Identity.Core (2)
IdentityBuilder.cs (2)
25if (user.IsValueType) 42if (role.IsValueType)
Microsoft.Extensions.Telemetry.Abstractions (2)
Logging\LoggerMessageHelper.cs (2)
116if (typeof(TKey).IsValueType || kvp.Key is not null) 129if (typeof(TValue).IsValueType || kvp.Value is not null)
Microsoft.Maui.Controls (7)
BindableProperty.cs (2)
92 if (defaultValue == null && Nullable.GetUnderlyingType(returnType) == null && returnType.IsValueType) 213 return !returnType.IsValueType || returnType.IsGenericType && returnType.GetGenericTypeDefinition() == typeof(Nullable<>);
BindingExpression.cs (1)
420 if (part.NextPart != null && propertyType.IsGenericType && propertyType.IsValueType)
BindingExpressionHelper.cs (1)
15 return !convertTo.GetTypeInfo().IsValueType || Nullable.GetUnderlyingType(convertTo) != null;
Command.cs (1)
59 return !t.IsValueType;
PlatformBindingHelpers.cs (1)
66 defaultValue = defaultValue ?? (propertyType.IsValueType ? Activator.CreateInstance(propertyType) : null);
TypeConversionHelper.cs (1)
24 return !targetType.IsValueType || targetType.IsGenericType && targetType.GetGenericTypeDefinition() == typeof(Nullable<>);
Microsoft.Maui.Controls.Xaml (8)
ApplyPropertiesVisitor.cs (4)
406 if (value != null && !value.GetType().IsValueType && XamlFilePathAttribute.GetFilePathForObject(rootElement) is string path) 414 if (value != null && !value.GetType().IsValueType && XamlFilePathAttribute.GetFilePathForObject(rootElement) is string path) 422 if (value != null && !value.GetType().IsValueType && XamlFilePathAttribute.GetFilePathForObject(rootElement) is string path) 611 if ((convertedValue == null && (!property.ReturnType.IsValueType || nullable)) ||
CreateValuesVisitor.cs (2)
172 if (assemblyName != null && value != null && !value.GetType().IsValueType && XamlFilePathAttribute.GetFilePathForObject(Context.RootElement) is string path) 191 if (rnode.Root != null && !rnode.Root.GetType().IsValueType && XamlFilePathAttribute.GetFilePathForObject(Context.RootElement) is string path)
MarkupExtensions\OnIdiomExtension.cs (1)
63 if (value == null && propertyType.IsValueType)
MarkupExtensions\OnPlatformExtension.cs (1)
83 if (propertyType.IsValueType)
Microsoft.ML.Core (1)
EntryPoints\EntryPointUtils.cs (1)
78equalToDefault = fieldType.IsValueType ? Activator.CreateInstance(fieldType).Equals(fieldVal) : fieldVal == null;
Microsoft.ML.EntryPoints (2)
JsonUtils\ExecuteGraphCommand.cs (2)
171if (ipmArray != null && !ipmArray.GetType().IsValueType) 178if (idvArray != null && !idvArray.GetType().IsValueType)
Microsoft.VisualBasic.Core (6)
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (2)
228If RValueBase AndAlso objType.IsValueType Then 722If RValueBase AndAlso o.GetType().IsValueType Then
Microsoft\VisualBasic\CompilerServices\NewLateBinding.vb (1)
948If RValueBase And Type.IsValueType Then
Microsoft\VisualBasic\CompilerServices\ObjectFlowControl.vb (1)
25If Expression IsNot Nothing AndAlso Expression.GetType.IsValueType() Then
Microsoft\VisualBasic\CompilerServices\VB6RandomFile.vb (2)
499ElseIf typ.IsValueType() AndAlso Not ContainedInVariant Then 502ElseIf ContainedInVariant AndAlso typ.IsValueType Then
MSBuild (6)
TaskParameter.cs (2)
145else if (wrappedParameterType.GetElementType().GetTypeInfo().IsValueType) 180else if (wrappedParameterType.GetTypeInfo().IsValueType)
TaskParameterTypeVerifier.cs (4)
24parameterType.GetTypeInfo().IsValueType || parameterType == typeof(string) || parameterType == typeof(ITaskItem); 31bool result = (parameterType.IsArray && parameterType.GetElementType().GetTypeInfo().IsValueType) || 52bool result = (parameterType.IsArray && parameterType.GetElementType().GetTypeInfo().IsValueType) || /* array of value types, or */ 54parameterType.GetTypeInfo().IsValueType || /* value type, or */
MSBuildTaskHost (7)
Concurrent\ConcurrentDictionary.cs (1)
67if (!valueType.IsValueType)
TaskParameter.cs (2)
145else if (wrappedParameterType.GetElementType().GetTypeInfo().IsValueType) 180else if (wrappedParameterType.GetTypeInfo().IsValueType)
TaskParameterTypeVerifier.cs (4)
24parameterType.GetTypeInfo().IsValueType || parameterType == typeof(string) || parameterType == typeof(ITaskItem); 31bool result = (parameterType.IsArray && parameterType.GetElementType().GetTypeInfo().IsValueType) || 52bool result = (parameterType.IsArray && parameterType.GetElementType().GetTypeInfo().IsValueType) || /* array of value types, or */ 54parameterType.GetTypeInfo().IsValueType || /* value type, or */
PresentationBuildTasks (2)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (2)
3011parentType.IsValueType)) 3288parentType.IsValueType))
PresentationCore (7)
MS\Internal\Ink\ExtendedProperty.cs (4)
57elementType1.IsValueType && 59elementType2.IsValueType && 181if (type.IsValueType || type == typeof(string)) 191if (elementType.IsValueType && type.GetArrayRank() == 1)
System\Windows\Diagnostics\XamlSourceInfoHelper.cs (1)
114if (obj is string || obj.GetType().IsValueType)
System\Windows\Media\Imaging\WriteableBitmap.cs (2)
394if (elementType == null || !elementType.IsValueType) 493if (elementType == null || !elementType.IsValueType)
PresentationFramework (14)
MS\Internal\Data\DefaultValueConverter.cs (3)
324(o == null && !destinationType.IsValueType))) 578if (o == null && !_sourceType.IsValueType) 620(o == null && !_targetType.IsValueType))
MS\Internal\Data\DynamicValueConverter.cs (2)
51if (!targetType.IsValueType) 76if (!sourceType.IsValueType)
MS\Internal\WeakHashtable.cs (2)
54Debug.Assert(!key.GetType().IsValueType, "WeakHashtable doesn't support value-type keys. Use WeakObjectHashtable instead."); 236if (tKey == typeof(Object) || tKey.IsValueType)
MS\Internal\WeakObjectHashtable.cs (1)
51if (key != null && !key.GetType().IsValueType)
MS\Internal\WindowsRuntime\Generated\WinRT\GuidGenerator.cs (1)
51if (type.IsValueType)
MS\Internal\WindowsRuntime\Generated\WinRT\Marshalers.cs (1)
1018else if (type.IsValueType || type == typeof(Type))
MS\Internal\WindowsRuntime\Generated\WinRT\Projections.cs (1)
159if (argumentCovariant && !genericArguments[i].IsValueType)
System\Windows\Automation\Peers\ItemAutomationPeer.cs (1)
657if (value != null && !value.GetType().IsValueType &&
System\Windows\Data\BindingExpressionBase.cs (1)
1610if (!type.IsValueType)
System\Windows\TemplateContent.cs (1)
1180(type != null && type.IsValueType))
Shared.Tests (2)
JsonSchemaExporter\JsonSchemaExporterTests.cs (2)
58Assert.True(!referenceType.IsValueType); 74Assert.True(referenceType.IsValueType);
System.Collections (9)
System\Collections\Generic\OrderedDictionary.cs (7)
121if (!typeof(TKey).IsValueType) 565if (typeof(TValue).IsValueType) 640if (typeof(TKey).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 824if (typeof(TKey).IsValueType && _comparer is null) 1063if (!typeof(TKey).IsValueType && 1078Debug.Assert(!forceNewHashCodes || !typeof(TKey).IsValueType, "Value types never rehash."); 1101if (!typeof(TKey).IsValueType && forceNewHashCodes)
System\Collections\Generic\PriorityQueue.cs (2)
890if (typeof(TElement).IsValueType && equalityComparer == EqualityComparer<TElement>.Default) 919if (typeof(TPriority).IsValueType)
System.Collections.Concurrent (15)
System\Collections\Concurrent\ConcurrentDictionary.cs (14)
200if (typeof(TKey).IsValueType) 303if (typeof(TKey).IsValueType) 323if (typeof(TKey).IsValueType) 527if (typeof(TKey).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 562if (typeof(TKey).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 675if (!typeof(TValue).IsValueType || ConcurrentDictionaryTypeProps<TValue>.IsWriteAtomic) 998if (!typeof(TValue).IsValueType || ConcurrentDictionaryTypeProps<TValue>.IsWriteAtomic) 1023if (!typeof(TKey).IsValueType) // this is only relevant to strings, and we can avoid this code for all value types 1047if (!typeof(TKey).IsValueType && 2303Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 2463if (!typeof(TValue).IsValueType || ConcurrentDictionaryTypeProps<TValue>.IsWriteAtomic) 2488if (!typeof(TKey).IsValueType) // this is only relevant to strings, and we can avoid this code for all value types 2518if (!typeof(TKey).IsValueType && 2693if (!typeof(T).IsValueType ||
System\Collections\Concurrent\PartitionerStatic.cs (1)
1647if (typeof(TSource).IsValueType)
System.Collections.Immutable (9)
System\Collections\Frozen\FrozenDictionary.cs (1)
123if (typeof(TKey).IsValueType && ReferenceEquals(comparer, EqualityComparer<TKey>.Default))
System\Collections\Frozen\FrozenSet.cs (1)
104if (typeof(T).IsValueType && ReferenceEquals(comparer, EqualityComparer<T>.Default))
System\Collections\Frozen\SmallValueTypeComparableFrozenDictionary.cs (1)
28Debug.Assert(typeof(TKey).IsValueType);
System\Collections\Frozen\SmallValueTypeComparableFrozenSet.cs (1)
27Debug.Assert(typeof(T).IsValueType);
System\Collections\Frozen\SmallValueTypeDefaultComparerFrozenDictionary.cs (1)
21Debug.Assert(typeof(TKey).IsValueType);
System\Collections\Frozen\SmallValueTypeDefaultComparerFrozenSet.cs (1)
19Debug.Assert(typeof(T).IsValueType);
System\Collections\Frozen\ValueTypeDefaultComparerFrozenDictionary.cs (1)
18Debug.Assert(typeof(TKey).IsValueType);
System\Collections\Frozen\ValueTypeDefaultComparerFrozenSet.cs (1)
15Debug.Assert(typeof(T).IsValueType);
System\Collections\Immutable\ImmutableExtensions.cs (1)
20return typeof(T).IsValueType;
System.ComponentModel.Annotations (3)
System\ComponentModel\DataAnnotations\CustomValidationAttribute.cs (1)
310if (expectedValueType.IsValueType
System\ComponentModel\DataAnnotations\EnumDataTypeAttribute.cs (1)
50if (!valueType.IsValueType && valueType != typeof(string))
System\ComponentModel\DataAnnotations\Validator.cs (1)
360return !destinationType.IsValueType ||
System.ComponentModel.Composition (9)
Microsoft\Internal\GenerationServices.cs (2)
250if (GenerationServices.IsBoxingRequiredForValue(value) && !elementType.IsValueType) 269return value.GetType().IsValueType;
System\ComponentModel\Composition\Hosting\CompositionServices.cs (1)
431else if (_containsNulls && _arrayType.IsValueType)
System\ComponentModel\Composition\MetadataViewGenerator.cs (2)
158if ((defaultAttribute.Value != null) && (defaultAttribute.Value.GetType().IsValueType)) 170IL.Emit(field.FieldType.IsValueType ? OpCodes.Unbox_Any : OpCodes.Castclass, field.FieldType);
System\ComponentModel\Composition\Primitives\ContractBasedImportDefinition.cs (1)
342if (metadataValueType.IsValueType)
System\ComponentModel\Composition\ReflectionModel\GenericServices.cs (3)
171if (type.IsValueType) 181if (!type.IsValueType && ((type.GetConstructor(Type.EmptyTypes) == null) || type.IsAbstract)) 191if (!type.IsValueType)
System.Configuration.ConfigurationManager (3)
System\Configuration\ConfigurationProperty.cs (2)
30else if (type.IsValueType) 321else if (Type.IsValueType)
System\Configuration\SettingsPropertyValue.cs (1)
128if (Property.PropertyType.IsValueType)
System.Data.Common (3)
System\Data\Common\DataStorage.cs (2)
462result = dataType.IsValueType; 465Debug.Assert(result == dataType.IsValueType, "typeCode mismatches dataType");
System\Data\DataRowExtensions.cs (1)
149if (typeof(T).IsValueType && default(T) == null)
System.Diagnostics.DiagnosticSource (4)
System\Diagnostics\DsesFilterAndTransform.cs (4)
782if (!RuntimeFeature.IsDynamicCodeSupported && elemType.IsValueType) 797if (!RuntimeFeature.IsDynamicCodeSupported && (propertyInfo.DeclaringType!.IsValueType || propertyInfo.PropertyType.IsValueType)) 802Type typedPropertyFetcher = type.IsValueType ?
System.Linq (5)
System\Linq\Contains.cs (1)
32if (typeof(TSource).IsValueType)
System\Linq\OfType.SpeedOpt.cs (1)
151if (!typeof(TResult).IsValueType && _source is IEnumerable<object> objectSource)
System\Linq\OrderedEnumerable.cs (3)
446Debug.Assert(typeof(TKey).IsValueType); 462Debug.Assert(typeof(TKey).IsValueType); 482if (typeof(TKey).IsValueType && _next is null && _comparer == Comparer<TKey>.Default)
System.Linq.AsyncEnumerable (3)
System\Linq\OrderBy.cs (3)
354if (typeof(TKey).IsValueType && _next is null && _comparer == Comparer<TKey>.Default) 364Debug.Assert(typeof(TKey).IsValueType); 380Debug.Assert(typeof(TKey).IsValueType);
System.Linq.Expressions (110)
System\Dynamic\DynamicMetaObject.cs (1)
82if (ct.IsValueType)
System\Dynamic\DynamicObject.cs (1)
595if (binder.ReturnType.IsValueType && Nullable.GetUnderlyingType(binder.ReturnType) == null)
System\Dynamic\Utils\TypeUtils.cs (18)
28if (type.IsValueType && !IsNullableType(type)) 46if (!type.IsValueType || IsNullableType(type)) 102public static bool IsNullableOrReferenceType(this Type type) => !type.IsValueType || IsNullableType(type); 247if (instanceType.IsValueType) 378if (source.IsValueType | dest.IsValueType) 582else if (IsContravariant(genericParameter) && (sourceArgument.IsValueType || destArgument.IsValueType)) 622if (left.IsValueType || right.IsValueType) 641if (left.IsInterface && !right.IsValueType) 646if (right.IsInterface && !left.IsValueType) 653if (!left.IsValueType && !right.IsValueType) 670Debug.Assert(left.IsValueType); 860source.IsValueType && (destination == typeof(object) || destination == typeof(ValueType)) || source.IsEnum && destination == typeof(Enum); 924return !dest.IsValueType && !src.IsValueType && dest.IsAssignableFrom(src);
System\Linq\Expressions\BinaryExpression.cs (6)
360method == null && !left.IsValueType && !right.IsValueType; 616if (method != null && method.ReturnType.IsValueType && !method.ReturnType.IsNullableType()) 648method.ReturnType.IsValueType && !method.ReturnType.IsNullableType()) 1387if (left.Type.IsValueType && !left.Type.IsNullableType()) 1426if (left.IsValueType && !left.IsNullableType())
System\Linq\Expressions\Common\ConstantCheck.cs (1)
84if (operandType.IsValueType && !operandType.IsNullableType())
System\Linq\Expressions\Compiler\BoundConstants.cs (1)
192if (type.IsValueType)
System\Linq\Expressions\Compiler\ILGen.cs (13)
100if (type.IsValueType) 147if (type.IsValueType) 165if (!type.IsValueType) 244if (type.IsValueType) 601if (typeFrom.IsValueType) 603Debug.Assert(!typeTo.IsValueType); 612il.Emit(typeTo.IsValueType ? OpCodes.Unbox_Any : OpCodes.Castclass, typeTo); 835if (typeTo.IsValueType) 846Debug.Assert(typeTo.IsValueType); 884Debug.Assert(nullableType.IsValueType); 893Debug.Assert(nullableType.IsValueType); 902Debug.Assert(nullableType.IsValueType); 1065if (type.IsValueType)
System\Linq\Expressions\Compiler\LambdaCompiler.Address.cs (2)
210Debug.Assert(type.IsValueType); 379Type instanceLocalType = type.IsValueType ? type.MakeByRefType() : type;
System\Linq\Expressions\Compiler\LambdaCompiler.Binary.cs (1)
152Debug.Assert(leftType.IsPrimitive || (op == ExpressionType.Equal || op == ExpressionType.NotEqual) && (!leftType.IsValueType || leftType.IsEnum));
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (18)
381if (obj != null && obj.Type.IsValueType) 405if (callOp == OpCodes.Callvirt && objectType!.IsValueType) 459if (callOp == OpCodes.Callvirt && objectType!.IsValueType) 492if (mi.DeclaringType!.IsValueType) 636Debug.Assert(node.Type.IsValueType, "Only value type may have constructor not set."); 681Debug.Assert(!type.IsValueType); 692if (type.IsValueType) 882Debug.Assert(type!.IsValueType); 886else if (type.IsValueType) 974if (binding.Member is PropertyInfo && type.IsValueType) 978if (type.IsValueType) 992if (binding.Member is PropertyInfo && type.IsValueType) 996if (type.IsValueType) 1011if (init.NewExpression.Type.IsValueType && init.Bindings.Count > 0) 1055if (init.NewExpression.Type.IsValueType) 1149if (!arg.Type.IsValueType) 1171if (resultType.IsValueType) 1239if (!arg.Type.IsValueType)
System\Linq\Expressions\Compiler\LambdaCompiler.Logical.cs (5)
97Debug.Assert(!b.Left.Type.IsValueType); 216if (b.Right.Type.IsValueType) 226Debug.Assert(!b.Left.Type.IsValueType); 530Debug.Assert(!node.Right.Type.IsValueType); 544Debug.Assert(!node.Left.Type.IsValueType);
System\Linq\Expressions\Compiler\LambdaCompiler.Unary.cs (4)
222if (operandType.IsValueType) 274Debug.Assert(node.Type.IsValueType); 306if (node.IsLifted && (!node.Type.IsValueType || !node.Operand.Type.IsValueType))
System\Linq\Expressions\Compiler\StackSpiller.Bindings.cs (3)
49if (_binding.Member is PropertyInfo property && property.PropertyType.IsValueType) 113if (memberTemp.Type.IsValueType) 199if (memberTemp.Type.IsValueType)
System\Linq\Expressions\Compiler\StackSpiller.cs (1)
1101return instance != null && instance.Type.IsValueType && instance.Type.GetTypeCode() == TypeCode.Object;
System\Linq\Expressions\ConstantExpression.cs (1)
106if (!type.IsValueType || type.IsNullableType())
System\Linq\Expressions\ExpressionVisitor.cs (2)
688if (before.IsValueType) 696else if (!after.IsValueType)
System\Linq\Expressions\Interpreter\CallInstruction.cs (1)
54if (!info.IsStatic && info.DeclaringType!.IsValueType)
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (3)
49if (t != typeof(object) && (IndexIsNotReturnType(0, target, pi) || t.IsValueType)) 93if (t != typeof(object) && (IndexIsNotReturnType(1, target, pi) || t.IsValueType)) 138if (t.IsValueType) goto default;
System\Linq\Expressions\Interpreter\DefaultValueInstruction.cs (1)
17Debug.Assert(type.IsValueType);
System\Linq\Expressions\Interpreter\InstructionList.cs (2)
352if (type == null || type.IsValueType) 582else if (type.IsValueType)
System\Linq\Expressions\Interpreter\LightCompiler.cs (14)
448return type.IsValueType && !type.IsEnum && !type.IsPrimitive; 979Debug.Assert(IsNullComparison(left, right) || left.Type == right.Type || !left.Type.IsValueType && !right.Type.IsValueType); 989Debug.Assert(IsNullComparison(left, right) || left.Type == right.Type || !left.Type.IsValueType && !right.Type.IsValueType); 1069if (!operandType.IsValueType || operandType.IsNullableType() && node.IsLiftedToNull) 1122if (typeFrom.IsValueType && 1130if (typeTo.IsValueType && 2226if (node.Type.IsValueType) 2426Debug.Assert(type.IsValueType); 2631else if (node.Right.Type.IsValueType && !TypeUtils.AreEquivalent(node.Type, node.Right.Type)) 2746if (memberMember.Member is PropertyInfo && type.IsValueType) 2892if (node.Type.IsValueType && !node.Type.IsNullableType()) 2952if (node.TypeOperand.IsValueType)
System\Linq\Expressions\Interpreter\LocalAccess.cs (2)
377Debug.Assert(type.IsValueType, "MutableValue only supports value types."); 416Debug.Assert(type.IsValueType, "MutableBox only supports value types.");
System\Linq\Expressions\Interpreter\TypeOperations.cs (2)
153Debug.Assert(mi.ReturnType.IsValueType, "Nullable is only allowed on value types."); 288if (t.IsValueType && !t.IsNullableType())
System\Linq\Expressions\NewExpression.cs (1)
212if (!type.IsValueType)
System\Linq\Expressions\TypeBinaryExpression.cs (1)
53if (cType.IsValueType || TypeOperand.IsPointer)
System\Linq\Expressions\UnaryExpression.cs (5)
372if (method != null && method.ReturnType.IsValueType && !method.ReturnType.IsNullableType()) 395method.ReturnType.IsValueType && !method.ReturnType.IsNullableType()) 695if (type.IsValueType && !type.IsNullableType()) 717if (!type.IsValueType) throw Error.InvalidUnboxType(nameof(type)); 887if (value.Type.IsValueType) throw Error.ArgumentMustNotHaveValueType(nameof(value));
System.Linq.Parallel (1)
System\Linq\Parallel\Scheduling\Scheduling.cs (1)
76if (typeof(T).IsValueType)
System.Numerics.Tensors (3)
System\Numerics\Tensors\netcore\ReadOnlyTensorSpan.cs (1)
85if (!typeof(T).IsValueType && array.GetType() != typeof(T[]))
System\Numerics\Tensors\netcore\TensorPrimitives.HammingDistance.cs (1)
176else if (typeof(T).IsValueType)
System\Numerics\Tensors\netcore\TensorSpan.cs (1)
87if (!typeof(T).IsValueType && array.GetType() != typeof(T[]))
System.Private.CoreLib (106)
src\libraries\System.Private.CoreLib\src\System\Array.cs (2)
1086if (!typeof(T).IsValueType && array.GetType() != typeof(T[])) 1116if (!typeof(T).IsValueType && array.GetType() != typeof(T[]))
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (20)
65if (!typeof(TKey).IsValueType) 313else if (typeof(TValue).IsValueType) 409if (typeof(TKey).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 525Debug.Assert(comparer is not null || typeof(TKey).IsValueType); 526uint hashCode = (uint)((typeof(TKey).IsValueType && comparer == null) ? key.GetHashCode() : comparer!.GetHashCode(key)); 532if (typeof(TKey).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 628if (!typeof(TKey).IsValueType && collisionCount > HashHelpers.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer) 1038if (!typeof(TKey).IsValueType && collisionCount > HashHelpers.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer) 1090Debug.Assert(comparer is not null || typeof(TKey).IsValueType); 1091uint hashCode = (uint)((typeof(TKey).IsValueType && comparer == null) ? key.GetHashCode() : comparer!.GetHashCode(key)); 1097if (typeof(TKey).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 1175if (!typeof(TKey).IsValueType && collisionCount > HashHelpers.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer) 1250Debug.Assert(!forceNewHashCodes || !typeof(TKey).IsValueType); 1259if (!typeof(TKey).IsValueType && forceNewHashCodes) 1308Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 1309uint hashCode = (uint)(typeof(TKey).IsValueType && comparer == null ? key.GetHashCode() : comparer!.GetHashCode(key)); 1320(typeof(TKey).IsValueType && comparer == null ? EqualityComparer<TKey>.Default.Equals(entry.key, key) : comparer!.Equals(entry.key, key))) 1381Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 1382uint hashCode = (uint)(typeof(TKey).IsValueType && comparer == null ? key.GetHashCode() : comparer!.GetHashCode(key)); 1393(typeof(TKey).IsValueType && comparer == null ? EqualityComparer<TKey>.Default.Equals(entry.key, key) : comparer!.Equals(entry.key, key)))
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (9)
64if (!typeof(T).IsValueType) 230if (typeof(T).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 303Debug.Assert(typeof(T).IsValueType || comparer is not null); 305typeof(T).IsValueType && comparer == null ? item!.GetHashCode() : 528if (!typeof(T).IsValueType && collisionCount > HashHelpers.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer) 1289Debug.Assert(!forceNewHashCodes || !typeof(T).IsValueType); 1298if (!typeof(T).IsValueType && forceNewHashCodes) 1428if (typeof(T).IsValueType && // comparer can only be null for value types; enable JIT to eliminate entire if block for ref types 1511if (!typeof(T).IsValueType && collisionCount > HashHelpers.HashCollisionThreshold && comparer is NonRandomizedStringEqualityComparer)
src\libraries\System.Private.CoreLib\src\System\Convert.cs (1)
235if (conversionType.IsValueType)
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (1)
2124|| (arg == null && (pType.IsValueType && !(pType.IsGenericType && pType.GetGenericTypeDefinition() == typeof(Nullable<>))))
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\PropertyValue.cs (2)
160if (property.DeclaringType!.IsValueType) 220if (!type.IsValueType)
src\libraries\System.Private.CoreLib\src\System\Memory.cs (3)
44if (!typeof(T).IsValueType && array.GetType() != typeof(T[])) 62if (!typeof(T).IsValueType && array.GetType() != typeof(T[])) 94if (!typeof(T).IsValueType && array.GetType() != typeof(T[]))
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (20)
33if (!typeof(T).IsValueType && array.GetType() != typeof(T[])) 55if (!typeof(T).IsValueType && array.GetType() != typeof(T[])) 82if (!typeof(T).IsValueType && array.GetType() != typeof(T[])) 855if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default)) 971if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default)) 1081if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default)) 1433if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default)) 1549if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default)) 1659if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default)) 2222if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default)) 2422if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default)) 2674if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default)) 2777if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default)) 3094if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default)) 3198if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default)) 3461if (typeof(T).IsValueType) 4488if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default)) 4687if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default)) 4833if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default)) 5324if (typeof(T).IsValueType && (comparer is null || comparer == EqualityComparer<T>.Default))
src\libraries\System.Private.CoreLib\src\System\Numerics\IBinaryInteger.cs (3)
28if (!typeof(TSelf).IsValueType) 140if (!typeof(TSelf).IsValueType) 155if (!typeof(TSelf).IsValueType)
src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilderInstantiation.cs (1)
237protected override bool IsValueTypeImpl() { return _genericType.IsValueType; }
src\libraries\System.Private.CoreLib\src\System\Reflection\FieldAccessor.cs (2)
56else if (fieldType.IsValueType) 98else if (fieldType.IsValueType)
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokerEmitUtil.cs (10)
42if (method.DeclaringType!.IsValueType) 74else if (parameterType.IsValueType) 110if (method.DeclaringType!.IsValueType) 131else if (parameterType.IsValueType) 167if (method.DeclaringType!.IsValueType) 203Debug.Assert(parameterType.IsValueType); 227else if (method.IsStatic || method.DeclaringType!.IsValueType) 240if (returnType.IsValueType) 262else if (returnType.IsValueType) 287if (elementType.IsValueType)
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (1)
397if (sigElementType.IsValueType)
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedType.cs (1)
178protected override bool IsValueTypeImpl() => _unmodifiedType.IsValueType;
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (4)
362if (underlyingType.IsValueType) 593return type.IsValueType ? 0 : 1; 646type.IsValueType || ((type.IsByRef || type.IsPointer) && type.GetElementType()!.IsValueType);
src\libraries\System.Private.CoreLib\src\System\Reflection\TypeDelegator.cs (1)
150protected override bool IsValueTypeImpl() => typeImpl.IsValueType;
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (1)
609if (!typeof(T).IsValueType && array.GetType() != typeof(T[]))
src\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (1)
907Debug.Assert(type.IsValueType);
src\libraries\System.Private.CoreLib\src\System\Span.cs (2)
46if (!typeof(T).IsValueType && array.GetType() != typeof(T[])) 75if (!typeof(T).IsValueType && array.GetType() != typeof(T[]))
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.T.cs (2)
616if (typeof(T).IsValueType) 1012if (typeof(T).IsValueType)
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (1)
976else if (typeof(T).IsValueType && default(T) is ISpanFormattable)
src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (1)
36if (typeof(T).IsValueType && value is null)
src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs (2)
246if (!typeof(T).IsValueType) 498if (!typeof(T).IsValueType)
src\libraries\System.Private.CoreLib\src\System\Type.cs (1)
102public bool IsClass => (GetAttributeFlagsImpl() & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Class && !IsValueType;
src\libraries\System.Private.CoreLib\src\System\TypedReference.cs (2)
45if (i < (flds.Length - 1) && !fieldType.IsValueType) 56Debug.Assert(targetType.IsValueType);
src\System\Reflection\Emit\CustomAttributeBuilder.cs (3)
106if (paramTypes[i].IsValueType) 138if (propertyValue == null && propType.IsValueType) 194if (fieldValue == null && fldType.IsValueType)
src\System\Reflection\Emit\RuntimeFieldBuilder.cs (1)
143if (defaultValue == null && m_fieldType.IsValueType)
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (1)
1571if (m_constructorCount == 0 && ((m_iAttr & TypeAttributes.Interface) == 0) && !IsValueType && ((m_iAttr & (TypeAttributes.Abstract | TypeAttributes.Sealed)) != (TypeAttributes.Abstract | TypeAttributes.Sealed)))
src\System\Reflection\Emit\SignatureHelper.cs (3)
359if (clsArgument.IsValueType) 382if (clsArgument.IsValueType) 451else if (clsArgument.IsValueType)
src\System\RuntimeType.ActivatorCache.cs (2)
101if (rt.IsValueType) 147Debug.Assert(_originalRuntimeType.IsValueType);
src\System\RuntimeType.CoreCLR.cs (2)
3863&& (IsGenericCOMObjectImpl() || IsValueType)) 4025Debug.Assert(IsValueType);
System.Private.DataContractSerialization (57)
System\Runtime\Serialization\AccessorBuilder.cs (6)
69if (RuntimeFeature.IsDynamicCodeSupported || (!declaringType.IsValueType && !propertyType.IsValueType)) 126if (RuntimeFeature.IsDynamicCodeSupported || (!declaringType.IsValueType && !propertyType.IsValueType)) 167if (typeof(DeclaringType).IsValueType) 190if (typeof(DeclaringType).IsValueType)
System\Runtime\Serialization\ClassDataContract.cs (6)
345if (type.IsValueType) 645IsValueType = type.IsValueType; 781if (isReference && type.IsValueType) 965if (CollectionDataContract.IsCollection(memberContract.MemberType, false /*isConstructorRequired*/, skipIfReadOnlyContract) && !memberContract.MemberType.IsValueType) 1262if (type.IsValueType) 1505if (type.IsValueType && !IsNonAttributedType)
System\Runtime\Serialization\CodeGenerator.cs (10)
319if ((typeCode == TypeCode.Object && type.IsValueType) || 494if (methodInfo.IsVirtual && !methodInfo.DeclaringType!.IsValueType) 568return objType.IsValueType && !objType.IsPrimitive; 633if (type.IsValueType) 897if (localBuilder.LocalType.IsValueType) 920if (argBuilder.ArgType.IsValueType) 1154if (target.IsValueType) 1156if (source.IsValueType) 1177if (source.IsValueType) 1309if (type.IsValueType)
System\Runtime\Serialization\CollectionDataContract.cs (1)
1104if (!type.IsValueType)
System\Runtime\Serialization\DataContract.cs (2)
946_isValueType = type.IsValueType; 1925return !type.IsValueType ||
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (9)
213if (type.IsValueType) 479if ((primitiveContract != null && primitiveContract.UnderlyingType != Globals.TypeOfObject) || nullables != 0 || type.IsValueType) 492else if (type.IsValueType) 506if (type.IsValueType) 522if (!type.IsValueType) 531if (type.IsValueType) 632if (type.IsValueType) 841if (!type.IsValueType) 859if (!type.IsValueType)
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (2)
515if (type.IsValueType) 637if (memberType.IsValueType && !isNullableOfT)
System\Runtime\Serialization\PrimitiveDataContract.cs (2)
69if (UnderlyingType.IsValueType) 85if (UnderlyingType.IsValueType)
System\Runtime\Serialization\ReflectionClassWriter.cs (2)
51if (memberType.IsValueType && !originValueIsNullableOfT) 96|| (originValueIsNullableOfT && memberType.IsValueType)))
System\Runtime\Serialization\ReflectionReader.cs (4)
263if ((primitiveContract != null && primitiveContract.UnderlyingType != Globals.TypeOfObject) || nullables != 0 || type.IsValueType) 282bool typeIsValueType = type.IsValueType; 355if ((primitiveContract != null && primitiveContract.UnderlyingType != Globals.TypeOfObject) || nullables != 0 || type.IsValueType) 496if (collectionContract.UnderlyingType.IsValueType)
System\Runtime\Serialization\XmlDataContract.cs (3)
249if (UnderlyingType.IsValueType) 291if (type.IsValueType) 364if (type.IsValueType)
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (8)
257if (type.IsValueType && !classContract.IsNonAttributedType) 269if (type.IsValueType) 516if ((primitiveContract != null && primitiveContract.UnderlyingType != Globals.TypeOfObject) || nullables != 0 || type.IsValueType) 529else if (type.IsValueType) 543if (type.IsValueType) 559if (!type.IsValueType) 568if (type.IsValueType) 670if (type.IsValueType)
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (2)
548if (type.IsValueType) 650if (memberType.IsValueType && !isNullableOfT)
System.Private.Windows.Core (5)
System\Private\Windows\BinaryFormat\Deserializer\ClassRecordFieldInfoDeserializer.cs (1)
33_isValueType = type.IsValueType;
System\Private\Windows\BinaryFormat\Deserializer\ObjectRecordDeserializer.cs (1)
94|| (Deserializer.IncompleteObjects.Contains(valueRecord) && value.GetType().IsValueType));
System\Private\Windows\BinaryFormat\Deserializer\PendingSerializationInfo.cs (1)
51if (!type.IsValueType && !ReferenceEquals(populated, @object))
System\Value.cs (1)
743else if (typeof(T).IsValueType)
Windows\Win32\System\Variant\VARIANT.cs (1)
239if (t is null || !t.IsValueType)
System.Private.Xml (28)
System\Xml\Serialization\CodeGenerator.cs (10)
308Debug.Assert(ICollection_get_Count.IsVirtual && !ICollection_get_Count.DeclaringType!.IsValueType); 309if (varType.IsValueType) 403if (methodInfo.IsVirtual && !methodInfo.DeclaringType!.IsValueType) 482return objType.IsValueType && !objType.IsPrimitive; 488if (GetVariableType(obj).IsValueType) 917if (localBuilder.LocalType.IsValueType) 966if (argBuilder.ArgType.IsValueType) 1194if (target.IsValueType) 1196if (source.IsValueType) 1221if (source.IsValueType)
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (3)
615if (type.IsValueType || !RuntimeFeature.IsDynamicCodeSupported) 1325type.IsValueType ? null : 2061Debug.Assert(!typeof(TObj).IsValueType);
System\Xml\Serialization\SourceInfo.cs (2)
88if (eType.IsValueType) 149if (varType.IsValueType)
System\Xml\Serialization\TypeExtensions.cs (1)
25return !targetType.IsValueType;
System\Xml\Serialization\Types.cs (2)
777if (!type.IsValueType) 832else if (type.IsValueType)
System\Xml\Serialization\XmlSerializationReader.cs (2)
1662if (elementType.IsValueType) 1722if (currItemType.IsValueType)
System\Xml\Serialization\XmlSerializationReaderILGen.cs (2)
2738if (CodeGenerator.IsNullableGenericType(arrayElementType) || arrayElementType.IsValueType) 2804if (CodeGenerator.IsNullableGenericType(arrayElementType) || arrayElementType.IsValueType)
System\Xml\Serialization\XmlSerializationWriterILGen.cs (2)
2184Debug.Assert(!local.LocalType.IsValueType); 2366Debug.Assert(type.IsValueType);
System\Xml\Xsl\IlGen\GenerateHelper.cs (2)
893if (clrTypeSrc.IsValueType) 899else if (clrTypeDst.IsValueType)
System\Xml\Xsl\IlGen\XmlIlVisitor.cs (1)
3722else if (ndName.NamespaceUri.Length != 0 && !clrTypeRetSrc.IsValueType)
System\Xml\Xsl\ListBase.cs (1)
196if ((value == null && !typeof(T).IsValueType) || (value is T))
System.Reflection.Context (2)
System\Reflection\Context\CollectionServices.cs (1)
41if (arrayType.HasElementType || arrayType.IsValueType || arrayType.ContainsGenericParameters)
System\Reflection\Context\Delegation\DelegatingType.cs (1)
295return _typeInfo.IsValueType;
System.Reflection.DispatchProxy (3)
System\Reflection\DispatchProxyGenerator.cs (3)
635if (target.IsValueType) 637if (source.IsValueType) 653if (source.IsValueType || source.IsGenericParameter)
System.Reflection.Emit (3)
System\Reflection\Emit\SignatureHelper.cs (2)
199module.GetTypeHandle(type.GetGenericTypeDefinition()), genericArguments.Length, type.IsValueType); 292signature.Type(typeHandle, type.IsValueType);
System\Reflection\Emit\TypeBuilderImpl.cs (1)
115if (_constructorDefinitions.Count == 0 && (_attributes & TypeAttributes.Interface) == 0 && !IsValueType &&
System.Reflection.MetadataLoadContext (1)
System\Reflection\TypeLoading\Types\RoModifiedType.cs (1)
122protected sealed override bool IsValueTypeImpl() => _unmodifiedType.IsValueType;
System.Resources.Extensions (3)
System\Resources\Extensions\BinaryFormat\Deserializer\ClassRecordFieldInfoDeserializer.cs (1)
38_isValueType = type.IsValueType;
System\Resources\Extensions\BinaryFormat\Deserializer\ObjectRecordDeserializer.cs (1)
93|| (Deserializer.IncompleteObjects.Contains(valueRecord) && value.GetType().IsValueType));
System\Resources\Extensions\BinaryFormat\Deserializer\PendingSerializationInfo.cs (1)
53if (!type.IsValueType && !ReferenceEquals(populated, @object))
System.Runtime.Serialization.Formatters (4)
System\Runtime\Serialization\Formatter.cs (1)
160else if (varType.IsValueType)
System\Runtime\Serialization\ObjectManager.cs (2)
1064if (idOfContainingObj != 0 && ((field != null && field.FieldType.IsValueType) || arrayIndex != null)) 1211if (idOfContainer != 0 && ((field != null && field.FieldType.IsValueType) || arrayIndex != null))
System\Runtime\Serialization\ValueTypeFixupInfo.cs (1)
56if (member.FieldType.IsValueType && containerID == 0)
System.Runtime.Serialization.Schema (2)
System\Runtime\Serialization\Schema\CodeExporter.cs (1)
555xmlContract.IsValueType = type.IsValueType;
System\Runtime\Serialization\Schema\SchemaImportHelper.cs (1)
61return !type.IsValueType ||
System.Text.Json (35)
src\libraries\System.Text.Json\Common\ReflectionExtensions.cs (1)
278if (useDefaultCtorInAnnotatedStructs && type.IsValueType && ctorWithAttribute == null)
System\ReflectionExtensions.cs (1)
24public static bool IsNullableType(this Type type) => !type.IsValueType || IsNullableOfT(type);
System\Text\Json\Serialization\Converters\Collection\MemoryConverterFactory.cs (1)
15if (!typeToConvert.IsGenericType || !typeToConvert.IsValueType)
System\Text\Json\Serialization\Converters\Value\NullableConverterFactory.cs (3)
27if (!valueConverter.Type!.IsValueType && valueTypeToConvert.IsValueType) 37Debug.Assert(valueTypeToConvert.IsValueType && !valueTypeToConvert.IsNullableOfT());
System\Text\Json\Serialization\JsonConverterOfT.cs (3)
22IsValueType = typeof(T).IsValueType; 214!typeof(T).IsValueType && 368!typeof(T).IsValueType &&
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (1)
518Debug.Assert(!typeof(T).IsValueType);
System\Text\Json\Serialization\JsonSerializerOptions.Converters.cs (1)
107if (propertyType.IsValueType && converter.IsValueType &&
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (3)
480this is { DeclaringType.IsValueType: false, IsIgnored: false, IsExtensionData: false } && 639(!PropertyType.IsValueType || Set != null) && 657if (PropertyType.IsValueType && Set == null)
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (2)
177!typeof(T).IsValueType && // treated as a constant by recent versions of the JIT. 340if (typeof(T).IsValueType || !populatedValue)
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.WriteHelpers.cs (3)
41!typeof(T).IsValueType && 136!typeof(T).IsValueType && 283!typeof(T).IsValueType &&
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (14)
31if (constructorInfo is null && !type.IsValueType) 47Debug.Assert(type.IsValueType); 59if (type.IsValueType) 248if (declaringType.IsValueType) 262if (declaredPropertyType != runtimePropertyType && declaredPropertyType.IsValueType) 266Debug.Assert(!runtimePropertyType.IsValueType); 293generator.Emit(declaringType.IsValueType ? OpCodes.Unbox : OpCodes.Castclass, declaringType); 299if (declaredPropertyType != runtimePropertyType && declaredPropertyType.IsValueType) 303Debug.Assert(!runtimePropertyType.IsValueType); 308generator.Emit(declaringType.IsValueType ? OpCodes.Call : OpCodes.Callvirt, realMethod); 329declaringType.IsValueType 338if (declaredFieldType.IsValueType && declaredFieldType != runtimeFieldType) 362generator.Emit(declaringType.IsValueType ? OpCodes.Unbox : OpCodes.Castclass, declaringType); 368if (declaredFieldType != runtimeFieldType && declaredFieldType.IsValueType)
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (1)
31return type.IsValueType
System\Text\Json\Serialization\WriteStack.cs (1)
167rootValueBoxed is not null && jsonTypeInfo.Type.IsValueType)
System.Windows.Forms (11)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (1)
432if (!isImmutable && !(PropertyType?.IsValueType ?? false))
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MergePropertyDescriptor.cs (1)
119if (type.IsValueType)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiPropertyDescriptorGridEntry.cs (2)
119if (_mergedDescriptor.PropertyType.IsValueType || EntryFlags.HasFlag(Flags.Immutable)) 153=> _mergedDescriptor.PropertyType.IsValueType || EntryFlags.HasFlag(Flags.Immutable)
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.cs (4)
85|| (owner.GetType().IsValueType && owner.GetType() == entry.PropertyValue?.GetType())) 254if (propertyType is not null && (propertyType.IsArray || propertyType.IsValueType || propertyType.IsPrimitive)) 367bool isValueType = owner?.GetType().IsValueType ?? false; 743treatAsValueType = propertyType.IsValueType || propertyType.IsArray;
System\Windows\Forms\DataBinding\BindingSource.cs (1)
1477if (value is null && _itemType!.IsValueType)
System\Windows\Forms\Internal\Formatter.cs (2)
70if (oldTargetType.IsValueType && result is null && !isNullableTargetType) 540return (type is not null && !type.IsValueType)
System.Windows.Forms.Design (3)
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (2)
113if (!type.IsValueType) 304if (type.IsValueType)
System\ComponentModel\Design\Serialization\PropertyMemberCodeDomSerializer.cs (1)
60if (propertyValue is not null and not Type && (!propertyValue.GetType().IsValueType))
System.Windows.Forms.Primitives (1)
System\Windows\Forms\Automation\UiaTextRange.cs (1)
700if (value?.GetType() is { } type && type.IsValueType && !type.IsPrimitive && !type.IsEnum)
System.Xaml (10)
System\Xaml\Runtime\DynamicMethodRuntime.cs (3)
502OpCode callType = (method.IsStatic || method.DeclaringType.IsValueType) ? OpCodes.Call : OpCodes.Callvirt; 508if (toType.IsValueType) 520if (type.IsValueType)
System\Xaml\Schema\XamlTypeInvoker.cs (1)
129if (!_xamlType.UnderlyingType.IsValueType && (arguments is null || arguments.Length == 0))
System\Xaml\XamlObjectReader.cs (3)
1257else if (valueType.IsValueType) 1284if (parameterInfo.ParameterType.IsValueType) 1698if (member is null && !valueXamlType.UnderlyingType.IsValueType)
System\Xaml\XamlType.cs (3)
789if (underlyingType.IsValueType) 897if (underlyingType.IsValueType) 936return !UnderlyingType.IsValueType || IsNullableGeneric();
UIAutomationClient (2)
System\Windows\Automation\ItemContainerPattern.cs (1)
138((value == null && expectedType.IsValueType)
System\Windows\Automation\PropertyCondition.cs (1)
136((val == null && expectedType.IsValueType)
xunit.assert (1)
Sdk\ArgumentFormatter.cs (1)
257 if (typeInfo.IsValueType)