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