2 overrides of BooleanValue
Microsoft.CodeAnalysis (2)
ConstantValueSpecialized.cs (2)
377public override bool BooleanValue 555public override bool BooleanValue
46 references to BooleanValue
Microsoft.CodeAnalysis (5)
CodeGen\ILBuilderEmit.cs (1)
611EmitBoolConstant(value.BooleanValue);
ConstantValue.cs (3)
532case ConstantValueTypeDiscriminator.Boolean: return Boxes.Box(BooleanValue); 761writer.WriteBoolean(this.BooleanValue); 828ConstantValueTypeDiscriminator.Boolean => BooleanValue.ToString(provider),
Operations\ControlFlowGraphBuilder.cs (1)
276if (current.BranchValue.GetConstantValue() is { IsBoolean: true, BooleanValue: bool constant })
Microsoft.CodeAnalysis.CSharp (38)
Binder\Binder_Expressions.cs (1)
9638arguments[1] is { ConstantValueOpt: { SpecialType: SpecialType.System_Boolean, BooleanValue: bool isFromEnd } })
Binder\Binder_Operators.cs (16)
2885return valueLeft.BooleanValue & valueRight.BooleanValue; 2897return valueLeft.BooleanValue | valueRight.BooleanValue; 2909return valueLeft.BooleanValue ^ valueRight.BooleanValue; 2921return valueLeft.BooleanValue && valueRight.BooleanValue; 2923return valueLeft.BooleanValue || valueRight.BooleanValue; 2925return valueLeft.BooleanValue == valueRight.BooleanValue; 2945return valueLeft.BooleanValue != valueRight.BooleanValue; 4372return !value.BooleanValue; 5383if (!isOperatorConstantResult.BooleanValue)
Binder\Binder_Statements.cs (1)
3374var errorCode = boundFilter.ConstantValueOpt.BooleanValue
CodeGen\EmitOperators.cs (2)
502var constant = constantValue.BooleanValue; 536_builder.EmitBoolConstant(constantValue.BooleanValue == sense);
FlowAnalysis\AbstractFlowPass.cs (4)
1033case BoundConstantPattern { ConstantValue: { IsBoolean: true, BooleanValue: var boolValue } }: 1674if (node.ConstantValueOpt is { IsBoolean: true, BooleanValue: bool booleanValue } 2688SetConditionalState(isEquals(binary) == rightConstant.BooleanValue 2699if (IsConditionalState && isEquals(binary) != leftConstant.BooleanValue)
FlowAnalysis\NullableWalker.cs (6)
1077if (returnStatement.ExpressionOpt is { ConstantValueOpt: { IsBoolean: true, BooleanValue: bool value } }) 1242if (returnStatement.ExpressionOpt is { ConstantValueOpt: { IsBoolean: true, BooleanValue: bool value } }) 1263else if (returnStatement.ExpressionOpt is { ConstantValueOpt: { IsBoolean: true, BooleanValue: bool value } }) 5195else if (isEquals(binary) && otherOperand.ConstantValueOpt is { IsBoolean: true, BooleanValue: var boolValue }) 5248SetConditionalState(isEquals(binary) == rightConstant.BooleanValue 5258if (IsConditionalState && isEquals(binary) != leftConstant.BooleanValue)
Lowering\LocalRewriter\LocalRewriter_TryStatement.cs (1)
80if (node.ExceptionFilterOpt?.ConstantValueOpt?.BooleanValue == false)
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (2)
96return _factory.Literal(constant.BooleanValue); 98return MakeConversionNode(_factory.Literal(!constant.BooleanValue), type, @checked: false);
Utilities\ValueSetFactory.BoolValueSet.cs (2)
56bool IValueSet.Any(BinaryOperatorKind relation, ConstantValue value) => value.IsBad || Any(relation, value.BooleanValue); 71bool IValueSet.All(BinaryOperatorKind relation, ConstantValue value) => !value.IsBad && All(relation, value.BooleanValue);
Utilities\ValueSetFactory.BoolValueSetFactory.cs (3)
55return value.IsBad ? BoolValueSet.AllValues : Related(relation, value.BooleanValue); 61return left.IsBad || right.IsBad || left.BooleanValue == right.BooleanValue;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\StructConstructorTests.cs (1)
3587Assert.False(g2.Parameters[0].ExplicitDefaultConstantValue.BooleanValue);
Microsoft.CodeAnalysis.UnitTests (2)
CorLibTypesTests.cs (2)
107Assert.Throws<InvalidOperationException>(() => { var c = cvNull.BooleanValue; }); 123Assert.True(cv1.BooleanValue);