58 references to Null
Microsoft.CodeAnalysis (11)
CodeGen\SwitchIntegralJumpTableEmitter.cs (1)
116if (sortedCaseLabels[0].Key != ConstantValue.Null)
ConstantValue.cs (5)
93public static ConstantValue Nothing { get { return Null; } } 105return Null; 372case ConstantValueTypeDiscriminator.Null: return Null; 430case ConstantValueTypeDiscriminator.String: return Null; 744return 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)
3757return ConstantValue.Null;
Operations\ControlFlowGraphBuilder.cs (1)
3459? ConstantValue.Null
Microsoft.CodeAnalysis.CSharp (36)
Binder\Binder_Await.cs (1)
370var receiver = new BoundLiteral(node, ConstantValue.Null, awaiterType);
Binder\Binder_Expressions.cs (3)
7363cv = ConstantValue.Null; 7771if (boundLeft.Kind == BoundKind.Literal && ((BoundLiteral)boundLeft).ConstantValueOpt == ConstantValue.Null) 7944if ((boundLeft is BoundDefaultLiteral || boundLeft is BoundDefaultExpression) && boundLeft.ConstantValueOpt == ConstantValue.Null &&
Binder\Binder_Invocation.cs (1)
1675{ IsBad: true } => ConstantValue.Null,
Binder\Binder_Operators.cs (6)
4715if (operand.ConstantValueOpt == ConstantValue.Null || 4855if (operandConstantValue == ConstantValue.Null) 4865(operandConstantValue == null || operandConstantValue == ConstantValue.Null); // a non-null constant is never null 5220operand = new BoundDefaultExpression(operand.Syntax, targetType: null, constantValueOpt: ConstantValue.Null, 5364/// - <see cref="ConstantValue.Null"/> 5390return ConstantValue.Null;
Binder\Binder_Patterns.cs (3)
579if (convertedExpression.Type is null && constantValueOpt != ConstantValue.Null) 608if (expression.ConstantValueOpt == ConstantValue.Null) 672if (constantValue == ConstantValue.Null)
Binder\DecisionDagBuilder.cs (1)
487if (constant.ConstantValue == ConstantValue.Null)
Binder\LockBinder.cs (1)
46if (expr.ConstantValueOpt != ConstantValue.Null || Compilation.FeatureStrictEnabled) // Dev10 allows the null literal.
CodeGen\EmitStatement.cs (1)
1564if (stringConstant == ConstantValue.Null)
Compilation\CSharpCompilation.cs (1)
2214var dumbInstance = new BoundLiteral(syntax, ConstantValue.Null, namedType);
FlowAnalysis\AbstractFlowPass.cs (1)
687return node.ConstantValueOpt == ConstantValue.Null;
FlowAnalysis\DefiniteAssignment.cs (1)
909return value.ConstantValueOpt != ConstantValue.Null;
FlowAnalysis\NullableWalker_Patterns.cs (2)
167bool isExplicitNullCheck = cp.Value.ConstantValueOpt == ConstantValue.Null; 631Debug.Assert(t.Value != ConstantValue.Null);
Lowering\Extensions.cs (1)
80if ((object)expr.Type == null && expr.ConstantValueOpt == ConstantValue.Null)
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
383_factory.Convert(operandType, new BoundLiteral(syntax, ConstantValue.Null, objectType)),
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (3)
2015if (oldNode != null && (loweredLeft.ConstantValueOpt == ConstantValue.Null || loweredRight.ConstantValueOpt == ConstantValue.Null)) 2134MakeLiteral(syntax, ConstantValue.Null, objectType),
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
454right: MakeLiteral(forEachSyntax, constantValue: ConstantValue.Null, type: null),
Lowering\LocalRewriter\LocalRewriter_LockStatement.cs (1)
35Debug.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)
128if (rewrittenExpression.ConstantValueOpt == ConstantValue.Null) 230if (boundLocal.ConstantValueOpt == ConstantValue.Null)
Lowering\SyntheticBoundNodeFactory.cs (2)
1250BoundExpression nullLiteral = new BoundLiteral(syntax, ConstantValue.Null, type) { WasCompilerGenerated = true }; 1803return RewriteNullableNullEquality(syntax, operatorKind, rewrittenExpr, Literal(ConstantValue.Null, objectType), boolType);
Symbols\Source\SourceComplexParameterSymbol.cs (1)
412var value = convertedExpression.ConstantValueOpt ?? ConstantValue.Null;
Symbols\TypeSymbolExtensions.cs (1)
638return ConstantValue.Null;
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (1)
CodeGen\CodeGenOverridingAndHiding.cs (1)
4123Assert.Equal(ConstantValue.Null, parameterB.ExplicitDefaultConstantValue);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (1)
Attributes\AttributeTests_WellKnownAttributes.cs (1)
532Assert.Equal(ConstantValue.Null, constantValue);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (6)
Semantics\ConstantTests.cs (1)
4025nullConst = 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,