15 overrides of ConstantValueOpt
Microsoft.CodeAnalysis.CSharp (15)
BoundTree\BoundExpression.cs (3)
214public override ConstantValue? ConstantValueOpt 355public override ConstantValue? ConstantValueOpt => Data?.ConstantValue; 529public override ConstantValue? ConstantValueOpt
Generated\BoundNodes.xml.Generated.cs (12)
1189public override ConstantValue? ConstantValueOpt { get; } 1972public override ConstantValue? ConstantValueOpt { get; } 2015public override ConstantValue? ConstantValueOpt { get; } 2717public override ConstantValue? ConstantValueOpt { get; } 2821public override ConstantValue? ConstantValueOpt { get; } 2863public override ConstantValue? ConstantValueOpt { get; } 4201public override ConstantValue? ConstantValueOpt { get; } 4423public override ConstantValue? ConstantValueOpt { get; } 6258public override ConstantValue? ConstantValueOpt { get; } 7006public override ConstantValue? ConstantValueOpt { get; } 7439public override ConstantValue ConstantValueOpt { get; } 7469public override ConstantValue? ConstantValueOpt { get; }
274 references to ConstantValueOpt
Microsoft.CodeAnalysis.CSharp (270)
Binder\Binder.ValueChecks.cs (5)
556if ((expr.ConstantValueOpt != null) || (expr.Type.GetSpecialTypeSafe() == SpecialType.System_Void)) 2927if (expr.ConstantValueOpt != null) 3171if (expr.ConstantValueOpt != null) 3479if (expr.ConstantValueOpt != null) 3886if (expr.ConstantValueOpt != null)
Binder\Binder_Attributes.cs (1)
944ConstantValue? constantValue = node.ConstantValueOpt;
Binder\Binder_Conversions.cs (4)
166convertedSwitch.ConstantValueOpt, 181convertedConditional.ConstantValueOpt, 368expr.ConstantValueOpt, 1565var sourceConstantValue = source.ConstantValueOpt;
Binder\Binder_Expressions.cs (6)
2685if (underlyingExpr.ConstantValueOpt != null && 4009var constantValue = expression.ConstantValueOpt; 4028var constantValue = expression.ConstantValueOpt; 6808if ((boundLeft is BoundDefaultLiteral || boundLeft is BoundDefaultExpression) && boundLeft.ConstantValueOpt == ConstantValue.Null && 7573constantValueOpt: expr.ConstantValueOpt, 8016ConstantValue constant = index.ConstantValueOpt;
Binder\Binder_InterpolatedString.cs (5)
102var alignmentConstant = alignment.ConstantValueOpt; 142value.ConstantValueOpt == null || 144!(value.ConstantValueOpt is { IsString: true, IsBad: false })) 150? value.ConstantValueOpt 151: FoldStringConcatenation(BinaryOperatorKind.StringConcatenation, resultConstant, value.ConstantValueOpt);
Binder\Binder_Operators.cs (11)
1774var valueLeft = left.ConstantValueOpt; 1775var valueRight = right.ConstantValueOpt; 1919ConstantValue? leftConstant = leftConv.Operand.ConstantValueOpt; 1920ConstantValue? rightConstant = rightConv.Operand.ConstantValueOpt; 2814var value = operand.ConstantValueOpt; 3245if (operand.ConstantValueOpt == ConstantValue.Null || 3287ReportIsOperatorDiagnostics(node, diagnostics, operandType, targetType, conversion.Kind, operand.ConstantValueOpt); 3754bool hasErrors = ReportAsOperatorConversionDiagnostics(node, diagnostics, this.Compilation, operandType, targetType, conversion.Kind, operand.ConstantValueOpt); 4331ConstantValue trueValue = trueExpr.ConstantValueOpt; 4337ConstantValue falseValue = falseExpr.ConstantValueOpt; 4343ConstantValue conditionValue = condition.ConstantValueOpt;
Binder\Binder_Patterns.cs (9)
96else if (expression.ConstantValueOpt != null) 595if (!hasErrors && expression.ConstantValueOpt is object) 598if (expression.ConstantValueOpt == ConstantValue.Null) 661constantValue = convertedExpression.ConstantValueOpt; 681if (inputType.IsNullableType() && (convertedExpression.ConstantValueOpt == null || !convertedExpression.ConstantValueOpt.IsNull)) 688&& operand.ConstantValueOpt != null && convertedExpression.ConstantValueOpt == null) 705constantValue = convertedExpression.ConstantValueOpt;
Binder\Binder_Statements.cs (4)
2396GenerateImplicitConversionError(diagnostics, this.Compilation, syntax, conversion, sourceType, targetType, operand.ConstantValueOpt); 2585if (assignment.Right.Kind == BoundKind.Literal && assignment.Right.ConstantValueOpt.Discriminator == ConstantValueTypeDiscriminator.Boolean) 3253if (boundFilter.ConstantValueOpt != ConstantValue.NotAvailable) 3257var errorCode = boundFilter.ConstantValueOpt.BooleanValue
Binder\DecisionDagBuilder.cs (1)
1856public bool IsFullyMatched => RemainingTests is Tests.True && (WhenClause is null || WhenClause.ConstantValueOpt == ConstantValue.True);
Binder\ForEachLoopBinder.cs (1)
1001if (collectionExpr.ConstantValueOpt is { IsNull: true })
Binder\LockBinder.cs (1)
46if (expr.ConstantValueOpt != ConstantValue.Null || Compilation.FeatureStrictEnabled) // Dev10 allows the null literal.
Binder\Semantics\Conversions\ConversionsBase.cs (2)
1276var constantValue = source.ConstantValueOpt; 1385var sourceConstantValue = source.ConstantValueOpt;
Binder\Semantics\Operators\BinaryOperatorEasyOut.cs (2)
340if (left.ConstantValueOpt == null && right.ConstantValueOpt == null)
BoundTree\BoundDecisionDag.cs (2)
140if (input.ConstantValueOpt == null) 146ConstantValue inputConstant = input.ConstantValueOpt;
BoundTree\BoundExpression.cs (1)
218Debug.Assert(Expression.ConstantValueOpt == null);
BoundTree\BoundExpressionExtensions.cs (2)
65return node is { Kind: BoundKind.Literal, ConstantValueOpt: { Discriminator: ConstantValueTypeDiscriminator.Null } }; 96var constValue = node.ConstantValueOpt;
CodeGen\EmitArrayInitializer.cs (9)
107return includeConstants || init.ConstantValueOpt == null; 217ConstantValue initConstantValueOpt = init.ConstantValueOpt; 316if (init.ConstantValueOpt != null) 498if (start.ConstantValueOpt?.IsDefaultValue != true || start.ConstantValueOpt.Discriminator != ConstantValueTypeDiscriminator.Int32) 505if (length.ConstantValueOpt?.Discriminator != ConstantValueTypeDiscriminator.Int32) 510lengthForConstructor = length.ConstantValueOpt.Int32Value; 730if (initializers.Any(static init => init.ConstantValueOpt == null)) 746init.ConstantValueOpt.Serialize(writer);
CodeGen\EmitConversion.cs (1)
202if (conversion.Operand.ConstantValueOpt == null)
CodeGen\EmitExpression.cs (5)
42var constantValue = expression.ConstantValueOpt; 399var receiverConstant = receiver.ConstantValueOpt; 1478var constVal = receiver.ConstantValueOpt; 1903if (current.ConstantValueOpt != null) 2386if (rightType.IsReferenceType || (right.ConstantValueOpt != null && rightType.SpecialType != SpecialType.System_Decimal))
CodeGen\EmitOperators.cs (5)
94if (child.Kind != BoundKind.BinaryOperator || child.ConstantValueOpt != null) 118if (child.Kind != BoundKind.BinaryOperator || child.ConstantValueOpt != null) 360var constant = binOp.Left.ConstantValueOpt; 365constant = comparand.ConstantValueOpt; 484var constantValue = condition.ConstantValueOpt;
CodeGen\EmitStackAllocInitializer.cs (2)
116if (init.ConstantValueOpt != null) 129if (includeConstants || init.ConstantValueOpt == null)
CodeGen\EmitStatement.cs (7)
236BoundExpression constOp = (condition.Left.ConstantValueOpt != null) ? condition.Left : null; 244constOp = (condition.Right.ConstantValueOpt != null) ? condition.Right : null; 259bool isZero = constOp.ConstantValueOpt.IsDefaultValue; 399if (condition.ConstantValueOpt != null) 401bool taken = condition.ConstantValueOpt.IsDefaultValue != sense; 443else if (top.condition.ConstantValueOpt is null && 1229Debug.Assert(expression.ConstantValueOpt == null);
CodeGen\Optimizer.cs (6)
469var result = node.ConstantValueOpt == null ? 1410if (child.Kind != BoundKind.BinaryOperator || child.ConstantValueOpt != null) 1426if (child.Kind != BoundKind.BinaryOperator || child.ConstantValueOpt != null) 1986if (asExpression != null && asExpression.ConstantValueOpt != null) 2004if (child.Kind != BoundKind.BinaryOperator || child.ConstantValueOpt != null) 2020if (child.Kind != BoundKind.BinaryOperator || child.ConstantValueOpt != null)
Compilation\MemberSemanticModel.cs (1)
1254ConstantValue constantValue = boundExpr.ConstantValueOpt;
FlowAnalysis\AbstractFlowPass.cs (11)
671return node.ConstantValueOpt == ConstantValue.True; 676return node.ConstantValueOpt == ConstantValue.False; 681return node.ConstantValueOpt == ConstantValue.Null; 1571if (node.ConstantValueOpt is { IsBoolean: true, BooleanValue: bool booleanValue }) 2399var isNullConstant = binary.Right.ConstantValueOpt?.IsNull == true; 2438return expr.ConstantValueOpt is object 2452var isNullConstant = binary.Left.ConstantValueOpt?.IsNull == true; 2460else if (IsConditionalState && binary.Right.ConstantValueOpt is { IsBoolean: true } rightConstant) 2472else if (binary.Left.ConstantValueOpt is { IsBoolean: true } leftConstant) 2758if (node.LeftOperand.ConstantValueOpt != null) 2858if (node.Receiver.ConstantValueOpt != null && !IsConstantNull(node.Receiver))
FlowAnalysis\AbstractFlowPass_Switch.cs (2)
52label == node.DefaultLabel && node.Expression.ConstantValueOpt == null && IsTraditionalSwitch(node)) 75(node.DefaultLabel == null && node.Expression.ConstantValueOpt == null && IsTraditionalSwitch(node)))
FlowAnalysis\DefiniteAssignment.cs (2)
878return value.ConstantValueOpt != ConstantValue.Null; 891if (value is { ConstantValueOpt: not null, Kind: not BoundKind.InterpolatedString }) return false;
FlowAnalysis\NullableWalker.cs (23)
774if (returnStatement.ExpressionOpt is { ConstantValueOpt: { IsBoolean: true, BooleanValue: bool value } }) 798else if (returnStatement.ExpressionOpt is { ConstantValueOpt: { IsBoolean: true, BooleanValue: bool value } }) 1113if (returnStatement.ExpressionOpt is { ConstantValueOpt: { IsBoolean: true, BooleanValue: bool value } }) 1134else if (returnStatement.ExpressionOpt is { ConstantValueOpt: { IsBoolean: true, BooleanValue: bool value } }) 2258if (value.ConstantValueOpt?.IsNull == true && !useLegacyWarnings) 4499var isNullConstant = rightOperand.ConstantValueOpt?.IsNull == true; 4541|| expr.ConstantValueOpt is object; 4551else if (isEquals(binary) && otherOperand.ConstantValueOpt is { IsBoolean: true, BooleanValue: var boolValue }) 4583var isNullConstant = leftOperand.ConstantValueOpt?.IsNull == true; 4598if (IsConditionalState && binary.Right.ConstantValueOpt is { IsBoolean: true } rightConstant) 4609else if (binary.Left.ConstantValueOpt is { IsBoolean: true } leftConstant) 4780if (binary.Right.ConstantValueOpt?.IsNull == true) 4784else if (binary.Left.ConstantValueOpt?.IsNull == true) 4989if (expression.ConstantValueOpt != null) 5143bool leftIsConstant = leftOperand.ConstantValueOpt != null; 5298if (receiver.ConstantValueOpt is { IsNull: false }) 5855if (left.ConstantValueOpt?.IsNull == true) 5861else if (right.ConstantValueOpt?.IsNull == true) 5938if (comparand.ConstantValueOpt?.IsNull == true) 7097return expr.ConstantValueOpt == ConstantValue.NotAvailable || !expr.ConstantValueOpt.IsNull || expr.IsSuppressed ? NullableAnnotation.NotAnnotated : NullableAnnotation.Annotated; 7292if (value.Type is null || value.Type.IsDynamic() || value.ConstantValueOpt != null) 10779if (node.Argument.ConstantValueOpt?.IsNull != true
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
255if (node.WhenClause?.ConstantValueOpt != ConstantValue.True)
FlowAnalysis\NullableWalker_Patterns.cs (2)
145bool isExplicitNullCheck = cp.Value.ConstantValueOpt == ConstantValue.Null; 665if (w.WhenExpression != null && w.WhenExpression.ConstantValueOpt != ConstantValue.True)
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (2)
740if ((object)operand.Type == null && operand.ConstantValueOpt != null && operand.ConstantValueOpt.IsNull)
Lowering\DiagnosticsPass_Warnings.cs (12)
317if (node.Left.ConstantValueOpt != null && node.Right.ConstantValueOpt == null && node.Right.Kind == BoundKind.Conversion) 319CheckVacuousComparisons(node, node.Left.ConstantValueOpt, node.Right); 322if (node.Right.ConstantValueOpt != null && node.Left.ConstantValueOpt == null && node.Left.Kind == BoundKind.Conversion) 324CheckVacuousComparisons(node, node.Right.ConstantValueOpt, node.Left); 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)) 528if (node.ConstantValueOpt != null) 586ConstantValue constVal = operand.ConstantValueOpt;
Lowering\Extensions.cs (1)
80if ((object)expr.Type == null && expr.ConstantValueOpt == ConstantValue.Null)
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (1)
205var valueExpression = (condition.ConstantValueOpt == null) ?
Lowering\LocalRewriter\LocalRewriter.cs (2)
225ConstantValue? constantValue = node.ConstantValueOpt; 890if (expr.ConstantValueOpt != null)
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (3)
144if (node is BoundExpression { ConstantValueOpt: { } }) 1009if (whenExpression is not null && whenExpression.ConstantValueOpt != ConstantValue.True) 1161if (whenClause.WhenExpression != null && whenClause.WhenExpression.ConstantValueOpt != ConstantValue.True)
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
516.Any(static node => node is BoundWhenDecisionDagNode { WhenExpression: { ConstantValueOpt: null } });
Lowering\LocalRewriter\LocalRewriter_AsOperator.cs (2)
51ConstantValue constantValue = Binder.GetAsOperatorConstantResult(rewrittenOperand.Type, rewrittenType, conversion.Kind, rewrittenOperand.ConstantValueOpt); 63if (rewrittenOperand.ConstantValueOpt != null)
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (39)
278if (loweredRight.ConstantValueOpt == ConstantValue.True) return loweredLeft; 279if (loweredLeft.ConstantValueOpt == ConstantValue.True) return loweredRight; 280if (loweredLeft.ConstantValueOpt == ConstantValue.False) return loweredLeft; 290if (loweredRight.ConstantValueOpt == ConstantValue.False) return loweredLeft; 291if (loweredLeft.ConstantValueOpt == ConstantValue.False) return loweredRight; 292if (loweredLeft.ConstantValueOpt == ConstantValue.True) return loweredLeft; 302if (loweredRight.ConstantValueOpt == ConstantValue.True) return loweredLeft; 303if (loweredLeft.ConstantValueOpt == ConstantValue.True) return loweredRight; 323if (loweredRight.ConstantValueOpt == ConstantValue.False) return loweredLeft; 324if (loweredLeft.ConstantValueOpt == ConstantValue.False) return loweredRight; 328if (loweredLeft.ConstantValueOpt == ConstantValue.True) return loweredRight; 329if (loweredRight.ConstantValueOpt == ConstantValue.True) return loweredLeft; 333if (loweredLeft.ConstantValueOpt == ConstantValue.False) 336if (loweredRight.ConstantValueOpt == ConstantValue.False) 342if (loweredLeft.ConstantValueOpt == ConstantValue.False) return loweredRight; 343if (loweredRight.ConstantValueOpt == ConstantValue.False) return loweredLeft; 347if (loweredLeft.ConstantValueOpt == ConstantValue.True) 350if (loweredRight.ConstantValueOpt == ConstantValue.True) 356if (loweredLeft.ConstantValueOpt == ConstantValue.False) return loweredRight; 357if (loweredRight.ConstantValueOpt == ConstantValue.False) return loweredLeft; 361if (loweredLeft.ConstantValueOpt == ConstantValue.True) 364if (loweredRight.ConstantValueOpt == ConstantValue.True) 469if (loweredLeft.ConstantValueOpt?.UInt64Value == 1) 473if (loweredRight.ConstantValueOpt?.UInt64Value == 1) 623ConstantValue? constantLeft = loweredLeft.ConstantValueOpt ?? UnboxConstant(loweredLeft); 716return conversion.Operand.ConstantValueOpt; 1308if (sideEffect.ConstantValueOpt != null) 1527if (nonNullRight != null && nonNullRight.ConstantValueOpt != null && left.Kind == BoundKind.Sequence) 1917if (oldNode != null && (loweredLeft.ConstantValueOpt == ConstantValue.Null || loweredRight.ConstantValueOpt == ConstantValue.Null)) 2006if (rewrittenExpr.ConstantValueOpt != null) 2011return MakeLiteral(syntax, ConstantValue.Create(rewrittenExpr.ConstantValueOpt.IsNull, ConstantValueTypeDiscriminator.Boolean), boolType); 2013return MakeLiteral(syntax, ConstantValue.Create(!rewrittenExpr.ConstantValueOpt.IsNull, ConstantValueTypeDiscriminator.Boolean), boolType); 2056ConstantValue? rightConstantValue = loweredRight.ConstantValueOpt; 2128ConstantValue? rightConstantValue = loweredRight.ConstantValueOpt; 2228if (numericOperand.ConstantValueOpt?.UInt64Value == 1) 2239if (sizeOfExpression.ConstantValueOpt?.Int32Value == 1) 2260var constVal = numericOperand.ConstantValueOpt; 2271var constVal = numericOperand.ConstantValueOpt;
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
312if (current.ConstantValueOpt != null)
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (4)
723return MakeEventAccess(eventAccess.Syntax, receiverOpt, eventAccess.EventSymbol, eventAccess.ConstantValueOpt, eventAccess.ResultKind, eventAccess.Type); 761constantValueOpt: rewrittenReceiver.ConstantValueOpt); 819if (expression.ConstantValueOpt != null) 856if (expression.ConstantValueOpt != null)
Lowering\LocalRewriter\LocalRewriter_ConditionalOperator.cs (2)
27if (rewrittenCondition.ConstantValueOpt == null) 51ConstantValue? conditionConstantValue = rewrittenCondition.ConstantValueOpt;
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (1)
214if (rewrittenNode.ConstantValueOpt != null)
Lowering\LocalRewriter\LocalRewriter_Event.cs (1)
207return MakeEventAccess(node.Syntax, rewrittenReceiver, node.EventSymbol, node.ConstantValueOpt, node.ResultKind, node.Type);
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (10)
305if (makeOffsetInput.ConstantValueOpt is null && lengthAccess.Kind is not BoundKind.ArrayLength) 404if (loweredExpr.ConstantValueOpt?.Int32Value == 0) 474arguments[0] is { Type.SpecialType: SpecialType.System_Int32, ConstantValueOpt.Value: int _ and >= 0 } index && 475arguments[1] is { Type.SpecialType: SpecialType.System_Boolean, ConstantValueOpt.Value: bool fromEnd }) 699if (startMakeOffsetInput.ConstantValueOpt is null) 710if (endMakeOffsetInput.ConstantValueOpt is null) 736if ((rewriteFlags & captureStartValue) != 0 && startExpr.ConstantValueOpt is null) 746if (startExpr.ConstantValueOpt?.Int32Value == 0) 750else if (startExpr.ConstantValueOpt is { Int32Value: var startConst } && endExpr.ConstantValueOpt is { Int32Value: var endConst })
Lowering\LocalRewriter\LocalRewriter_IsOperator.cs (2)
51Debug.Assert(operandType is { } || rewrittenOperand.ConstantValueOpt!.IsNull); 58ConstantValue constantValue = Binder.GetIsOperatorConstantResult(operandType, targetType, conversionKind, rewrittenOperand.ConstantValueOpt);
Lowering\LocalRewriter\LocalRewriter_LockStatement.cs (3)
32Debug.Assert(rewrittenArgument.ConstantValueOpt == ConstantValue.Null); 36rewrittenArgument.ConstantValueOpt, 52constantValueOpt: rewrittenArgument.ConstantValueOpt);
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (3)
75if (rewrittenLeft.ConstantValueOpt != null) 77Debug.Assert(!rewrittenLeft.ConstantValueOpt.IsNull); 170Debug.Assert(conditionalExpression.ConstantValueOpt == null); // we shouldn't have hit this else case otherwise
Lowering\LocalRewriter\LocalRewriter_PatternSwitchStatement.cs (1)
82if (loweredSwitchGoverningExpression.ConstantValueOpt == null)
Lowering\LocalRewriter\LocalRewriter_StackAlloc.cs (3)
31if (rewrittenCount.ConstantValueOpt?.Int32Value == 0) 119var sizeConst = sizeOfExpression.ConstantValueOpt; 126var countConst = countExpression.ConstantValueOpt;
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (9)
52Debug.Assert(loweredLeft.Type is { } && (loweredLeft.Type.IsStringType() || loweredLeft.Type.IsErrorType()) || loweredLeft.ConstantValueOpt?.IsNull == true); 53Debug.Assert(loweredRight.Type is { } && (loweredRight.Type.IsStringType() || loweredRight.Type.IsErrorType()) || loweredRight.ConstantValueOpt?.IsNull == true); 198var rightConstant = boundCoalesce.RightOperand.ConstantValueOpt; 219var leftConst = loweredLeft.ConstantValueOpt; 220var rightConst = loweredRight.ConstantValueOpt; 253return (operand.ConstantValueOpt != null && string.IsNullOrEmpty(operand.ConstantValueOpt.StringValue)) || 388if (expr is { ConstantValueOpt: { } cv }) 448expr.ConstantValueOpt != null ||
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (7)
225Debug.Assert(fillin.Alignment.ConstantValueOpt is { }); 226stringBuilder.Append(',').Append(fillin.Alignment.ConstantValueOpt.Int64Value); 244Debug.Assert(part is BoundLiteral && part.ConstantValueOpt?.StringValue != null); 247stringBuilder.Append(escapeInterpolatedStringLiteral(part.ConstantValueOpt.StringValue)); 313Debug.Assert(part is BoundLiteral && part.ConstantValueOpt?.StringValue is not null); 314part = _factory.StringLiteral(part.ConstantValueOpt.StringValue); 325if (length == 1 && result is not ({ Kind: BoundKind.InterpolatedString } or { ConstantValueOpt.IsString: true }))
Lowering\LocalRewriter\LocalRewriter_TryStatement.cs (1)
80if (node.ExceptionFilterOpt?.ConstantValueOpt?.BooleanValue == false)
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (3)
188case { ConstantValueOpt: { } }: 318if (rightHasValue.ConstantValueOpt == ConstantValue.False) 326if (leftHasValue.ConstantValueOpt == ConstantValue.False)
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (3)
127if (rewrittenExpression.ConstantValueOpt == ConstantValue.Null) 173constantValueOpt: rewrittenExpression.ConstantValueOpt); 220BoundLocal boundLocal = new BoundLocal(declarationSyntax, localSymbol, localDeclaration.InitializerOpt.ConstantValueOpt, localType);
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (1)
869if (boundArgument.ConstantValueOpt != null)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
633if (expr.ConstantValueOpt != null)
Lowering\SyntheticBoundNodeFactory.cs (3)
1634if (rewrittenExpr.ConstantValueOpt != null) 1639return Literal(ConstantValue.Create(rewrittenExpr.ConstantValueOpt.IsNull, ConstantValueTypeDiscriminator.Boolean), boolType); 1641return Literal(ConstantValue.Create(rewrittenExpr.ConstantValueOpt.IsNull, ConstantValueTypeDiscriminator.Boolean), boolType);
Operations\CSharpOperationFactory.cs (9)
304ConstantValue? constantValue = (boundNode as BoundExpression)?.ConstantValueOpt; 442ConstantValue? constantValue = boundCall.ConstantValueOpt; 513var objectCreationOperation = new ObjectCreationOperation(boundAttribute.Constructor.GetPublicSymbol(), initializer, DeriveArguments(boundAttribute), _semanticModel, boundAttribute.Syntax, boundAttribute.GetPublicTypeSymbol(), boundAttribute.ConstantValueOpt, isImplicit: true); 924ConstantValue? constantValue = boundCollectionElementInitializer.ConstantValueOpt; 1229ConstantValue? constantValue = ((BoundExpression)boundDefaultExpression).ConstantValueOpt; 1272ConstantValue? constantValue = boundAssignmentOperator.ConstantValueOpt; 1425ConstantValue? constantValue = boundBinaryOperator.ConstantValueOpt; 1524ConstantValue? constantValue = boundNullCoalescingOperator.ConstantValueOpt; 2372return new InvalidOperation(ImmutableArray<IOperation>.Empty, _semanticModel, syntax, type, placeholder.ConstantValueOpt, isImplicit);
Symbols\ConstantValueUtils.cs (2)
107var constantValue = boundValue.ConstantValueOpt; 109var unconvertedConstantValue = unconvertedBoundValue.ConstantValueOpt;
Symbols\Source\ParameterHelpers.cs (1)
846if (expression.ConstantValueOpt != null)
Symbols\Source\SourceComplexParameterSymbol.cs (2)
393if (convertedExpression.ConstantValueOpt == null && convertedExpression.Kind == BoundKind.Conversion && 404var value = convertedExpression.ConstantValueOpt ?? ConstantValue.Null;
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler (2)
CompilationContext.cs (2)
727Debug.Assert(expression.ConstantValueOpt == null); 741resultProperties = expression.ExpressionSymbol.GetResultProperties(flags, expression.ConstantValueOpt != null);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (2)
Semantics\ConstantTests.cs (2)
1457Where(node => node.ConstantValueOpt != null). 1458Select(node => node.Syntax.ToFullString().Trim() + " --> " + ExtractValue(node.ConstantValueOpt));