1 write to Operand
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
3007this.Operand = operand;
227 references to Operand
Microsoft.CodeAnalysis.CSharp (214)
Binder\Binder.ValueChecks.cs (10)
4267return CheckRefEscape(node, conversion.Operand, escapeTo, checkingReceiver, diagnostics); 4599return GetInterpolatedStringHandlerConversionEscapeScope(conversion.Operand); 4604return GetCollectionExpressionSafeContext((BoundCollectionExpression)conversion.Operand); 4624MethodInvocationInfo.FromUserDefinedConversion(operatorMethod, conversion.Operand, conversion.HasAnyErrors), 4628return GetValEscape(conversion.Operand); 5337return CheckInterpolatedStringHandlerConversionEscape(conversion.Operand, escapeTo, diagnostics); 5342var safeContext = GetCollectionExpressionSafeContext((BoundCollectionExpression)conversion.Operand); 5373MethodInvocationInfo.FromUserDefinedConversion(operatorMethod, conversion.Operand, conversion.HasAnyErrors), 5380return CheckValEscape(node, conversion.Operand, escapeTo, checkingReceiver: false, diagnostics: diagnostics); 5726return GetInlineArrayConversionEquivalentSignatureMethod(inlineArray: conversion.Operand, resultType: conversion.Type, out arguments, out refKinds);
Binder\Binder_Attributes.cs (1)
913var operand = node.Operand;
Binder\Binder_Conversions.cs (1)
2197else if (arg is BoundConversion { Operand: BoundCollectionExpression { Elements: [BoundExpression collectionElement] } })
Binder\Binder_Expressions.cs (4)
5230case BoundConversion { Conversion.IsIdentity: true, Operand: BoundParameter param }: 6133if (argument is BoundConversion { Conversion.IsInterpolatedStringHandler: true, Operand: var operand }) 7769Debug.Assert(leftSymbol == (boundValue.ExpressionSymbol ?? ((BoundConversion)boundValue).Operand.ExpressionSymbol)); 9865else if (convertedIndex is BoundConversion { Operand: { ConstantValueOpt: { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex } } operand })
Binder\Binder_Invocation.cs (1)
1983Debug.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, 2930ConstantValue? leftConstant = leftConv.Operand.ConstantValueOpt; 2931ConstantValue? rightConstant = rightConv.Operand.ConstantValueOpt;
Binder\Binder_Patterns.cs (1)
701BoundExpression operand = conversion.Operand;
Binder\Binder_Query.cs (1)
686var l1 = c1 != null ? c1.Operand as BoundLambda : null;
Binder\ForEachLoopBinder.cs (1)
658if ((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 (13)
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)); 101Debug.Assert(Operand is not BoundConversion operandAsConversion || 112if (Operand is BoundConversion operandAsConversion && operandAsConversion.ConversionGroupOpt == ConversionGroupOpt) 120Operand is BoundConvertedTupleLiteral)); 129Debug.Assert(Operand is BoundConversion operandAsConversion && 137Debug.Assert(Operand is BoundConversion operandAsConversion &&
BoundTree\BoundNode.cs (8)
365BoundConversion { Operand: BoundCollectionExpression { IsParamsArrayOrCollection: true } }); 452if ((object)boundConversion.Operand == placeholder) 459boundConversion = (BoundConversion)boundConversion.Operand; 466if ((object)boundConversion.Operand == placeholder || 467(object)(next = (BoundConversion)boundConversion.Operand).Operand == placeholder || 468(object)((BoundConversion)next.Operand).Operand == placeholder)
BoundTree\BoundNode_Source.cs (1)
311appendSource(conversion.Operand);
CodeGen\EmitConversion.cs (12)
54var operand = conversion.Operand; 141var fromType = conversion.Operand.Type; 162(fromPredefTypeKind == Cci.PrimitiveTypeCode.IntPtr && conversion.Operand is BoundBinaryOperator { OperatorKind: BinaryOperatorKind.Division })); // pointer subtraction: see LocalRewriter.RewritePointerSubtraction() 233if (conversion.Operand.ConstantValueOpt == null) 244var fromType = conversion.Operand.Type; 260if (!conversion.Operand.Type.IsVerifierReference()) 262EmitBox(conversion.Operand.Type, conversion.Operand.Syntax); 292if (!conversion.Operand.Type.IsVerifierReference()) 294EmitBox(conversion.Operand.Type, conversion.Operand.Syntax); 320var fromType = conversion.Operand.Type;
CodeGen\EmitExpression.cs (4)
1247EmitExpression(conversion.Operand, true); 1562return CanUseCallOnRefTypeReceiver(conversion.Operand); 2201current = conv.Operand; 3966return 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 (5)
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) 4320else if (conversion.Operand is BoundConversion { ConversionKind: ConversionKind.MethodGroup } nestedMethodGroupConversion)
Compilation\MemberSemanticModel.cs (1)
1846node = ((BoundConversion)node).Operand;
FlowAnalysis\AbstractFlowPass.cs (6)
1745BoundExpression receiver = ((BoundMethodGroup)node.Operand).ReceiverOpt; 1747EnterRegionIfNeeded(node.Operand); 1749LeaveRegionIfNeeded(node.Operand); 1758Visit(node.Operand); 2664&& conv.Operand.Type!.IsNonNullableValueType()); 3009BoundConversion { Conversion: Conversion conversion, Operand: BoundConditionalAccess ca } when CanPropagateStateWhenNotNull(conversion) => ca,
FlowAnalysis\DefiniteAssignment.cs (2)
889return WriteConsideredUse(null, boundConversion.Operand); 2771NoteWrite(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); 4145collectionCreation = conversion.Operand; 5825operand = ((BoundConversion)operand).Operand; 6024possiblyConversion = conversion.Operand; 7713elements = ((BoundCollectionExpression)((BoundConversion)argument).Operand).UnconvertedCollectionExpression.Elements.CastArray<BoundExpression>(); 8865expr = conversion.Operand; 10299conversionOpt = conversionOpt.Operand as BoundConversion; 10319conversionOpt = conversionOpt.Operand as BoundConversion; 10951VisitRvalue(right.Operand); 10955VisitDeconstructionArguments(variables, right.Conversion, right.Operand, rightResultOpt); 11229return GetDeconstructionRightParts(conv.Operand, null); 12046if (!reportedDiagnostic && !(collectionExpression is BoundConversion { Operand: { IsSuppressed: true } })) 12134if (node.Expression is not BoundConversion { Operand.IsSuppressed: true } && 12171isSuppressed: 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)
3036if (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)) 10193this.Visit(node.Operand); 11445BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 13590BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 15948new 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; 708var operandType = node.Operand.Type; 717? Convert(Visit(node.Operand), node.Operand.Type, method.Parameters[0].Type, node.Checked, false) 718: Visit(node.Operand); 729var operand = Visit(node.Operand); 733if (node.Operand.Type.IsNullableType()) 735return Convert(Visit(node.Operand), node.Operand.Type, node.Type, node.Checked, node.ExplicitCastInCode); 742var e1 = Convert(Visit(node.Operand), node.Operand.Type, intermediate, node.Checked, false); 748return Convert(Visit(node.Operand), node.Operand.Type, node.Type, node.Checked, node.ExplicitCastInCode);
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
844CheckUnsafeType(node.Operand); 851CheckMethodGroup((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; 853if (argument is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 857var interpolationData = conversion.Operand.GetInterpolatedStringHandlerData(); 927if (argument is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 929var 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); 1020case BoundConversion { Conversion: { Kind: ConversionKind.ImplicitNullable }, Operand: var convertedArgument } 1025case 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); 1220return boundConversion.Operand;
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (1)
762else 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 (12)
440IOperation value = Create(boundDeconstructionAssignmentOperator.Right.Operand); 1032Debug.Assert(!forceOperandImplicitLiteral || boundConversion.Operand is BoundLiteral); 1034BoundExpression boundOperand = boundConversion.Operand; 1053CreateBoundMethodGroupSingleMethodOperation((BoundMethodGroup)boundConversion.Operand, boundConversion.SymbolOpt, suppressVirtualCalls: false), 1114BoundExpression nestedOperand = nestedConversion.Operand; 1147? CreateBoundLiteralOperation((BoundLiteral)correctedConversionNode.Operand, @implicit: true) 1148: Create(correctedConversionNode.Operand); 1273collectionCreation = conversion.Operand; 2019boundForEachStatement.Expression is not BoundConversion { Conversion.IsIdentity: true, ExplicitCastInCode: false, Operand: BoundExpression operand } ? 2396BoundConversion { Operand: BoundLiteral } c => CreateBoundConversionOperation(c, forceOperandImplicitLiteral: true), 2462InterpolatedStringHandlerData interpolationData = conversion.Operand.GetInterpolatedStringHandlerData(); 2464var 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)
1114return 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());