7 overrides of IsReferenceType
Microsoft.CodeAnalysis.CSharp (7)
Symbols\ArrayTypeSymbol.cs (1)
221
public override bool
IsReferenceType
Symbols\DynamicTypeSymbol.cs (1)
38
public override bool
IsReferenceType
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (1)
73
public override bool
IsReferenceType
=> false;
Symbols\FunctionTypeSymbol.cs (1)
98
public override bool
IsReferenceType
=> true;
Symbols\NamedTypeSymbol.cs (1)
388
public override bool
IsReferenceType
Symbols\PointerTypeSymbol.cs (1)
93
public override bool
IsReferenceType
Symbols\TypeParameterSymbol.cs (1)
518
public sealed override bool
IsReferenceType
136 references to IsReferenceType
Microsoft.CodeAnalysis.CSharp (104)
Binder\Binder.ValueChecks.cs (1)
4611
if (type.
IsReferenceType
)
Binder\Binder_Expressions.cs (3)
1349
else if (typeWithAnnotations.NullableAnnotation.IsAnnotated() && type.
IsReferenceType
)
2535
if (!targetType.
IsReferenceType
&& !targetType.IsNullableType() && operand.IsLiteralNull())
9370
if ((!accessType.
IsReferenceType
&& !accessType.IsValueType) || accessType.IsPointerOrFunctionPointer() || accessType.IsRestrictedType())
Binder\Binder_Operators.cs (7)
814
Debug.Assert(!right.Type.
IsReferenceType
);
818
Debug.Assert(!left.Type.
IsReferenceType
);
2579
if (receiver.Type.
IsReferenceType
)
3219
if (targetType.
IsReferenceType
&& targetTypeWithAnnotations.NullableAnnotation.IsAnnotated())
3662
if (targetType.
IsReferenceType
&& targetTypeWithAnnotations.NullableAnnotation.IsAnnotated())
3668
else if (!targetType.
IsReferenceType
&& !targetType.IsNullableType())
3948
if ((object)optLeftType != null && !optLeftType.
IsReferenceType
&& !isLeftNullable)
Binder\LockBinder.cs (1)
52
else if (!exprType.
IsReferenceType
&& (exprType.IsValueType || Compilation.FeatureStrictEnabled))
Binder\Semantics\Conversions\Conversions.cs (2)
233
if (!thisParameter.Type.
IsReferenceType
)
353
if (methodGroup.IsExtensionMethodGroup && !method.Parameters[0].Type.
IsReferenceType
)
Binder\Semantics\Conversions\ConversionsBase.cs (8)
1172
if (destination.
IsReferenceType
)
2484
if (!source.
IsReferenceType
)
3089
if (!source.IsValueType || !destination.
IsReferenceType
)
3237
if (destination.
IsReferenceType
)
3242
else if (source.Kind == SymbolKind.DynamicType && destination.
IsReferenceType
)
3470
bool bothAreReferenceTypes = sourceArg.
IsReferenceType
&& destinationArg.
IsReferenceType
;
3622
if (source.
IsReferenceType
&&
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (11)
1953
if (elementSource.Type.
IsReferenceType
)
2183
if (sourceTypeArgument.Type.
IsReferenceType
&& typeParameter.Variance == VarianceKind.Out)
2187
else if (sourceTypeArgument.Type.
IsReferenceType
&& typeParameter.Variance == VarianceKind.In)
2227
if ((sourceParam.Type.
IsReferenceType
|| sourceParam.Type.IsFunctionPointer()) && sourceParam.RefKind == RefKind.None)
2237
if ((sourceSignature.ReturnType.
IsReferenceType
|| sourceSignature.ReturnType.IsFunctionPointer()) && sourceSignature.RefKind == RefKind.None)
2290
Debug.Assert(source.Type.
IsReferenceType
|| source.Type.IsFunctionPointer());
2354
if (elementSource.Type.
IsReferenceType
)
2533
if (sourceTypeArgument.Type.
IsReferenceType
&& typeParameter.Variance == VarianceKind.Out)
2537
else if (sourceTypeArgument.Type.
IsReferenceType
&& typeParameter.Variance == VarianceKind.In)
2577
if ((sourceParam.Type.
IsReferenceType
|| sourceParam.Type.IsFunctionPointer()) && sourceParam.RefKind == RefKind.None)
2587
if ((sourceSignature.ReturnType.
IsReferenceType
|| sourceSignature.ReturnType.IsFunctionPointer()) && sourceSignature.RefKind == RefKind.None)
CodeGen\EmitAddress.cs (3)
43
Debug.Assert(!expression.Type.
IsReferenceType
);
233
Debug.Assert(!expression.Type.
IsReferenceType
);
369
if (!receiver.Type.
IsReferenceType
)
CodeGen\EmitExpression.cs (9)
364
Debug.Assert(!expression.Type.
IsReferenceType
);
419
var notConstrained = !receiverType.
IsReferenceType
&& !receiverType.IsValueType;
428
(receiverType.
IsReferenceType
&& receiverType.TypeKind == TypeKind.TypeParameter) ||
644
if (!expression.Type.
IsReferenceType
)
1809
callKind = receiverType.
IsReferenceType
&& !IsRef(receiver) ?
1838
if (!receiverType.
IsReferenceType
)
1886
BoundConditionalReceiver { Type: {
IsReferenceType
: false, IsValueType: false } })
2386
if (rightType.
IsReferenceType
|| (right.ConstantValueOpt != null && rightType.SpecialType != SpecialType.System_Decimal))
3567
Debug.Assert(expr.Type.
IsReferenceType
);
CodeGen\EmitOperators.cs (2)
439
if (comparandType.
IsReferenceType
&& !comparandType.IsVerifierReference())
453
if (comparandType.
IsReferenceType
&& !comparandType.IsVerifierReference())
CodeGen\EmitStatement.cs (3)
218
return ts.
IsReferenceType
;
534
var complexCase = !receiverType.
IsReferenceType
||
611
if (conditionType.
IsReferenceType
&& !conditionType.IsVerifierReference())
CodeGen\Optimizer.cs (1)
1165
if (receiverType.
IsReferenceType
)
Compilation\BuiltInOperators.cs (4)
884
if (leftType.IsValueType || (!leftType.
IsReferenceType
&& !rightIsNull))
895
if (rightType.IsValueType || (!rightType.
IsReferenceType
&& !leftIsNull))
904
var leftIsReferenceType = ((object)leftType != null) && leftType.
IsReferenceType
;
910
var rightIsReferenceType = ((object)rightType != null) && rightType.
IsReferenceType
;
FlowAnalysis\DefiniteAssignment.cs (1)
874
if ((object)type != null && type.
IsReferenceType
&&
FlowAnalysis\NullableWalker.cs (4)
2480
if (targetType.Type.
IsReferenceType
||
2565
if (fieldOrPropertyType.Type.
IsReferenceType
||
6679
return (type.Kind == SymbolKind.TypeParameter && !type.
IsReferenceType
) || type.IsNullableTypeOrTypeParameter();
10757
Debug.Assert(node.Type.
IsReferenceType
);
Lowering\ClosureConversion\ClosureConversion.cs (1)
689
Debug.Assert(capturedFrame.Type.
IsReferenceType
); // Make sure we're not accidentally capturing a struct by value
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (2)
683
receiver = requiresInstanceReceiver ? nullObject : receiver.Type.
IsReferenceType
? receiver : _bound.Convert(_objectType, receiver);
1027
!node.ReceiverOpt.Type.
IsReferenceType
)
Lowering\DiagnosticsPass_Warnings.cs (1)
89
if (IsNonAgileFieldAccess(fieldAccess, _compilation) && !fieldSymbol.Type.
IsReferenceType
)
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
174
receiver.Type?.
IsReferenceType
== false &&
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
469
typeDecision.Type.
IsReferenceType
&&
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
464
!rewrittenReceiver.Type.
IsReferenceType
&&
706
if (!receiverType.
IsReferenceType
)
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (3)
466
else if (!receiver.Type.
IsReferenceType
)
471
Debug.Assert(receiver.Type.
IsReferenceType
);
934
type.
IsReferenceType
||
Lowering\LocalRewriter\LocalRewriter_ConditionalAccess.cs (1)
48
if (loweredReceiver.IsDefaultValue() && receiverType.
IsReferenceType
)
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
451
if (!receiver.Type.
IsReferenceType
&& method.ContainingType.IsInterface)
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (2)
272
receiver.Type.
IsReferenceType
? RefKind.None : RefKind.Ref);
580
receiver.Type.
IsReferenceType
? RefKind.None : RefKind.Ref);
Lowering\LocalRewriter\LocalRewriter_LocalDeclaration.cs (1)
36
if (!localSymbol.Type.
IsReferenceType
&& localSymbol.ConstantValue == null)
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (2)
61
var isUnconstrainedTypeParameter = rewrittenLeft.Type is {
IsReferenceType
: false, IsValueType: false };
93
if (rewrittenLeft.Type.
IsReferenceType
&&
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
447
bool callWithoutCopy = expr.Type.
IsReferenceType
||
Lowering\SpillSequenceSpiller.cs (6)
381
if (refKind != RefKind.None || expression.Type.
IsReferenceType
)
492
&& !receiverRefLocal.Type.
IsReferenceType
963
Debug.Assert(refKind == RefKind.None || !receiver.Type.
IsReferenceType
);
973
Debug.Assert(!receiverType.
IsReferenceType
);
1003
if (!receiver.Type.
IsReferenceType
&& LocalRewriter.CanBePassedByReference(receiver))
1188
if (receiver.Type.
IsReferenceType
|| receiver.Type.IsValueType || receiverRefKind == RefKind.None)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (2)
140
thisParameter.Type.
IsReferenceType
&&
439
if (type.
IsReferenceType
|| type.TypeKind == TypeKind.TypeParameter) return true; // type parameter or reference type
Lowering\StateMachineRewriter\StateMachineRewriter.cs (1)
430
if (method.IsStatic || method.ThisParameter.Type.
IsReferenceType
)
Lowering\SyntheticBoundNodeFactory.cs (2)
846
Debug.Assert(left.Type.
IsReferenceType
);
1493
return typeSymbol.
IsReferenceType
? Null(typeSymbol, syntax) : Default(typeSymbol, syntax);
Symbols\AliasSymbol.cs (1)
415
annotatedNamespaceOrType.TypeWithAnnotations.Type?.
IsReferenceType
is true)
Symbols\ConstantValueUtils.cs (1)
112
typeSymbol.
IsReferenceType
&&
Symbols\ConstraintsHelper.cs (2)
897
if (!typeArgument.Type.
IsReferenceType
)
1086
if (typeArgument.Type.
IsReferenceType
)
Symbols\PublicModel\TypeSymbol.cs (1)
123
return UnderlyingTypeSymbol.
IsReferenceType
;
Symbols\Source\SourceAssemblySymbol.cs (1)
2736
if (type.
IsReferenceType
) return "null";
Symbols\Source\SourceComplexParameterSymbol.cs (1)
973
if (this.Type.
IsReferenceType
)
Symbols\TypeParameterSymbol.cs (1)
405
if (!constraint.
IsReferenceType
)
Symbols\TypeSymbol.cs (1)
2457
bool ITypeSymbolInternal.IsReferenceType => this.
IsReferenceType
;
Symbols\TypeSymbolExtensions.cs (5)
32
return type.
IsReferenceType
|| type.IsPointerOrFunctionPointer() || type.IsNullableType();
45
return typeSymbol.
IsReferenceType
|| typeSymbol.IsEnumType() || typeSymbol.SpecialType.CanBeConst() || typeSymbol.IsNativeIntegerType;
571
if (type.
IsReferenceType
)
1414
return type.
IsReferenceType
;
1578
return type.
IsReferenceType
&& type.TypeKind != TypeKind.TypeParameter;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (28)
Semantics\NullableReferenceTypesTests.cs (24)
11495
Assert.False(m1.Parameters[0].Type.
IsReferenceType
);
11500
Assert.False(m2.ReturnType.
IsReferenceType
);
11758
Assert.False(m1.Parameters[0].Type.StrippedType().
IsReferenceType
);
12089
Assert.True(m1.Parameters[0].Type.
IsReferenceType
);
13888
Assert.True(m1.Parameters[0].Type.
IsReferenceType
);
13894
Assert.True(m2.ReturnType.
IsReferenceType
);
135191
Assert.True(c2Goo.Parameters[0].Type.
IsReferenceType
);
135219
Assert.True(((ArrayTypeSymbol)c2Goo.Parameters[0].Type).ElementType.
IsReferenceType
);
135249
Assert.True(tuple.TupleElements[0].Type.
IsReferenceType
);
135251
Assert.True(tuple.TupleElements[1].Type.
IsReferenceType
);
135279
Assert.True(c2Goo.ReturnType.
IsReferenceType
);
135307
Assert.True(((ArrayTypeSymbol)c2Goo.ReturnType).ElementType.
IsReferenceType
);
135337
Assert.True(tuple.TupleElements[0].Type.
IsReferenceType
);
135339
Assert.True(tuple.TupleElements[1].Type.
IsReferenceType
);
135362
Assert.True(dGoo.Parameters[0].Type.
IsReferenceType
);
135385
Assert.True(((ArrayTypeSymbol)dGoo.Parameters[0].Type).ElementType.
IsReferenceType
);
135410
Assert.True(tuple.TupleElements[0].Type.
IsReferenceType
);
135412
Assert.True(tuple.TupleElements[1].Type.
IsReferenceType
);
135435
Assert.True(dGoo.ReturnType.
IsReferenceType
);
135458
Assert.True(((ArrayTypeSymbol)dGoo.ReturnType).ElementType.
IsReferenceType
);
135483
Assert.True(tuple.TupleElements[0].Type.
IsReferenceType
);
135485
Assert.True(tuple.TupleElements[1].Type.
IsReferenceType
);
135510
Assert.True(dGoo.ReturnType.
IsReferenceType
);
135516
Assert.True(tuple.TupleElements[0].Type.
IsReferenceType
);
Semantics\OperatorTests.cs (4)
8168
leftType.
IsReferenceType
&& rightType.
IsReferenceType
&&
8346
(!leftType.
IsReferenceType
|| !rightType.
IsReferenceType
||
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Symbols\Source\MethodTests.cs (3)
368
Assert.True(refP.
IsReferenceType
);
376
Assert.False(outP.
IsReferenceType
);
407
Assert.False(m.ReturnType.
IsReferenceType
);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
UsesIsNullableVisitor.cs (1)
158
return (type.NullableAnnotation != NullableAnnotation.Oblivious && typeSymbol.
IsReferenceType
&& !typeSymbol.IsErrorType()) ||