70 references to IsNull
Microsoft.CodeAnalysis (7)
CodeGen\SwitchIntegralJumpTableEmitter.SwitchBucket.cs (1)
265&& !constant.IsNull
CodeGen\SwitchStringJumpTableEmitter.cs (2)
183(stringConstant.IsString || stringConstant.IsNull)); 201Debug.Assert(stringConstant.IsNull || stringConstant.IsString);
Operations\ControlFlowGraphBuilder.cs (1)
3315ConstantValue? constantValue = operand.GetConstantValue() is { IsNull: var isNull }
SwitchConstantValueHelper.cs (3)
58if (first.IsNull) 63return second.IsNull ? 0 : -1; 65else if (second.IsNull)
Microsoft.CodeAnalysis.CSharp (60)
Binder\Binder_Conversions.cs (1)
3203return sourceConstantValue.IsNull ? sourceConstantValue : null;
Binder\Binder_Invocation.cs (1)
1721else if (defaultConstantValue.IsNull)
Binder\Binder_Operators.cs (9)
2803bool leftIsNull = leftConstant.IsNull; 2804bool rightIsNull = rightConstant.IsNull; 2830if (valueLeft.IsNull) return valueRight.IsNull; 2831if (valueRight.IsNull) return false; 2834if (valueLeft.IsNull) return !valueRight.IsNull; 2835if (valueRight.IsNull) return true; 5356Debug.Assert(constantValue.IsNull);
Binder\Binder_Patterns.cs (1)
691if (inputType.IsNullableType() && (convertedExpression.ConstantValueOpt == null || !convertedExpression.ConstantValueOpt.IsNull))
Binder\ForEachLoopBinder.cs (1)
1205if (collectionExpr.ConstantValueOpt is { IsNull: true })
Binder\PatternExplainer.cs (2)
694!(typeHasExactTypeLiteral(type) && !value.IsNull); 716if (value.IsNull)
Binder\SwitchBinder.cs (1)
280return constantValue.IsNull ? s_nullKey : constantValue.Value;
BoundTree\BoundDecisionDag.cs (3)
185return inputConstant.IsNull; 187return !inputConstant.IsNull; 191return inputConstant.IsNull ? (bool?)false : null;
BoundTree\Formatting.cs (1)
39get { return ConstantValueOpt?.IsNull == true ? MessageID.IDS_NULL.Localize() : base.Display; }
BoundTree\LengthBasedStringSwitchData.cs (2)
144if (inputCase.value.IsNull) 154foreach (var group in inputCases.Where(c => !c.value.IsNull).GroupBy(c => c.value.StringValue!.Length))
CodeGen\EmitExpression.cs (3)
415if (receiverConstant?.IsNull == false) 1522return !constVal.IsNull; 3512if (type is { TypeKind: TypeKind.TypeParameter } && constantValue.IsNull)
CodeGen\EmitOperators.cs (1)
376constant.IsNull)
Compilation\CSharpCompilation.cs (2)
2369if (sourceConstantValue is { IsNull: true } && destination.IsReferenceType) 2380if (result.IsReference && sourceConstantValue is { IsNull: true })
FlowAnalysis\AbstractFlowPass.cs (4)
988case BoundConstantPattern { ConstantValue: { IsNull: false } }: 992case BoundConstantPattern { ConstantValue: { IsNull: true } }: 2620var isNullConstant = binary.Right.ConstantValueOpt?.IsNull == true; 2675var isNullConstant = binary.Left.ConstantValueOpt?.IsNull == true;
FlowAnalysis\NullableWalker.cs (13)
2429if (value.ConstantValueOpt?.IsNull == true && !useLegacyWarnings) 3000isDefaultValue: parameter.ExplicitDefaultConstantValue?.IsNull == true); 5150var isNullConstant = rightOperand.ConstantValueOpt?.IsNull == true; 5234var isNullConstant = leftOperand.ConstantValueOpt?.IsNull == true; 5507if (binary.Right.ConstantValueOpt?.IsNull == true) 5511else if (binary.Left.ConstantValueOpt?.IsNull == true) 6040if (receiver.ConstantValueOpt is { IsNull: false }) 6868if (left.ConstantValueOpt?.IsNull == true) 6874else if (right.ConstantValueOpt?.IsNull == true) 6951if (comparand.ConstantValueOpt?.IsNull == true) 8362return expr.ConstantValueOpt == ConstantValue.NotAvailable || !expr.ConstantValueOpt.IsNull || expr.IsSuppressed ? NullableAnnotation.NotAnnotated : NullableAnnotation.Annotated; 12411SetResultType(node, TypeWithState.Create(node.Type, node.Type?.CanContainNull() != false && node.ConstantValueOpt?.IsNull == true ? NullableFlowState.MaybeDefault : NullableFlowState.NotNull)); 12515if (node.Argument.ConstantValueOpt?.IsNull != true
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
819if ((object)operand.Type == null && operand.ConstantValueOpt != null && operand.ConstantValueOpt.IsNull)
Lowering\DiagnosticsPass_Warnings.cs (2)
330if (node.Left.Type.SpecialType == SpecialType.System_Object && !IsExplicitCast(node.Left) && !(node.Left.ConstantValueOpt != null && node.Left.ConstantValueOpt.IsNull) && ConvertedHasEqual(node.OperatorKind, node.Right, out t)) 335else if (node.Right.Type.SpecialType == SpecialType.System_Object && !IsExplicitCast(node.Right) && !(node.Right.ConstantValueOpt != null && node.Right.ConstantValueOpt.IsNull) && ConvertedHasEqual(node.OperatorKind, node.Left, out t))
Lowering\LocalRewriter\LocalRewriter_AsOperator.cs (1)
60Debug.Assert(constantValue.IsNull);
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (2)
2109return MakeLiteral(syntax, ConstantValue.Create(rewrittenExpr.ConstantValueOpt.IsNull, ConstantValueTypeDiscriminator.Boolean), boolType); 2111return MakeLiteral(syntax, ConstantValue.Create(!rewrittenExpr.ConstantValueOpt.IsNull, ConstantValueTypeDiscriminator.Boolean), boolType);
Lowering\LocalRewriter\LocalRewriter_IsOperator.cs (1)
51Debug.Assert(operandType is { } || rewrittenOperand.ConstantValueOpt!.IsNull);
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (1)
75Debug.Assert(!rewrittenLeft.ConstantValueOpt.IsNull);
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (2)
314case { IsNull: true } or { IsString: true, RopeValue.IsEmpty: true }: 598else if (cv.IsNull)
Lowering\SyntheticBoundNodeFactory.cs (3)
1156Debug.Assert(stringConst.IsString || stringConst.IsNull); 1781return Literal(ConstantValue.Create(rewrittenExpr.ConstantValueOpt.IsNull, ConstantValueTypeDiscriminator.Boolean), boolType); 1783return Literal(ConstantValue.Create(rewrittenExpr.ConstantValueOpt.IsNull, ConstantValueTypeDiscriminator.Boolean), boolType);
Symbols\ConstantValueUtils.cs (1)
110!unconvertedConstantValue.IsNull &&
Utilities\ValueSetFactory.EnumeratedValueSetFactory.cs (1)
39value.IsBad || value.IsNull ? EnumeratedValueSet<T>.AllValues(_tc) : this.Related(relation, _tc.FromConstantValue(value));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (3)
Semantics\StructConstructorTests.cs (3)
3555Assert.True(g1.Parameters[0].ExplicitDefaultConstantValue.IsNull); 3560Assert.True(g2.Parameters[0].ExplicitDefaultConstantValue.IsNull); 3582Assert.False(g1.Parameters[0].ExplicitDefaultConstantValue.IsNull);