95 references to Null
Microsoft.CodeAnalysis (11)
CodeGen\SwitchIntegralJumpTableEmitter.cs (1)
109
if (sortedCaseLabels[0].Key != ConstantValue.
Null
)
ConstantValue.cs (5)
91
public static ConstantValue Nothing { get { return
Null
; } }
103
return
Null
;
368
case ConstantValueTypeDiscriminator.Null: return
Null
;
426
case ConstantValueTypeDiscriminator.String: return
Null
;
740
return ReferenceEquals(this,
Null
);
MetadataReader\MetadataDecoder.cs (3)
1022
value = (type.IsReferenceType || type.TypeKind == TypeKind.Pointer || type.TypeKind == TypeKind.FunctionPointer) ? ConstantValue.
Null
: ConstantValue.Bad;
1119
return ConstantValue.
Null
;
1132
return ConstantValue.
Null
;
MetadataReader\PEModule.cs (1)
3476
return ConstantValue.
Null
;
Operations\ControlFlowGraphBuilder.cs (1)
3442
? ConstantValue.
Null
Microsoft.CodeAnalysis.CSharp (36)
Binder\Binder_Await.cs (1)
369
var receiver = new BoundLiteral(node, ConstantValue.
Null
, awaiterType);
Binder\Binder_Expressions.cs (3)
6245
cv = ConstantValue.
Null
;
6651
if (boundLeft.Kind == BoundKind.Literal && ((BoundLiteral)boundLeft).ConstantValueOpt == ConstantValue.
Null
)
6808
if ((boundLeft is BoundDefaultLiteral || boundLeft is BoundDefaultExpression) && boundLeft.ConstantValueOpt == ConstantValue.
Null
&&
Binder\Binder_Invocation.cs (1)
1366
{ IsBad: true } => ConstantValue.
Null
,
Binder\Binder_Operators.cs (6)
3245
if (operand.ConstantValueOpt == ConstantValue.
Null
||
3385
if (operandConstantValue == ConstantValue.
Null
)
3395
(operandConstantValue == null || operandConstantValue == ConstantValue.
Null
); // a non-null constant is never null
3721
operand = new BoundDefaultExpression(operand.Syntax, targetType: null, constantValueOpt: ConstantValue.
Null
,
3865
/// - <see cref="ConstantValue.
Null
"/>
3886
return ConstantValue.
Null
;
Binder\Binder_Patterns.cs (3)
569
if (convertedExpression.Type is null && constantValueOpt != ConstantValue.
Null
)
598
if (expression.ConstantValueOpt == ConstantValue.
Null
)
662
if (constantValue == ConstantValue.
Null
)
Binder\DecisionDagBuilder.cs (1)
484
if (constant.ConstantValue == ConstantValue.
Null
)
Binder\LockBinder.cs (1)
46
if (expr.ConstantValueOpt != ConstantValue.
Null
|| Compilation.FeatureStrictEnabled) // Dev10 allows the null literal.
CodeGen\EmitStatement.cs (1)
1535
if (stringConstant == ConstantValue.
Null
)
Compilation\CSharpCompilation.cs (1)
2012
var dumbInstance = new BoundLiteral(syntax, ConstantValue.
Null
, namedType);
FlowAnalysis\AbstractFlowPass.cs (1)
681
return node.ConstantValueOpt == ConstantValue.
Null
;
FlowAnalysis\DefiniteAssignment.cs (1)
878
return value.ConstantValueOpt != ConstantValue.
Null
;
FlowAnalysis\NullableWalker_Patterns.cs (2)
145
bool isExplicitNullCheck = cp.Value.ConstantValueOpt == ConstantValue.
Null
;
591
Debug.Assert(t.Value != ConstantValue.
Null
);
Lowering\Extensions.cs (1)
80
if ((object)expr.Type == null && expr.ConstantValueOpt == ConstantValue.
Null
)
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
379
_factory.Convert(operandType, new BoundLiteral(syntax, ConstantValue.
Null
, objectType)),
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (3)
1917
if (oldNode != null && (loweredLeft.ConstantValueOpt == ConstantValue.
Null
|| loweredRight.ConstantValueOpt == ConstantValue.
Null
))
2036
MakeLiteral(syntax, ConstantValue.
Null
, objectType),
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
390
right: MakeLiteral(forEachSyntax, constantValue: ConstantValue.
Null
, type: null),
Lowering\LocalRewriter\LocalRewriter_LockStatement.cs (1)
32
Debug.Assert(rewrittenArgument.ConstantValueOpt == ConstantValue.
Null
);
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (1)
206
return new BoundLiteral(expr.Syntax, ConstantValue.
Null
, expr.Type);
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (2)
127
if (rewrittenExpression.ConstantValueOpt == ConstantValue.
Null
)
229
if (boundLocal.ConstantValueOpt == ConstantValue.
Null
)
Lowering\SyntheticBoundNodeFactory.cs (2)
1169
BoundExpression nullLiteral = new BoundLiteral(syntax, ConstantValue.
Null
, type) { WasCompilerGenerated = true };
1661
return RewriteNullableNullEquality(syntax, operatorKind, rewrittenExpr, Literal(ConstantValue.
Null
, objectType), boolType);
Symbols\Source\SourceComplexParameterSymbol.cs (1)
404
var value = convertedExpression.ConstantValueOpt ?? ConstantValue.
Null
;
Symbols\TypeSymbolExtensions.cs (1)
573
return ConstantValue.
Null
;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenOverridingAndHiding.cs (1)
4119
Assert.Equal(ConstantValue.
Null
, parameterB.ExplicitDefaultConstantValue);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (1)
Attributes\AttributeTests_WellKnownAttributes.cs (1)
531
Assert.Equal(ConstantValue.
Null
, constantValue);
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (1)
Rewriters\LocalDeclarationRewriter.cs (1)
146
return new BoundLiteral(syntax, ConstantValue.
Null
, byteArrayType);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (6)
Semantics\ConstantTests.cs (1)
4006
nullConst = ConstantValue.
Null
;
Semantics\NamedAndOptionalTests.cs (5)
2143
Assert.Equal(ConstantValue.
Null
, parameters[1].ExplicitDefaultConstantValue);
2194
Assert.Equal(ConstantValue.
Null
, parameters[1].ExplicitDefaultConstantValue);
2213
Assert.Equal(ConstantValue.
Null
, parameters[4].ExplicitDefaultConstantValue);
2219
Assert.Equal(ConstantValue.
Null
, parameters[5].ExplicitDefaultConstantValue);
2359
Assert.Equal(ConstantValue.
Null
, parameters[1].ExplicitDefaultConstantValue);
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (3)
PDB\PdbHelpers.cs (3)
101
(SpecialType.System_String, 0) => ConstantValue.
Null
,
104
(SpecialType.System_Object, 0) => ConstantValue.
Null
,
107
(SpecialType.None, 0) when type.IsReferenceType => ConstantValue.
Null
,
Microsoft.CodeAnalysis.VisualBasic (10)
Analysis\InitializerRewriter.vb (1)
77
New BoundLiteral(syntax, ConstantValue.
Null
, Nothing),
Binding\Binder_Expressions.vb (1)
4430
cv = ConstantValue.
Null
Binding\Binder_Invocation.vb (4)
3207
defaultConstantValue = ConstantValue.
Null
3260
defaultArgument = New BoundLiteral(syntax, ConstantValue.
Null
, Nothing)
3272
Dim argument = New BoundLiteral(syntax, ConstantValue.
Null
, param.Type).MakeCompilerGenerated()
3280
defaultArgument = New BoundLiteral(syntax, ConstantValue.
Null
, Nothing)
Lowering\SyntheticBoundNodeFactory.vb (3)
814
Dim nullLiteral As BoundExpression = New BoundLiteral(_syntax, ConstantValue.
Null
, Nothing)
821
Dim nullLiteral As BoundExpression = New BoundLiteral(_syntax, ConstantValue.
Null
, type)
826
Dim nullLiteral As BoundExpression = New BoundLiteral(_syntax, ConstantValue.
Null
, Nothing)
Symbols\Source\SourceParameterSymbol.vb (1)
430
Return ConstantValue.
Null
Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ExpressionCompiler (1)
Rewriters\LocalDeclarationRewriter.vb (1)
74
Dim customTypeInfoPayload = New BoundLiteral(syntax, ConstantValue.
Null
, byteArrayType)
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (25)
Semantics\Conversions.vb (17)
338
literal = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(DirectCast(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), VisualBasicSyntaxNode), ConstantValue.
Null
, Nothing), ConversionKind.WideningNothingLiteral, False, True, zero, convertibleType, Nothing)
369
literal = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), ConstantValue.
Null
, Nothing), ConversionKind.WideningNothingLiteral, False, True, zero, type1, Nothing)
626
New BoundLiteral(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), ConstantValue.
Null
, Nothing),
750
Dim zero = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, ConstantValue.Default(mv.Type.GetConstantValueTypeDiscriminator()), mv.Type, Nothing)
776
constant = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(dummyTree.GetVisualBasicRoot(Nothing), ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, doubleValue, doubleType, Nothing)
789
constant = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(dummyTree.GetVisualBasicRoot(Nothing), ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, doubleValue, doubleType, Nothing)
802
constant = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(dummyTree.GetVisualBasicRoot(Nothing), ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, doubleValue, doubleType, Nothing)
815
constant = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(dummyTree.GetVisualBasicRoot(Nothing), ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, doubleValue, doubleType, Nothing)
828
constant = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(dummyTree.GetVisualBasicRoot(Nothing), ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, doubleValue, doubleType, Nothing)
843
constant = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(dummyTree.GetVisualBasicRoot(Nothing), ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, falseValue, booleanType, Nothing)
875
constant = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(dummyTree.GetVisualBasicRoot(Nothing), ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, trueValue, booleanType, Nothing)
938
constant = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(dummyTree.GetVisualBasicRoot(Nothing), ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, v, mv.Type, Nothing)
971
constant = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(dummyTree.GetVisualBasicRoot(Nothing), ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, stringValue, stringType, Nothing)
996
constant = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(dummyTree.GetVisualBasicRoot(Nothing), ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, stringValue, stringType, Nothing)
1019
constant = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(dummyTree.GetVisualBasicRoot(Nothing), ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, stringValue, stringType, Nothing)
1041
constant = New BoundConversion(dummyTree.GetVisualBasicRoot(Nothing), New BoundLiteral(dummyTree.GetVisualBasicRoot(Nothing), ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, charValue, charType, Nothing)
1186
New BoundLiteral(DirectCast(dummyTree.GetRoot(Nothing), VisualBasicSyntaxNode), ConstantValue.
Null
, Nothing),
Semantics\OptionalArgumentTests.vb (2)
2327
Assert.Equal(ConstantValue.
Null
, parameters(1).ExplicitDefaultConstantValue)
2416
Assert.Equal(ConstantValue.
Null
, parameters(1).ExplicitDefaultConstantValue)
Semantics\OverloadResolution.vb (6)
197
Dim longConst As BoundExpression = New BoundConversion(_syntaxNode, New BoundLiteral(_syntaxNode, ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, ConstantValue.Create(-1L), c1.GetSpecialType(System_Int64), Nothing)
202
Dim doubleConst As BoundExpression = New BoundConversion(_syntaxNode, New BoundLiteral(_syntaxNode, ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, ConstantValue.Create(0.0R), c1.GetSpecialType(System_Double), Nothing)
2883
Dim DoubleMaxValue As BoundExpression = New BoundConversion(_syntaxNode, New BoundLiteral(_syntaxNode, ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, ConstantValue.Create(Double.MaxValue), c1.GetSpecialType(System_Double), Nothing)
2884
Dim IntegerMaxValue As BoundExpression = New BoundConversion(_syntaxNode, New BoundLiteral(_syntaxNode, ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, ConstantValue.Create(Integer.MaxValue), c1.GetSpecialType(System_Int32), Nothing)
3074
Dim DoubleMaxValue As BoundExpression = New BoundConversion(_syntaxNode, New BoundLiteral(_syntaxNode, ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, ConstantValue.Create(Double.MaxValue), c1.GetSpecialType(System_Double), Nothing)
3075
Dim IntegerMaxValue As BoundExpression = New BoundConversion(_syntaxNode, New BoundLiteral(_syntaxNode, ConstantValue.
Null
, Nothing), ConversionKind.Widening, True, True, ConstantValue.Create(Integer.MaxValue), c1.GetSpecialType(System_Int32), Nothing)