7 overrides of IsValueType
Microsoft.CodeAnalysis.CSharp (7)
Symbols\ArrayTypeSymbol.cs (1)
229
public override bool
IsValueType
Symbols\DynamicTypeSymbol.cs (1)
101
public override bool
IsValueType
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (1)
74
public override bool
IsValueType
=> true;
Symbols\FunctionTypeSymbol.cs (1)
100
public override bool
IsValueType
=> false;
Symbols\NamedTypeSymbol.cs (1)
402
public override bool
IsValueType
Symbols\PointerTypeSymbol.cs (1)
101
public override bool
IsValueType
Symbols\TypeParameterSymbol.cs (1)
576
public sealed override bool
IsValueType
133 references to IsValueType
Microsoft.CodeAnalysis.CSharp (115)
Binder\Binder.ValueChecks.cs (8)
529
Debug.Assert(!checkingReceiver || expr.Type.
IsValueType
|| expr.Type.IsTypeParameter());
689
var isValueType = ((BoundThisReference)expr).Type.
IsValueType
;
1418
&& receiver?.Type?.
IsValueType
== true;
2078
if (receiver is not BoundValuePlaceholderBase && method is not null && receiver.Type?.
IsValueType
== true)
3150
Debug.Assert(!checkingReceiver || expr.Type.
IsValueType
|| expr.Type.IsTypeParameter());
3871
Debug.Assert(!checkingReceiver || expr.Type.
IsValueType
|| expr.Type.IsTypeParameter());
4596
if (addressKind == AddressKind.ReadOnly && !expression.Type.
IsValueType
&& peVerifyCompatEnabled)
4771
if (receiver?.Type.
IsValueType
== true)
Binder\Binder_Expressions.cs (7)
1368
|| (typeWithAnnotations.NullableAnnotation.IsAnnotated() && !type.
IsValueType
)
5015
if (isRhsNestedInitializer && fieldSymbol.IsReadOnly && fieldSymbol.Type.
IsValueType
)
5125
if (propertySymbol.Type.
IsValueType
)
7467
hasError = (object)receiverType == null || !receiverType.
IsValueType
;
9370
if ((!accessType.IsReferenceType && !accessType.
IsValueType
) || accessType.IsPointerOrFunctionPointer() || accessType.IsRestrictedType())
9418
if (accessType.
IsValueType
&& !accessType.IsNullableType() && !accessType.IsVoidType())
9535
if (receiverType.
IsValueType
&& !receiverType.IsNullableType())
Binder\Binder_Invocation.cs (1)
1476
receiver.Type.
IsValueType
&&
Binder\Binder_Operators.cs (4)
3465
if (operandType.
IsValueType
&& targetType.IsClassType() && targetType.SpecialType != SpecialType.System_Enum ||
3466
targetType.
IsValueType
&& operandType.IsClassType() && operandType.SpecialType != SpecialType.System_Enum)
3952
if (!optLeftType.
IsValueType
)
4112
if (leftType.
IsValueType
&& !leftType.IsNullableType())
Binder\Binder_Statements.cs (1)
2338
if (targetType.
IsValueType
)
Binder\Binder_WithExpression.cs (1)
30
if (receiverType.
IsValueType
&& !receiverType.IsPointerOrFunctionPointer())
Binder\LockBinder.cs (1)
52
else if (!exprType.IsReferenceType && (exprType.
IsValueType
|| Compilation.FeatureStrictEnabled))
Binder\Semantics\Conversions\ConversionsBase.cs (4)
2108
if (!unwrappedSource.
IsValueType
)
3089
if (!source.
IsValueType
|| !destination.IsReferenceType)
3597
if (destination.
IsValueType
&& !destination.IsNullableType())
3606
destination.
IsValueType
&&
CodeGen\EmitAddress.cs (5)
44
Debug.Assert(!expression.Type.
IsValueType
|| expression.Type.IsNullableType());
67
Debug.Assert(expression.Type.
IsValueType
|| IsAnyReadOnly(addressKind), "'this' is readonly in classes");
69
if (expression.Type.
IsValueType
)
234
Debug.Assert(!expression.Type.
IsValueType
);
427
return !arrayAccess.Type.
IsValueType
;
CodeGen\EmitExpression.cs (12)
365
Debug.Assert(!expression.Type.
IsValueType
);
396
Debug.Assert(!receiverType.
IsValueType
||
419
var notConstrained = !receiverType.IsReferenceType && !receiverType.
IsValueType
;
642
Debug.Assert(!expression.Type.
IsValueType
);
798
if (thisType.
IsValueType
)
1131
if (fieldType.
IsValueType
&& (object)fieldType == (object)receiver.Type)
1187
if (receiver == null || !receiver.Type.
IsValueType
)
1815
if (callKind == CallKind.ConstrainedCallVirt && tempOpt is null && !receiverType.
IsValueType
&&
1873
return !receiverType.
IsValueType
;
1886
BoundConditionalReceiver { Type: { IsReferenceType: false,
IsValueType
: false } })
2437
if (left.Kind == BoundKind.ArrayAccess && left.Type.TypeKind == TypeKind.TypeParameter && !left.Type.
IsValueType
)
2971
Debug.Assert(thisRef.Type.
IsValueType
);
CodeGen\Optimizer.cs (2)
1036
Debug.Assert(lhs.Type.
IsValueType
, "'this' is assignable only in structs");
1290
if (receiver.Type.
IsValueType
&& (
Compilation\BuiltInOperators.cs (2)
884
if (leftType.
IsValueType
|| (!leftType.IsReferenceType && !rightIsNull))
895
if (rightType.
IsValueType
|| (!rightType.IsReferenceType && !leftIsNull))
Errors\LazyMissingNonNullTypesContextDiagnosticInfo.cs (1)
84
=> type is null || !(type.
IsValueType
|| type.IsErrorType());
FlowAnalysis\NullableWalker.cs (8)
719
if (symbolType.Type.
IsValueType
|| symbolType.Type.IsErrorType())
2193
type.Type.
IsValueType
)
3831
if (!initializer.Type.
IsValueType
&& GetState(ref State, slot).MayBeNull())
4381
Debug.Assert(!node.Expression.Type!.
IsValueType
);
4430
else if (!operatorKind.IsDynamic() && !resultType.
IsValueType
)
8206
Debug.Assert(targetType.
IsValueType
|| targetType.IsErrorType());
10514
if (node.Type.
IsValueType
|| node.HasErrors || awaitableInfo.GetResult is null)
10905
bool isValueType = type.
IsValueType
;
Lowering\ClosureConversion\ClosureConversion.cs (1)
706
if (!framePointer.Type.
IsValueType
)
Lowering\LocalRewriter\LocalRewriter.cs (3)
934
return !eventAccess.ReceiverOpt.Type.
IsValueType
|| CanBePassedByReference(eventAccess.ReceiverOpt);
945
return !fieldAccess.ReceiverOpt.Type.
IsValueType
|| CanBePassedByReference(fieldAccess.ReceiverOpt);
987
return expr is BoundConversion { Conversion: { IsInterpolatedStringHandler: true }, Type: {
IsValueType
: true } };
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
359
Debug.Assert(input.Type.
IsValueType
);
Lowering\LocalRewriter\LocalRewriter_AsOperator.cs (1)
45
Debug.Assert(!rewrittenType.
IsValueType
|| rewrittenType.IsNullableType());
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (1)
2000
!exprType.
IsValueType
||
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
457
refKind = rewrittenReceiver.Type.
IsValueType
|| rewrittenReceiver.Type.Kind == SymbolKind.TypeParameter ? RefKind.Ref : RefKind.None;
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (1)
202
var variableRepresentsLocation = rewrittenReceiver.Type.
IsValueType
|| rewrittenReceiver.Type.Kind == SymbolKind.TypeParameter;
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (2)
759
userDefinedConversionRewrittenType.
IsValueType
)
1204
parameterType.
IsValueType
)
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (1)
332
bool needNullCheck = !initializerType.
IsValueType
;
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
325
if (enumeratorType.
IsValueType
)
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (2)
61
var isUnconstrainedTypeParameter = rewrittenLeft.Type is { IsReferenceType: false,
IsValueType
: false };
234
Debug.Assert(rewrittenLeftType.IsNullableType() || !rewrittenLeftType.
IsValueType
);
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (1)
170
if (type.
IsValueType
)
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (2)
413
if (expr.Type.
IsValueType
&& !expr.Type.IsTypeParameter())
453
if (expr.Type.
IsValueType
)
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (1)
384
else if (local.Type.
IsValueType
)
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
545
if (!loweredReceiver.Type.
IsValueType
)
Lowering\SpillSequenceSpiller.cs (2)
493
&& !receiverRefLocal.Type.
IsValueType
1188
if (receiver.Type.IsReferenceType || receiver.Type.
IsValueType
|| receiverRefKind == RefKind.None)
Lowering\SyntheticBoundNodeFactory.cs (1)
1628
!exprType.
IsValueType
||
Symbols\ConstraintsHelper.cs (5)
445
Debug.Assert(!deducedBase.
IsValueType
|| typeParameter.HasReferenceTypeConstraint);
446
diagnosticsBuilder.Add(GenerateConflictingConstraintsError(typeParameter, deducedBase, classConflict: deducedBase.
IsValueType
));
1128
if (type.
IsValueType
)
1167
if (type is null || type.
IsValueType
)
1263
if (typeArgument.Type.
IsValueType
&&
Symbols\NamedTypeSymbol.cs (1)
366
if ((thisParam.RefKind == RefKind.Ref && !thisParam.Type.
IsValueType
) ||
Symbols\NullableAnnotationExtensions.cs (1)
137
NullableAnnotation.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()))
131
return UnderlyingTypeSymbol.
IsValueType
;
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (1)
350
static (type, arg, flag) => !type.Type.
IsValueType
&& !type.NullableAnnotation.IsOblivious(),
Symbols\Source\SourceOrdinaryMethodSymbol.cs (1)
231
else if (parameter0RefKind == RefKind.Ref && !parameter0Type.Type.
IsValueType
)
Symbols\Source\TypeParameterConstraintClause.cs (1)
180
else if (type.
IsValueType
)
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (1)
210
if (value.Type.
IsValueType
)
Symbols\TypeParameterSymbol.cs (1)
510
if (constraintType.Type.
IsValueType
)
Symbols\TypeSymbol.cs (1)
2459
bool ITypeSymbolInternal.IsValueType => this.
IsValueType
;
Symbols\TypeSymbolExtensions.cs (5)
38
return !type.
IsValueType
|| type.IsNullableTypeOrTypeParameter();
89
if (!typeArgument.
IsValueType
)
138
return type is {
IsValueType
: true }
576
if (type.
IsValueType
)
1586
return type.
IsValueType
&& type.TypeKind != TypeKind.TypeParameter;
Symbols\TypeWithAnnotations.cs (13)
107
if (NullableAnnotation.IsAnnotated() || (Type.
IsValueType
&& Type.IsNullableType()))
117
if (NullableAnnotation.IsNotAnnotated() || (Type.
IsValueType
&& !Type.IsNullableType()))
194
if (!typeSymbol.
IsValueType
&& !typeSymbol.IsErrorType())
298
(!HasType || (!IsNullableType() && !Type.
IsValueType
)))
304
(!HasType || (!Type.
IsValueType
&& !Type.IsTypeParameterDisallowingAnnotationInCSharp8())))
367
bool isValueType = type.
IsValueType
&& !type.IsNullableType();
568
typeWithAnnotationsPredicate: (t, a, b) => t.NullableAnnotation != NullableAnnotation.Oblivious && !t.Type.IsErrorType() && !t.Type.
IsValueType
,
589
return type.
IsValueType
;
607
if (annotation.IsOblivious() || type.
IsValueType
)
699
if (NullableAnnotation.IsNotAnnotated() || (typeSymbol.
IsValueType
&& !typeSymbol.IsNullableType()))
714
if (!typeSymbol.
IsValueType
)
950
TryForceResolve(asValueType: _underlying.Type.
IsValueType
);
1010
if (!_underlying.Type.
IsValueType
)
Symbols\TypeWithState.cs (1)
93
(Type?.
IsValueType
== true ? NullableAnnotation.NotAnnotated : NullableAnnotation.Annotated) :
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (14)
Semantics\NullableReferenceTypesTests.cs (5)
10342
Assert.True(typeArg.Type.
IsValueType
);
10347
Assert.True(typeArg.Type.
IsValueType
);
11444
Assert.True(m1.Parameters[0].Type.
IsValueType
);
11722
Assert.True(m1.Parameters[0].Type.StrippedType().
IsValueType
);
11757
Assert.False(m1.Parameters[0].Type.StrippedType().
IsValueType
);
Semantics\OperatorTests.cs (9)
7674
if (type.
IsValueType
&& !type.IsPointerType())
8292
if (leftType.
IsValueType
&& !leftType.IsPointerType())
8294
if (rightType.
IsValueType
&& !rightType.IsPointerType())
8309
else if (rightType.
IsValueType
&& !rightType.IsPointerType())
8342
(!leftType.
IsValueType
|| !rightType.
IsValueType
||
8470
if (leftType.
IsValueType
&& !leftType.IsPointerType())
8472
if (rightType.
IsValueType
&& !rightType.IsPointerType())
8496
else if (rightType.
IsValueType
&& !rightType.IsPointerType())
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (4)
Symbols\Metadata\MetadataTypeTests.cs (1)
323
Assert.True(type2.ElementType.
IsValueType
);
Symbols\Source\MethodTests.cs (3)
369
Assert.False(refP.
IsValueType
);
377
Assert.True(outP.
IsValueType
);
408
Assert.True(m.ReturnType.
IsValueType
);