7 overrides of IsValueType
Microsoft.CodeAnalysis.CSharp (7)
Symbols\ArrayTypeSymbol.cs (1)
230public override bool IsValueType
Symbols\DynamicTypeSymbol.cs (1)
101public override bool IsValueType
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (1)
74public override bool IsValueType => true;
Symbols\FunctionTypeSymbol.cs (1)
100public override bool IsValueType => false;
Symbols\NamedTypeSymbol.cs (1)
399public override bool IsValueType
Symbols\PointerTypeSymbol.cs (1)
101public override bool IsValueType
Symbols\TypeParameterSymbol.cs (1)
581public sealed override bool IsValueType
117 references to IsValueType
Microsoft.CodeAnalysis.CSharp (117)
Binder\Binder.ValueChecks.cs (5)
676Debug.Assert(!checkingReceiver || expr.Type.IsValueType || expr.Type.IsTypeParameter()); 836var isValueType = ((BoundThisReference)expr).Type.IsValueType; 1628&& receiver?.Type?.IsValueType == true; 3631Debug.Assert(!checkingReceiver || expr.Type.IsValueType || expr.Type.IsTypeParameter()); 4709Debug.Assert(!checkingReceiver || expr.Type.IsValueType || expr.Type.IsTypeParameter());
Binder\Binder_Expressions.cs (7)
1404|| (typeWithAnnotations.NullableAnnotation.IsAnnotated() && !type.IsValueType) 5873if (isRhsNestedInitializer && fieldSymbol.IsReadOnly && fieldSymbol.Type.IsValueType) 5996if (propertySymbol.Type.IsValueType) 8552hasError = (object)receiverType == null || !receiverType.IsValueType; 10978if ((!accessType.IsReferenceType && !accessType.IsValueType) || accessType.IsPointerOrFunctionPointer() || accessType.IsRestrictedType()) 11026if (accessType.IsValueType && !accessType.IsNullableType() && !accessType.IsVoidType()) 11143if (receiverType.IsValueType && !receiverType.IsNullableType())
Binder\Binder_Invocation.cs (1)
1785receiver.Type.IsValueType &&
Binder\Binder_Operators.cs (4)
3510if (operandType.IsValueType && targetType.IsClassType() && targetType.SpecialType != SpecialType.System_Enum || 3511targetType.IsValueType && operandType.IsClassType() && operandType.SpecialType != SpecialType.System_Enum) 4029if (!optLeftType.IsValueType) 4189if (leftType.IsValueType && !leftType.IsNullableType())
Binder\Binder_Statements.cs (1)
2374if (targetType.IsValueType)
Binder\Binder_WithExpression.cs (1)
30if (receiverType.IsValueType && !receiverType.IsPointerOrFunctionPointer())
Binder\LockBinder.cs (1)
52else if (!exprType.IsReferenceType && (exprType.IsValueType || Compilation.FeatureStrictEnabled))
Binder\Semantics\Conversions\ConversionsBase.cs (4)
2257if (!unwrappedSource.IsValueType) 3318if (!source.IsValueType || !destination.IsReferenceType) 3836if (destination.IsValueType && !destination.IsNullableType()) 3845destination.IsValueType &&
CodeGen\CodeGenerator_HasHome.cs (2)
54if (addressKind == AddressKind.ReadOnly && !expression.Type.IsValueType && peVerifyCompatEnabled) 229if (receiver?.Type.IsValueType == true)
CodeGen\EmitAddress.cs (6)
42Debug.Assert(!expression.Type.IsValueType || expression.Type.IsNullableType()); 65Debug.Assert(expression.Type.IsValueType || IsAnyReadOnly(addressKind), "'this' is readonly in classes"); 67if (expression.Type.IsValueType) 237Debug.Assert(!expression.Type.IsValueType); 430return !arrayAccess.Type.IsValueType; 530Debug.Assert(receiverType.TypeKind == TypeKind.TypeParameter || receiverType.IsValueType);
CodeGen\EmitExpression.cs (12)
380Debug.Assert(!expression.Type.IsValueType); 411Debug.Assert(!receiverType.IsValueType || 434var notConstrained = !receiverType.IsReferenceType && !receiverType.IsValueType; 654Debug.Assert(!expression.Type.IsValueType); 812if (thisType.IsValueType) 1171if (fieldType.IsValueType && (object)fieldType == (object)receiver.Type) 1227if (receiver == null || !receiver.Type.IsValueType) 2025if (callKind == CallKind.ConstrainedCallVirt && tempOpt is null && !receiverType.IsValueType && 2093return !receiverType.IsValueType; 2106BoundConditionalReceiver { Type: { IsReferenceType: false, IsValueType: false } }) 2654if (left.Kind == BoundKind.ArrayAccess && left.Type.TypeKind == TypeKind.TypeParameter && !left.Type.IsValueType) 3189Debug.Assert(thisRef.Type.IsValueType);
CodeGen\Optimizer.cs (3)
1037Debug.Assert(lhs.Type.IsValueType, "'this' is assignable only in structs"); 1357if (receiver.Type.IsValueType && ( 2194!arrayAccess.Type.IsValueType)
Compilation\BuiltInOperators.cs (2)
880if (leftType.IsValueType || (!leftType.IsReferenceType && !rightIsNull)) 891if (rightType.IsValueType || (!rightType.IsReferenceType && !leftIsNull))
Errors\LazyMissingNonNullTypesContextDiagnosticInfo.cs (1)
84=> type is null || !(type.IsValueType || type.IsErrorType());
FlowAnalysis\NullableWalker.cs (9)
751if (symbolType.Type.IsValueType || symbolType.Type.IsErrorType()) 2265type.Type.IsValueType) 4231if (!initializer.Type.IsValueType && GetState(ref State, slot).MayBeNull()) 4785Debug.Assert(!node.Expression.Type!.IsValueType); 4820Debug.Assert(expressionType.IsValueType); 4857else if (!operatorKind.IsDynamic() && !resultType.IsValueType) 9092Debug.Assert(targetType.IsValueType || targetType.IsErrorType()); 11432if (node.Type.IsValueType || node.HasErrors || awaitableInfo.GetResult is null) 11821bool isValueType = type.IsValueType;
Lowering\ClosureConversion\ClosureConversion.cs (1)
717if (!framePointer.Type.IsValueType)
Lowering\LocalRewriter\LocalRewriter.cs (3)
1061return !eventAccess.ReceiverOpt.Type.IsValueType || CanBePassedByReference(eventAccess.ReceiverOpt); 1072return !fieldAccess.ReceiverOpt.Type.IsValueType || CanBePassedByReference(fieldAccess.ReceiverOpt); 1117return expr is BoundConversion { Conversion: { IsInterpolatedStringHandler: true }, Type: { IsValueType: true } };
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
359Debug.Assert(input.Type.IsValueType);
Lowering\LocalRewriter\LocalRewriter_AsOperator.cs (1)
45Debug.Assert(!rewrittenType.IsValueType || rewrittenType.IsNullableType());
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (1)
2080!exprType.IsValueType ||
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
691refKind = rewrittenReceiver.Type.IsValueType || rewrittenReceiver.Type.Kind == SymbolKind.TypeParameter ? RefKind.Ref : RefKind.None;
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
201if (getEnumeratorMethod?.ReturnType.IsValueType == true)
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (1)
203var variableRepresentsLocation = rewrittenReceiver.Type.IsValueType || rewrittenReceiver.Type.Kind == SymbolKind.TypeParameter;
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (2)
901userDefinedConversionRewrittenType.IsValueType) 1351parameterType.IsValueType)
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (1)
332bool needNullCheck = !initializerType.IsValueType || initializerType.IsNullableType();
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
390if (enumeratorType.IsValueType)
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (2)
59var isUnconstrainedTypeParameter = rewrittenLeft.Type is { IsReferenceType: false, IsValueType: false }; 243Debug.Assert(rewrittenLeftType.IsNullableType() || !rewrittenLeftType.IsValueType);
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (1)
177if (type.IsValueType)
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (2)
663if (expr.Type.IsValueType && !expr.Type.IsTypeParameter()) 708if (expr.Type.IsValueType)
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (1)
385else if (local.Type.IsValueType)
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
545if (!loweredReceiver.Type.IsValueType)
Lowering\SpillSequenceSpiller.cs (2)
564&& !receiverRefLocal.Type.IsValueType 1286if (receiver.Type.IsReferenceType || receiver.Type.IsValueType || receiverRefKind == RefKind.None)
Lowering\SyntheticBoundNodeFactory.cs (1)
1752!exprType.IsValueType ||
Symbols\ConstraintsHelper.cs (5)
474Debug.Assert(!deducedBase.IsValueType || typeParameter.HasReferenceTypeConstraint); 475diagnosticsBuilder.Add(GenerateConflictingConstraintsError(typeParameter, deducedBase, classConflict: deducedBase.IsValueType)); 1206if (type.IsValueType) 1245if (type is null || type.IsValueType) 1339if (typeArgument.Type.IsValueType)
Symbols\NamedTypeSymbol.cs (1)
363if ((thisParam.RefKind == RefKind.Ref && !thisParam.Type.IsValueType) ||
Symbols\NullableAnnotationExtensions.cs (1)
137NullableAnnotation.Oblivious when type?.IsValueType == true => CodeAnalysis.NullableAnnotation.NotAnnotated,
Symbols\PlaceholderTypeArgumentSymbol.cs (1)
14/// <see cref="TypeSymbol.IsValueType"/> with minimal binding.
Symbols\PublicModel\TypeSymbol.cs (2)
70!(UnderlyingTypeSymbol.IsValueType && !UnderlyingTypeSymbol.IsNullableType())) 131return UnderlyingTypeSymbol.IsValueType;
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (1)
351static (type, arg, flag) => !type.Type.IsValueType && !type.NullableAnnotation.IsOblivious(),
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
218else if (parameter0RefKind == RefKind.Ref && !parameter0Type.Type.IsValueType)
Symbols\Source\TypeParameterConstraintClause.cs (1)
184else if (type.IsValueType)
Symbols\TypeParameterSymbol.cs (1)
510if (constraintType.Type.IsValueType)
Symbols\TypeSymbol.cs (1)
2501bool ITypeSymbolInternal.IsValueType => this.IsValueType;
Symbols\TypeSymbolExtensions.cs (5)
46return !type.IsValueType || type.IsNullableTypeOrTypeParameter(); 97if (!typeArgument.IsValueType) 146return type is { IsValueType: true } 640if (type.IsValueType) 1677return type.IsValueType && type.TypeKind != TypeKind.TypeParameter;
Symbols\TypeWithAnnotations.cs (13)
110if (NullableAnnotation.IsAnnotated() || (Type.IsValueType && Type.IsNullableType())) 120if (NullableAnnotation.IsNotAnnotated() || (Type.IsValueType && !Type.IsNullableType())) 202if (!typeSymbol.IsValueType && !typeSymbol.IsErrorType()) 309(!HasType || (!IsNullableType() && !Type.IsValueType))) 315(!HasType || (!Type.IsValueType && !Type.IsTypeParameterDisallowingAnnotationInCSharp8()))) 378bool isValueType = type.IsValueType && !type.IsNullableType(); 596typeWithAnnotationsPredicate: (t, a, b) => t.NullableAnnotation != NullableAnnotation.Oblivious && !t.Type.IsErrorType() && !t.Type.IsValueType, 617return type.IsValueType; 635if (annotation.IsOblivious() || type.IsValueType) 727if (NullableAnnotation.IsNotAnnotated() || (typeSymbol.IsValueType && !typeSymbol.IsNullableType())) 743if (!typeSymbol.IsValueType && !typeSymbol.IsNullableType()) 1084TryForceResolve(asValueType: _underlying.Type.IsValueType); 1145if (!_underlying.Type.IsValueType)
Symbols\TypeWithState.cs (1)
93(Type?.IsValueType == true ? NullableAnnotation.NotAnnotated : NullableAnnotation.Annotated) :