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