1 write to Operand
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
2847this.Operand = operand;
182 references to Operand
Microsoft.CodeAnalysis.CSharp (169)
Binder\Binder.ValueChecks.cs (5)
3431return CheckRefEscape(node, conversion.Operand, escapeFrom, escapeTo, checkingReceiver, diagnostics); 3714return GetInterpolatedStringHandlerConversionEscapeScope(conversion.Operand, scopeOfTheContainingExpression); 3717return GetValEscape(conversion.Operand, scopeOfTheContainingExpression); 4189return CheckInterpolatedStringHandlerConversionEscape(conversion.Operand, escapeFrom, escapeTo, diagnostics); 4192return CheckValEscape(node, conversion.Operand, escapeFrom, escapeTo, checkingReceiver: false, diagnostics: diagnostics);
Binder\Binder_Attributes.cs (1)
983var operand = node.Operand;
Binder\Binder_Expressions.cs (3)
4295case BoundConversion { Conversion.IsIdentity: true, Operand: BoundParameter param }: 5055if (argument is BoundConversion { Conversion.IsInterpolatedStringHandler: true, Operand: var operand }) 6388leftSymbol = ((BoundConversion)boundValue).Operand.ExpressionSymbol;
Binder\Binder_Operators.cs (3)
68conversion = conversion.Update(conversion.Operand, conversion.Conversion, conversion.IsBaseConversion, conversion.Checked, 1919ConstantValue? leftConstant = leftConv.Operand.ConstantValueOpt; 1920ConstantValue? rightConstant = rightConv.Operand.ConstantValueOpt;
Binder\Binder_Patterns.cs (1)
680BoundExpression operand = conversion.Operand;
Binder\Binder_Query.cs (1)
680var l1 = c1 != null ? c1.Operand as BoundLambda : null;
Binder\ForEachLoopBinder.cs (1)
536if ((convertedCollectionExpression as BoundConversion)?.Operand != (object)collectionExpr)
Binder\RefSafetyAnalysis.cs (4)
572if (arg is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 574var interpolationData = conversion.Operand.GetInterpolatedStringHandlerData(); 729VisitDeconstructionArguments(variables, right.Syntax, right.Conversion, right.Operand); 846return GetDeconstructionRightParts(conv.Operand);
BoundTree\BoundNode.cs (7)
397if ((object)boundConversion.Operand == placeholder) 404boundConversion = (BoundConversion)boundConversion.Operand; 411if ((object)boundConversion.Operand == placeholder || 412(object)(next = (BoundConversion)boundConversion.Operand).Operand == placeholder || 413(object)((BoundConversion)next.Operand).Operand == placeholder)
CodeGen\EmitConversion.cs (11)
54var operand = conversion.Operand; 139var fromType = conversion.Operand.Type; 202if (conversion.Operand.ConstantValueOpt == null) 213var fromType = conversion.Operand.Type; 229if (!conversion.Operand.Type.IsVerifierReference()) 231EmitBox(conversion.Operand.Type, conversion.Operand.Syntax); 261if (!conversion.Operand.Type.IsVerifierReference()) 263EmitBox(conversion.Operand.Type, conversion.Operand.Syntax); 289var fromType = conversion.Operand.Type;
CodeGen\EmitExpression.cs (4)
1196EmitExpression(conversion.Operand, true); 1511return CanUseCallOnRefTypeReceiver(conversion.Operand); 1954current = conv.Operand; 3654return StackMergeType(conversion.Operand);
CodeGen\Optimizer.cs (1)
599return node.UpdateOperand(this.VisitExpression(node.Operand, context));
Compilation\CSharpSemanticModel.cs (4)
2127if (tupleLiteralConversion.Operand.Kind == BoundKind.ConvertedTupleLiteral) 2129var convertedTuple = (BoundConvertedTupleLiteral)tupleLiteralConversion.Operand; 2135(type, nullability) = getTypeAndNullability(tupleLiteralConversion.Operand); 2193else if (((BoundConversion)highestBoundExpr).Operand.Kind != BoundKind.Conversion)
Compilation\MemberSemanticModel.cs (1)
1798node = ((BoundConversion)node).Operand;
FlowAnalysis\AbstractFlowPass.cs (6)
1637BoundExpression receiver = ((BoundMethodGroup)node.Operand).ReceiverOpt; 1639EnterRegionIfNeeded(node.Operand); 1641LeaveRegionIfNeeded(node.Operand); 1650Visit(node.Operand); 2440&& conv.Operand.Type!.IsNonNullableValueType()); 2785BoundConversion { Conversion: Conversion conversion, Operand: BoundConditionalAccess ca } when CanPropagateStateWhenNotNull(conversion) => ca,
FlowAnalysis\DefiniteAssignment.cs (1)
907return WriteConsideredUse(null, boundConversion.Operand);
FlowAnalysis\NullableWalker.cs (14)
1992var operand = conv.Operand; 2010IsTargetTypedExpression(conv.Operand) && 2011TypeSymbol.Equals(conv.Type, conv.Operand.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes): 2019return MakeSlot(conv.Operand); 2428IsDefaultValue(conversion.Operand); 4889operand = ((BoundConversion)operand).Operand; 5088possiblyConversion = conversion.Operand; 7230expr = conversion.Operand; 8593conversionOpt = conversionOpt.Operand as BoundConversion; 8606conversionOpt = conversionOpt.Operand as BoundConversion; 9229VisitRvalue(right.Operand); 9233VisitDeconstructionArguments(variables, right.Conversion, right.Operand, rightResultOpt); 9506return GetDeconstructionRightParts(conv.Operand, null); 10099if (!reportedDiagnostic && !(node.Expression is BoundConversion { Operand: { IsSuppressed: true } }))
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
282Visit(node.Operand.GetInterpolatedStringHandlerData().Construction);
Generated\BoundNodes.xml.Generated.cs (5)
2872if (operand != this.Operand || conversion != this.Conversion || isBaseConversion != this.IsBaseConversion || @checked != this.Checked || explicitCastInCode != this.ExplicitCastInCode || constantValueOpt != this.ConstantValueOpt || conversionGroupOpt != this.ConversionGroupOpt || originalUserDefinedConversionsOpt != this.OriginalUserDefinedConversionsOpt || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything)) 9684this.Visit(node.Operand); 10845BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 12801BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 15065new TreeDumperNode("operand", null, new TreeDumperNode[] { Visit(node.Operand, null) }),
Lowering\ClosureConversion\ClosureConversion.cs (1)
1381var result = (BoundExpression)RewriteLambdaConversion((BoundLambda)conversion.Operand);
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (15)
475operand = conversion.Operand; 603conversion.Operand, 622var mg = (BoundMethodGroup)node.Operand; 630var operandType = node.Operand.Type; 639? Convert(Visit(node.Operand), node.Operand.Type, method.Parameters[0].Type, node.Checked, false) 640: Visit(node.Operand); 647var operand = Visit(node.Operand); 651if (node.Operand.Type.IsNullableType()) 653return Convert(Visit(node.Operand), node.Operand.Type, node.Type, node.Checked, node.ExplicitCastInCode); 660var e1 = Convert(Visit(node.Operand), node.Operand.Type, intermediate, node.Checked, false); 666return Convert(Visit(node.Operand), node.Operand.Type, node.Type, node.Checked, node.ExplicitCastInCode);
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
719CheckUnsafeType(node.Operand); 726CheckMethodGroup((BoundMethodGroup)node.Operand, node.Conversion.Method, node.IsExtensionMethod, parentIsConversion: true, node.Type);
Lowering\DiagnosticsPass_Warnings.cs (12)
145receiver = conversion.Operand; 172current = conversion.Operand; 356NamedTypeSymbol nt = conv.Operand.Type as NamedTypeSymbol; 433conversion = conversion.Operand as BoundConversion) 447if (!conversion.Operand.Type.SpecialType.IsIntegralType() || !conversion.Type.SpecialType.IsIntegralType()) 452if (!Binder.CheckConstantBounds(conversion.Operand.Type.SpecialType, constantValue, out _)) 454Error(ErrorCode.WRN_VacuousIntegralComp, tree, conversion.Operand.Type); 582operand = conv.Operand; 612TypeSymbol from = conv.Operand.Type; 650ulong recursive = FindSurprisingSignExtensionBits(conv.Operand); 870type = GetTypeForLiftedComparisonWarning(conv.Operand); 897right = conversion.Operand;
Lowering\Extensions.cs (3)
65return conversion.Operand.NullableAlwaysHasValue(); 69return conversion.Operand.NullableAlwaysHasValue(); 119return conversion.Operand.NullableNeverHasValue();
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (1)
716return conversion.Operand.ConstantValueOpt;
Lowering\LocalRewriter\LocalRewriter_Call.cs (5)
361current = conv.Operand; 593if (argument is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 597var interpolationData = conversion.Operand.GetInterpolatedStringHandlerData(); 666if (argument is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 668var interpolationData = conversion.Operand.GetInterpolatedStringHandlerData();
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (1)
881ReadIsSideeffecting(conv.Operand);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (14)
27var (data, parts) = node.Operand switch 31_ => throw ExceptionUtilities.UnexpectedValue(node.Operand.Kind) 34InterpolationHandlerResult interpolationResult = RewriteToInterpolatedStringHandlerPattern(data, parts, node.Operand.Syntax); 39Debug.Assert(node.Operand is BoundConvertedSwitchExpression { WasTargetTyped: true }); 40return Visit(node.Operand)!; 43Debug.Assert(node.Operand is BoundConditionalOperator { WasTargetTyped: true }); 44return Visit(node.Operand)!; 47Debug.Assert(node.Operand is not null); 48var objectCreation = VisitExpression(node.Operand); 52Debug.Assert(node.Operand is BoundObjectCreationExpressionBase { WasTargetTyped: true }); 56Debug.Assert(node.Operand is BoundObjectCreationExpressionBase { WasTargetTyped: true } or 68var rewrittenOperand = VisitExpression(node.Operand); 865case BoundConversion { Conversion: { Kind: ConversionKind.ImplicitNullable }, Operand: var convertedArgument } 870case BoundConversion { Conversion: { Kind: ConversionKind.ImplicitNullable, UnderlyingConversions: var underlying }, Operand: var convertedArgument } conversion
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (5)
22return RewriteDeconstruction(node.Left, right.Conversion, right.Operand, node.IsUsed); 114Debug.Assert(right is not ({ Kind: BoundKind.TupleLiteral } or BoundConversion { Operand.Kind: BoundKind.TupleLiteral })); 117right is { Kind: BoundKind.ConvertedTupleLiteral } or BoundConversion { Operand.Kind: BoundKind.ConvertedTupleLiteral } 308&& IsTupleExpression(tupleConversion.Operand.Kind)) 310return ((BoundTupleExpression)tupleConversion.Operand).Arguments;
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (1)
1004return boundConversion.Operand;
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (1)
465else if (unloweredExpr is BoundConversion { Operand: { Type: { SpecialType: SpecialType.System_Int32 } } operand })
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (1)
220expression = boundConversion.Operand;
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
378expr = conv.Operand;
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (2)
21MakeInterpolatedStringFormat((BoundInterpolatedString)conversion.Operand, out format, out expressions); 389if (arg is BoundConversion { Conversion: { Kind: ConversionKind.InterpolatedStringHandler }, ExplicitCastInCode: false, Operand: var operand })
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (13)
49case BoundConversion { Conversion: { Kind: ConversionKind.Identity }, Operand: var o }: 51case BoundConversion { Conversion: { Kind: ConversionKind.ImplicitTupleLiteral }, Operand: var o }: 56case BoundConversion { Conversion: { Kind: var kind } c, Operand: var o } conversion when 88case BoundConversion { Conversion: { Kind: var kind }, Operand: var o } when 110Debug.Assert(boundConversion.Operand.Type is { }); 111var srcElementFields = boundConversion.Operand.Type.TupleElements; 113var savedTuple = DeferSideEffectingArgumentToTempForTupleEquality(LowerConversions(boundConversion.Operand), initEffects, temps); 202var deferredOperand = DeferSideEffectingArgumentToTempForTupleEquality(conv.Operand, effects, temps, conv.ExplicitCastInCode || enclosingConversionWasExplicit); 401case BoundConversion { Conversion: { IsIdentity: true }, Operand: var o }: 403case BoundConversion { Conversion: { IsNullable: true, UnderlyingConversions: var underlying } conversion, Operand: var o } 435case BoundConversion { Conversion: { IsIdentity: true }, Operand: var o }: 437case BoundConversion { Conversion: { IsNullable: true, UnderlyingConversions: var nested }, Operand: var o } conv when 610oldNodeOpt: conv, syntax: conv.Syntax, rewrittenOperand: LowerConversions(conv.Operand),
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (1)
608expression = conversion.Operand;
Lowering\MethodToClassRewriter.cs (1)
296(BoundExpression)Visit(node.Operand),
Lowering\SpillSequenceSpiller.cs (1)
1085var operand = VisitExpression(ref builder, node.Operand);
Operations\CSharpOperationFactory.cs (10)
430IOperation value = Create(boundDeconstructionAssignmentOperator.Right.Operand); 1011Debug.Assert(!forceOperandImplicitLiteral || boundConversion.Operand is BoundLiteral); 1013BoundExpression boundOperand = boundConversion.Operand; 1032CreateBoundMethodGroupSingleMethodOperation((BoundMethodGroup)boundConversion.Operand, boundConversion.SymbolOpt, suppressVirtualCalls: false), 1093BoundExpression nestedOperand = nestedConversion.Operand; 1126? CreateBoundLiteralOperation((BoundLiteral)correctedConversionNode.Operand, @implicit: true) 1127: Create(correctedConversionNode.Operand); 2238BoundConversion { Operand: BoundLiteral } c => CreateBoundConversionOperation(c, forceOperandImplicitLiteral: true), 2304InterpolatedStringHandlerData interpolationData = conversion.Operand.GetInterpolatedStringHandlerData(); 2306var content = createContent(conversion.Operand);
Operations\CSharpOperationFactory_Methods.cs (2)
151return CreateBoundMethodGroupSingleMethodOperation((BoundMethodGroup)boundConversion.Operand, 157return Create(boundConversion.Operand);
Symbols\ConstantValueUtils.cs (1)
102unconvertedBoundValue = conversion.Operand;
Symbols\Source\ParameterHelpers.cs (1)
860return conversion is { Conversion.IsObjectCreation: true, Operand: BoundObjectCreationExpression { WasTargetTyped: true } operand } &&
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (13)
Semantics\ForEachTests.cs (13)
1220Assert.Equal(SymbolKind.ArrayType, ((BoundConversion)boundNode.Expression).Operand.Type.Kind); 1258Assert.Equal(SpecialType.System_String, ((BoundConversion)boundNode.Expression).Operand.Type.SpecialType); 1302Assert.Equal("Enumerable", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 1346Assert.Equal("Enumerable", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 1379Assert.Equal("System.Collections.IEnumerable", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 1419Assert.Equal("Enumerable", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 1461Assert.Equal("Enumerable", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 1500Assert.Equal("Enumerable", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 1681Assert.Equal(TypeKind.Dynamic, ((BoundConversion)boundNode.Expression).Operand.Type.TypeKind); 1714Assert.Equal(SymbolKind.DynamicType, ((BoundConversion)boundNode.Expression).Operand.Type.Kind); 1755Assert.Equal("Enumerable<T>", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 1839Assert.Equal("Enumerable<T>", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 1886Assert.Equal("Enumerable", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString());