1 write to Operand
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
3010this.Operand = operand;
241 references to Operand
Microsoft.CodeAnalysis.CSharp (228)
Binder\Binder.ValueChecks.cs (10)
4277return CheckRefEscape(node, conversion.Operand, escapeTo, checkingReceiver, diagnostics); 4609return GetInterpolatedStringHandlerConversionEscapeScope(conversion.Operand); 4614return GetCollectionExpressionSafeContext((BoundCollectionExpression)conversion.Operand); 4634MethodInvocationInfo.FromUserDefinedOrUnionConversion(operatorMethod, conversion.Operand, conversion.HasAnyErrors), 4638return GetValEscape(conversion.Operand); 5347return CheckInterpolatedStringHandlerConversionEscape(conversion.Operand, escapeTo, diagnostics); 5352var safeContext = GetCollectionExpressionSafeContext((BoundCollectionExpression)conversion.Operand); 5383MethodInvocationInfo.FromUserDefinedOrUnionConversion(operatorMethod, conversion.Operand, conversion.HasAnyErrors), 5390return CheckValEscape(node, conversion.Operand, escapeTo, checkingReceiver: false, diagnostics: diagnostics); 5736return GetInlineArrayConversionEquivalentSignatureMethod(inlineArray: conversion.Operand, resultType: conversion.Type, out arguments, out refKinds);
Binder\Binder_Attributes.cs (1)
919var operand = node.Operand;
Binder\Binder_Conversions.cs (1)
2250else if (arg is BoundConversion { Operand: BoundCollectionExpression { Elements: [BoundExpression collectionElement] } })
Binder\Binder_Expressions.cs (4)
5232case BoundConversion { Conversion.IsIdentity: true, Operand: BoundParameter param }: 6114if (argument is BoundConversion { Conversion.IsInterpolatedStringHandler: true, Operand: var operand }) 7754Debug.Assert(leftSymbol == (boundValue.ExpressionSymbol ?? ((BoundConversion)boundValue).Operand.ExpressionSymbol)); 9876else if (convertedIndex is BoundConversion { Operand: { ConstantValueOpt: { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex } } operand })
Binder\Binder_Invocation.cs (1)
1984Debug.Assert(typeOrValue.ValueSymbol == (boundValue.ExpressionSymbol ?? ((BoundConversion)boundValue).Operand.ExpressionSymbol));
Binder\Binder_Operators.cs (3)
80conversion = conversion.Update(conversion.Operand, conversion.Conversion, conversion.IsBaseConversion, conversion.Checked, 2921ConstantValue? leftConstant = leftConv.Operand.ConstantValueOpt; 2922ConstantValue? rightConstant = rightConv.Operand.ConstantValueOpt;
Binder\Binder_Patterns.cs (1)
947BoundExpression operand = conversion.Operand;
Binder\Binder_Query.cs (1)
686var l1 = c1 != null ? c1.Operand as BoundLambda : null;
Binder\ForEachLoopBinder.cs (1)
661if ((convertedCollectionExpression as BoundConversion)?.Operand != (object)collectionExpr)
Binder\RefSafetyAnalysis.cs (5)
747if (arg is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 749var interpolationData = conversion.Operand.GetInterpolatedStringHandlerData(); 1116VisitDeconstructionArguments(variables, right.Syntax, right.Conversion, right.Operand); 1241return GetDeconstructionRightParts(conv.Operand); 1261inlineArray: node.Expression is not BoundConversion { Conversion.IsIdentity: true, ExplicitCastInCode: false, Operand: BoundExpression operand } ? node.Expression : operand,
BoundTree\BoundCollectionExpression.cs (1)
53collectionCreation = conversion.Operand;
BoundTree\BoundConversion.cs (19)
13Debug.Assert(!Binder.IsTypeOrValueExpression(Operand)); 14Debug.Assert(!Binder.IsMethodGroupWithTypeOrValueReceiver(Operand)); 26Debug.Assert(Operand is BoundConvertedTupleLiteral); 32Debug.Assert(Operand is BoundConvertedTupleLiteral || 33(Operand is BoundConversion operandAsConversion && 60Debug.Assert(Operand is not BoundConversion operandAsConversion || operandAsConversion.ConversionGroupOpt != ConversionGroupOpt); 66if (Operand is BoundConversion operandAsConversion && operandAsConversion.ConversionGroupOpt == ConversionGroupOpt) 74Operand is BoundConvertedTupleLiteral)); 93Debug.Assert(Operand is not BoundConversion operandAsConversion || 104if (Operand is BoundConversion operandAsConversion && operandAsConversion.ConversionGroupOpt == ConversionGroupOpt) 112Operand is BoundConvertedTupleLiteral)); 121Debug.Assert(Operand is BoundConversion operandAsConversion && 129Debug.Assert(Operand is BoundConversion operandAsConversion && 165if (Operand is BoundConversion operandAsConversion && operandAsConversion.ConversionGroupOpt == ConversionGroupOpt) 174Operand is BoundConvertedTupleLiteral)); 185Debug.Assert(Operand is not BoundConversion operandAsConversion || 195Debug.Assert(Operand is BoundConversion operandAsConversion && 225current = current.Operand as BoundConversion; 232current = current.Operand as BoundConversion;
BoundTree\BoundNode.cs (14)
365BoundConversion { Operand: BoundCollectionExpression { IsParamsArrayOrCollection: true } }); 452if ((object)boundConversion.Operand == placeholder) 463possiblyUserDefined = possiblyUserDefined.Operand as BoundConversion; 469var operand = possiblyUserDefined.Operand; 473operand = operandAsConversion.Operand; 490possiblyUnion = possiblyUnion.Operand as BoundConversion; 496var operand = possiblyUnion.Operand; 500operand = operandAsConversion.Operand; 514boundConversion = (BoundConversion)boundConversion.Operand; 522if ((object)boundConversion.Operand == placeholder || 523(object)(next = (BoundConversion)boundConversion.Operand).Operand == placeholder || 524(object)((BoundConversion)next.Operand).Operand == placeholder)
BoundTree\BoundNode_Source.cs (1)
311appendSource(conversion.Operand);
CodeGen\EmitConversion.cs (12)
54var operand = conversion.Operand; 142var fromType = conversion.Operand.Type; 163(fromPredefTypeKind == Cci.PrimitiveTypeCode.IntPtr && conversion.Operand is BoundBinaryOperator { OperatorKind: BinaryOperatorKind.Division })); // pointer subtraction: see LocalRewriter.RewritePointerSubtraction() 234if (conversion.Operand.ConstantValueOpt == null) 245var fromType = conversion.Operand.Type; 261if (!conversion.Operand.Type.IsVerifierReference()) 263EmitBox(conversion.Operand.Type, conversion.Operand.Syntax); 293if (!conversion.Operand.Type.IsVerifierReference()) 295EmitBox(conversion.Operand.Type, conversion.Operand.Syntax); 321var fromType = conversion.Operand.Type;
CodeGen\EmitExpression.cs (4)
1247EmitExpression(conversion.Operand, true); 1562return CanUseCallOnRefTypeReceiver(conversion.Operand); 2206current = conv.Operand; 3971return StackMergeType(conversion.Operand);
CodeGen\EmitOperators.cs (1)
375if (comparand is BoundConversion { Type.SpecialType: SpecialType.System_Object, ConversionKind: ConversionKind.Boxing, Operand.Type: TypeParameterSymbol { AllowsRefLikeType: true } } &&
CodeGen\Optimizer.cs (1)
598return node.UpdateOperand(this.VisitExpression(node.Operand, context));
Compilation\CSharpSemanticModel.cs (6)
2117if (tupleLiteralConversion.Operand.Kind == BoundKind.ConvertedTupleLiteral) 2119var convertedTuple = (BoundConvertedTupleLiteral)tupleLiteralConversion.Operand; 2125(type, nullability) = getTypeAndNullability(tupleLiteralConversion.Operand); 2206else if (((BoundConversion)highestBoundExpr).Operand.Kind != BoundKind.Conversion) 3560conversion.Operand is BoundConversion { Conversion.IsUnion: true } unionConversion && 4333else if (conversion.Operand is BoundConversion { ConversionKind: ConversionKind.MethodGroup } nestedMethodGroupConversion)
Compilation\MemberSemanticModel.cs (1)
1846node = ((BoundConversion)node).Operand;
FlowAnalysis\AbstractFlowPass.cs (6)
1794BoundExpression receiver = ((BoundMethodGroup)node.Operand).ReceiverOpt; 1796EnterRegionIfNeeded(node.Operand); 1798LeaveRegionIfNeeded(node.Operand); 1807Visit(node.Operand); 2713&& conv.Operand.Type!.IsNonNullableValueType()); 3058BoundConversion { Conversion: Conversion conversion, Operand: BoundConditionalAccess ca } when CanPropagateStateWhenNotNull(conversion) => ca,
FlowAnalysis\DefiniteAssignment.cs (2)
890return WriteConsideredUse(null, boundConversion.Operand); 2772NoteWrite(node.Operand, value: null, read: false, isRef: false);
FlowAnalysis\NullableWalker.cs (18)
2163var operand = conv.Operand; 2181IsTargetTypedExpression(conv.Operand) && 2182TypeSymbol.Equals(conv.Type, conv.Operand.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes): 2190return MakeSlot(conv.Operand); 2618IsDefaultValue(conversion.Operand); 4173collectionCreation = conversion.Operand; 5897operand = ((BoundConversion)operand).Operand; 6096possiblyConversion = conversion.Operand; 7787elements = ((BoundCollectionExpression)((BoundConversion)argument).Operand).UnconvertedCollectionExpression.Elements.CastArray<BoundExpression>(); 8989expr = conversion.Operand; 10693conversionOpt = conversionOpt.Operand as BoundConversion; 10718conversionOpt = conversionOpt.Operand as BoundConversion; 11350VisitRvalue(right.Operand); 11354VisitDeconstructionArguments(variables, right.Conversion, right.Operand, rightResultOpt); 11628return GetDeconstructionRightParts(conv.Operand, null); 12472if (!reportedDiagnostic && !(collectionExpression is BoundConversion { Operand: { IsSuppressed: true } })) 12550if (node.Expression is not BoundConversion { Operand.IsSuppressed: true } && 12587isSuppressed: node.Expression is BoundConversion { Operand.IsSuppressed: true },
FlowAnalysis\NullableWalker.DebugVerifier.cs (2)
412Visit(node.Operand.GetInterpolatedStringHandlerData().Construction); 417this.Visit(node.Operand);
Generated\BoundNodes.xml.Generated.cs (5)
3039if (operand != this.Operand || conversion != this.Conversion || isBaseConversion != this.IsBaseConversion || @checked != this.Checked || explicitCastInCode != this.ExplicitCastInCode || constantValueOpt != this.ConstantValueOpt || conversionGroupOpt != this.ConversionGroupOpt || inConversionGroupFlags != this.InConversionGroupFlags || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything)) 10329this.Visit(node.Operand); 11598BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 13764BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 16150new TreeDumperNode("operand", null, new TreeDumperNode[] { Visit(node.Operand, null) }),
Lowering\BoundTreeToDifferentEnclosingContextRewriter.cs (1)
179(BoundExpression)Visit(node.Operand),
Lowering\ClosureConversion\ClosureConversion.cs (1)
1400var result = (BoundExpression)RewriteLambdaConversion((BoundLambda)conversion.Operand);
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (15)
548operand = conversion.Operand; 680conversion.Operand, 700var mg = (BoundMethodGroup)node.Operand; 710var operandType = node.Operand.Type; 719? Convert(Visit(node.Operand), node.Operand.Type, method.Parameters[0].Type, node.Checked, false) 720: Visit(node.Operand); 731var operand = Visit(node.Operand); 735if (node.Operand.Type.IsNullableType()) 737return Convert(Visit(node.Operand), node.Operand.Type, node.Type, node.Checked, node.ExplicitCastInCode); 744var e1 = Convert(Visit(node.Operand), node.Operand.Type, intermediate, node.Checked, false); 750return Convert(Visit(node.Operand), node.Operand.Type, node.Type, node.Checked, node.ExplicitCastInCode);
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
846CheckUnsafeType(node.Operand); 853CheckMethodGroup((BoundMethodGroup)node.Operand, node.Conversion.Method, node.IsExtensionMethod, parentIsConversion: true, node.Type);
Lowering\DiagnosticsPass_Warnings.cs (12)
145receiver = conversion.Operand; 172current = conversion.Operand; 355NamedTypeSymbol nt = conv.Operand.Type as NamedTypeSymbol; 432conversion = conversion.Operand as BoundConversion) 446if (!conversion.Operand.Type.SpecialType.IsIntegralType() || !conversion.Type.SpecialType.IsIntegralType()) 451if (!Binder.CheckConstantBounds(conversion.Operand.Type.SpecialType, constantValue, out _)) 453Error(ErrorCode.WRN_VacuousIntegralComp, tree, conversion.Operand.Type); 581operand = conv.Operand; 611TypeSymbol from = conv.Operand.Type; 649ulong recursive = FindSurprisingSignExtensionBits(conv.Operand); 869type = GetTypeForLiftedComparisonWarning(conv.Operand); 896right = conversion.Operand;
Lowering\Extensions.cs (3)
65return conversion.Operand.NullableAlwaysHasValue(); 69return conversion.Operand.NullableAlwaysHasValue(); 119return conversion.Operand.NullableNeverHasValue();
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (1)
726return conversion.Operand.ConstantValueOpt;
Lowering\LocalRewriter\LocalRewriter_Call.cs (5)
612current = conv.Operand; 854if (argument is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 858var interpolationData = conversion.Operand.GetInterpolatedStringHandlerData(); 928if (argument is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 930var interpolationData = conversion.Operand.GetInterpolatedStringHandlerData();
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (4)
1520if (convertedExpression.Operand.Type is ArrayTypeSymbol arrayType) 1526convertedExpression.Operand, 1539convertedExpression.Operand, 1557convertedExpression.Operand,
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (1)
1028ReadIsSideeffecting(conv.Operand);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (16)
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 62var rewrittenCollection = RewriteCollectionExpressionConversion(node.Conversion.UnderlyingConversions[0], (BoundCollectionExpression)node.Operand); 66return RewriteCollectionExpressionConversion(node.Conversion, (BoundCollectionExpression)node.Operand); 75var rewrittenOperand = VisitExpression(node.Operand); 1073case BoundConversion { Conversion: { Kind: ConversionKind.ImplicitNullable }, Operand: var convertedArgument } 1078case 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 (2)
155BoundExpression rewrittenExpression = VisitExpression(convertedCollection.Operand); 1228return boundConversion.Operand;
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (1)
786else if (unloweredExpr is BoundConversion { Operand: { Type: { SpecialType: SpecialType.System_Int32 } } operand })
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (1)
229expression = boundConversion.Operand;
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (2)
289if (argument is BoundConversion { ConversionKind: ConversionKind.Boxing, Type.SpecialType: SpecialType.System_Object, Operand: { Type.SpecialType: SpecialType.System_Char } operand }) 632expr = conv.Operand;
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (2)
19var interpolatedString = (BoundInterpolatedString)conversion.Operand; 240if (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 89case BoundConversion { Conversion: { Kind: var kind }, Operand: var o } when 111Debug.Assert(boundConversion.Operand.Type is { }); 112var srcElementFields = boundConversion.Operand.Type.TupleElements; 114var savedTuple = DeferSideEffectingArgumentToTempForTupleEquality(LowerConversions(boundConversion.Operand), initEffects, temps); 205var deferredOperand = DeferSideEffectingArgumentToTempForTupleEquality(conv.Operand, effects, temps, conv.ExplicitCastInCode || enclosingConversionWasExplicit); 406case BoundConversion { Conversion: { IsIdentity: true }, Operand: var o }: 408case BoundConversion { Conversion: { IsNullable: true, UnderlyingConversions: var underlying } conversion, Operand: var o } 440case BoundConversion { Conversion: { IsIdentity: true }, Operand: var o }: 442case BoundConversion { Conversion: { IsNullable: true, UnderlyingConversions: var nested }, Operand: var o } conv when 615oldNodeOpt: conv, syntax: conv.Syntax, rewrittenOperand: LowerConversions(conv.Operand),
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (1)
774expression = conversion.Operand;
Lowering\SpillSequenceSpiller.cs (1)
1196var operand = VisitExpression(ref builder, node.Operand);
Operations\CSharpOperationFactory.cs (13)
440IOperation value = Create(boundDeconstructionAssignmentOperator.Right.Operand); 1032Debug.Assert(!forceOperandImplicitLiteral || boundConversion.Operand is BoundLiteral); 1033BoundExpression boundOperand = boundConversion.Operand; 1048isImplicit = !unionConversion.ExplicitCastInCode || boundConversion.Syntax == (sourceConversion ?? unionConversion).Operand.Syntax; 1078CreateBoundMethodGroupSingleMethodOperation((BoundMethodGroup)boundConversion.Operand, boundConversion.SymbolOpt, suppressVirtualCalls: false), 1139BoundExpression nestedOperand = nestedConversion.Operand; 1172? CreateBoundLiteralOperation((BoundLiteral)correctedConversionNode.Operand, @implicit: true) 1173: Create(correctedConversionNode.Operand); 1298collectionCreation = conversion.Operand; 2044boundForEachStatement.Expression is not BoundConversion { Conversion.IsIdentity: true, ExplicitCastInCode: false, Operand: BoundExpression operand } ? 2421BoundConversion { Operand: BoundLiteral } c => CreateBoundConversionOperation(c, forceOperandImplicitLiteral: true), 2487InterpolatedStringHandlerData interpolationData = conversion.Operand.GetInterpolatedStringHandlerData(); 2489var content = createContent(conversion.Operand);
Operations\CSharpOperationFactory_Methods.cs (3)
39IOperation value = Create(expression is BoundConversion { IsParamsArrayOrCollection: true } conversion ? conversion.Operand : expression); 151return CreateBoundMethodGroupSingleMethodOperation((BoundMethodGroup)boundConversion.Operand, 157return Create(boundConversion.Operand);
Symbols\ConstantValueUtils.cs (1)
101unconvertedBoundValue = conversion.Operand;
Symbols\Source\ParameterHelpers.cs (1)
1115return conversion is { Conversion.IsObjectCreation: true, Operand: BoundObjectCreationExpression { WasTargetTyped: true } operand } &&
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (13)
Semantics\ForEachTests.cs (13)
1737Assert.Equal(SymbolKind.ArrayType, ((BoundConversion)boundNode.Expression).Operand.Type.Kind); 1775Assert.Equal(SpecialType.System_String, ((BoundConversion)boundNode.Expression).Operand.Type.SpecialType); 1819Assert.Equal("Enumerable", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 1863Assert.Equal("Enumerable", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 1896Assert.Equal("System.Collections.IEnumerable", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 1936Assert.Equal("Enumerable", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 1978Assert.Equal("Enumerable", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 2017Assert.Equal("Enumerable", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 2198Assert.Equal(TypeKind.Dynamic, ((BoundConversion)boundNode.Expression).Operand.Type.TypeKind); 2231Assert.Equal(SymbolKind.DynamicType, ((BoundConversion)boundNode.Expression).Operand.Type.Kind); 2272Assert.Equal("Enumerable<T>", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 2356Assert.Equal("Enumerable<T>", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString()); 2403Assert.Equal("Enumerable", ((BoundConversion)boundNode.Expression).Operand.Type.ToTestDisplayString());