51 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)
3784return ConstantValue.Null;
Operations\ControlFlowGraphBuilder.cs (1)
3469? ConstantValue.Null
Microsoft.CodeAnalysis.CSharp (40)
Binder\Binder_Await.cs (1)
632var receiver = new BoundLiteral(node, ConstantValue.Null, awaiterType);
Binder\Binder_Expressions.cs (3)
7551cv = ConstantValue.Null; 7993if (boundLeft.Kind == BoundKind.Literal && ((BoundLiteral)boundLeft).ConstantValueOpt == ConstantValue.Null) 8167if ((boundLeft is BoundDefaultLiteral || boundLeft is BoundDefaultExpression) && boundLeft.ConstantValueOpt == ConstantValue.Null &&
Binder\Binder_Invocation.cs (1)
1685{ IsBad: true } => ConstantValue.Null,
Binder\Binder_Operators.cs (6)
4968if (operand.ConstantValueOpt == ConstantValue.Null || 5107if (operandConstantValue == ConstantValue.Null) 5117(operandConstantValue == null || operandConstantValue == ConstantValue.Null); // a non-null constant is never null 5473operand = new BoundDefaultExpression(operand.Syntax, targetType: null, constantValueOpt: ConstantValue.Null, 5617/// - <see cref="ConstantValue.Null"/> 5643return ConstantValue.Null;
Binder\Binder_Patterns.cs (4)
943return unionMatchingInputType is not null && constantValueOpt == ConstantValue.Null && (unionMatchingInputType.IsNullableType() || !unionMatchingInputType.IsValueType); 1076if (convertedExpression.Type is null && constantValueOpt != ConstantValue.Null) 1106if (expression.ConstantValueOpt == ConstantValue.Null) 1170if (constantValue == ConstantValue.Null)
Binder\DecisionDagBuilder.cs (1)
863if (constant.ConstantValue == ConstantValue.Null)
Binder\DecisionDagBuilder_CheckOrReachability.cs (2)
1098new BoundLiteral(node.Syntax, constantValueOpt: ConstantValue.Null, type: node.InputType, hasErrors: false), 1099ConstantValue.Null, isUnionMatching: false, node.InputType, node.InputType, hasErrors: false);
Binder\LockBinder.cs (1)
46if (expr.ConstantValueOpt != ConstantValue.Null || Compilation.FeatureStrictEnabled) // Dev10 allows the null literal.
BoundTree\BoundConstantPattern.cs (1)
18(ConstantValue == ConstantValue.Null && (InputType.IsNullableType() || !InputType.IsValueType) && NarrowedType.Equals(InputType, TypeCompareKind.AllIgnoreOptions)));
CodeGen\EmitStatement.cs (1)
1591if (stringConstant == ConstantValue.Null)
Compilation\CSharpCompilation.cs (1)
2288var dumbInstance = new BoundLiteral(syntax, ConstantValue.Null, namedType);
FlowAnalysis\AbstractFlowPass.cs (1)
688return node.ConstantValueOpt == ConstantValue.Null;
FlowAnalysis\DefiniteAssignment.cs (1)
860return value.ConstantValueOpt != ConstantValue.Null;
FlowAnalysis\NullableWalker_Patterns.cs (2)
170bool isExplicitNullCheck = cp.Value.ConstantValueOpt == ConstantValue.Null; 580Debug.Assert(t.Value != ConstantValue.Null);
Lowering\Extensions.cs (1)
80if ((object)expr.Type == null && expr.ConstantValueOpt == ConstantValue.Null)
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
408_factory.Convert(operandType, new BoundLiteral(syntax, ConstantValue.Null, objectType), Conversion.NullToPointer),
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (3)
2016if (oldNode != null && (loweredLeft.ConstantValueOpt == ConstantValue.Null || loweredRight.ConstantValueOpt == ConstantValue.Null)) 2135MakeLiteral(syntax, ConstantValue.Null, objectType),
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
464right: 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)
209return 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)
1271BoundExpression nullLiteral = new BoundLiteral(syntax, ConstantValue.Null, type) { WasCompilerGenerated = true }; 1804return RewriteNullableNullEquality(syntax, operatorKind, rewrittenExpr, Literal(ConstantValue.Null, objectType), boolType);
Symbols\Source\SourceComplexParameterSymbol.cs (1)
418var value = convertedExpression.ConstantValueOpt ?? ConstantValue.Null;
Symbols\TypeSymbolExtensions.cs (1)
678return ConstantValue.Null;