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)
614EmitBoolConstant(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)
9651arguments[1] is { ConstantValueOpt: { SpecialType: SpecialType.System_Boolean, BooleanValue: bool isFromEnd } })
Binder\Binder_Operators.cs (16)
3018return valueLeft.BooleanValue & valueRight.BooleanValue; 3030return valueLeft.BooleanValue | valueRight.BooleanValue; 3042return valueLeft.BooleanValue ^ valueRight.BooleanValue; 3054return valueLeft.BooleanValue && valueRight.BooleanValue; 3056return valueLeft.BooleanValue || valueRight.BooleanValue; 3058return valueLeft.BooleanValue == valueRight.BooleanValue; 3078return valueLeft.BooleanValue != valueRight.BooleanValue; 4550return !value.BooleanValue; 5561if (!isOperatorConstantResult.BooleanValue)
Binder\Binder_Statements.cs (1)
3406var 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 } }: 1675if (node.ConstantValueOpt is { IsBoolean: true, BooleanValue: bool booleanValue } 2690SetConditionalState(isEquals(binary) == rightConstant.BooleanValue 2701if (IsConditionalState && isEquals(binary) != leftConstant.BooleanValue)
FlowAnalysis\NullableWalker.cs (6)
1100if (returnStatement.ExpressionOpt is { ConstantValueOpt: { IsBoolean: true, BooleanValue: bool value } }) 1265if (returnStatement.ExpressionOpt is { ConstantValueOpt: { IsBoolean: true, BooleanValue: bool value } }) 1286else if (returnStatement.ExpressionOpt is { ConstantValueOpt: { IsBoolean: true, BooleanValue: bool value } }) 5253else if (isEquals(binary) && otherOperand.ConstantValueOpt is { IsBoolean: true, BooleanValue: var boolValue }) 5306SetConditionalState(isEquals(binary) == rightConstant.BooleanValue 5316if (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);