40 instantiations of BoundConversion
Microsoft.CodeAnalysis.CSharp (40)
Binder\Binder_Conversions.cs (16)
203return new BoundConversion( 219return new BoundConversion( 241return new BoundConversion( 286return new BoundConversion( 347return new BoundConversion( 838expr = new BoundConversion( 2538return new BoundConversion( 2628userDefinedConversion = new BoundConversion( 2674userDefinedConversion = new BoundConversion( 2729return new BoundConversion( 2806var unionConversion = new BoundConversion( 2869expr = new BoundConversion( 2916return new BoundConversion( 2951return new BoundConversion(syntax, group, conversion, @checked: false, explicitCastInCode: isCast, conversionGroup, inConversionGroupFlags, constantValueOpt: ConstantValue.NotAvailable, type: destination, hasErrors: hasErrors) { WasCompilerGenerated = group.WasCompilerGenerated }; 3209result = new BoundConversion( 3226result = new BoundConversion(
Binder\Binder_Deconstruct.cs (3)
132new BoundConversion(boundRHS.Syntax, boundRHS, Conversion.Deconstruction, @checked: false, explicitCastInCode: false, 161var boundConversion = new BoundConversion( 311nestedConversions.Add((operandPlaceholder, new BoundConversion(syntax, operandPlaceholder, nestedConversion,
Binder\Binder_Expressions.cs (2)
3966return new BoundConversion( 9915expr = new BoundConversion(
Binder\Binder_Invocation.cs (1)
1922collection = new BoundConversion(
Binder\ForEachLoopBinder.cs (2)
667convertedCollectionExpression = new BoundConversion( 1573collectionExpr = new BoundConversion(
BoundTree\Constructors.cs (2)
337return new BoundConversion( 368return new BoundConversion(
Generated\BoundNodes.xml.Generated.cs (1)
3039var result = new BoundConversion(this.Syntax, operand, conversion, isBaseConversion, @checked, explicitCastInCode, constantValueOpt, conversionGroupOpt, inConversionGroupFlags, type, this.HasErrors);
Lowering\ClosureConversion\ClosureConversion.cs (1)
1414result = new BoundConversion(
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (7)
280result = new BoundConversion( 524return new BoundConversion( 742new BoundConversion( 1085return new BoundConversion( 1201var result = new BoundConversion( 1208return new BoundConversion(syntax, rewrittenOperand, conversion, @checked, explicitCastInCode: explicitCastInCode, conversionGroupOpt: null, InConversionGroupFlags.Unspecified, constantValueOpt: null, rewrittenType); 1854return new BoundConversion(
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (4)
70var newArgument = new BoundConversion( 121var convertedFieldAccess = new BoundConversion( 216return new BoundConversion( 481return new BoundConversion(
Lowering\SyntheticBoundNodeFactory.cs (1)
1556return new BoundConversion(Syntax, arg, conversion, @checked: isChecked, explicitCastInCode: explicitCastInCode, conversionGroupOpt: null, InConversionGroupFlags.Unspecified, null, type) { WasCompilerGenerated = true };
318 references to BoundConversion
Microsoft.CodeAnalysis.CSharp (318)
Binder\Binder_Attributes.cs (2)
873return VisitConversion((BoundConversion)node, diagnostics, ref attrHasErrors, curArgumentHasErrors); 906private TypedConstant VisitConversion(BoundConversion node, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors)
Binder\Binder_Await.cs (1)
384if (argument is BoundConversion)
Binder\Binder_Conversions.cs (3)
69Debug.Assert(result is BoundConversion || (conversion.IsIdentity && ((object)result == source) || source.NeedsToBeConverted()) || hasErrors); 2275else if (arg is BoundConversion { Operand: BoundCollectionExpression { Elements: [BoundExpression collectionElement] } }) 2806var unionConversion = new BoundConversion(
Binder\Binder_Deconstruct.cs (1)
161var boundConversion = new BoundConversion(
Binder\Binder_Expressions.cs (4)
5247case BoundConversion { Conversion.IsIdentity: true, Operand: BoundParameter param }: 6131if (argument is BoundConversion { Conversion.IsInterpolatedStringHandler: true, Operand: var operand }) 7791Debug.Assert(leftSymbol == (boundValue.ExpressionSymbol ?? ((BoundConversion)boundValue).Operand.ExpressionSymbol)); 10575else if (convertedIndex is BoundConversion { Operand: { ConstantValueOpt: { SpecialType: SpecialType.System_Int32, Int32Value: int constIndex } } operand })
Binder\Binder_Invocation.cs (1)
2021Debug.Assert(typeOrValue.ValueSymbol == (boundValue.ExpressionSymbol ?? ((BoundConversion)boundValue).Operand.ExpressionSymbol));
Binder\Binder_Operators.cs (8)
78var conversion = (BoundConversion)CreateConversion(node, placeholder, finalDynamicConversion, isCast: true, conversionGroupOpt: null, InConversionGroupFlags.Unspecified, left.Type, diagnostics); 281if (finalConversion is not BoundConversion final) 2919BoundConversion leftConv = (BoundConversion)left; 2920BoundConversion rightConv = (BoundConversion)right; 3407if (resultConversion is not BoundConversion)
Binder\Binder_Patterns.cs (2)
781var conversion = (BoundConversion)convertedExpression;
Binder\Binder_Query.cs (2)
685var c1 = invocation.Arguments[index] as BoundConversion;
Binder\Binder_Statements.cs (2)
2694return BoundConversion.Synthesized(node, BindToTypeForErrorRecovery(expr), Conversion.NoConversion, false, explicitCastInCode: false, conversionGroupOpt: null, InConversionGroupFlags.Unspecified, ConstantValue.NotAvailable, boolean, hasErrors: true); 2762return BoundConversion.Synthesized(node, expr, Conversion.NoConversion, false, explicitCastInCode: false, conversionGroupOpt: null, InConversionGroupFlags.Unspecified, ConstantValue.NotAvailable, boolean, hasErrors: true);
Binder\Binder.ValueChecks.cs (11)
1007var conversion = (BoundConversion)expr; 3906Debug.Assert(expr is BoundConversion conversion && 4243var conversion = (BoundConversion)expr; 4578var conversion = (BoundConversion)expr; 4835or BoundExpressionStatement { Expression: BoundConversion or BoundValuePlaceholder or BoundDynamicCollectionElementInitializer }); 5357var conversion = (BoundConversion)expr; 5748private SignatureOnlyMethodSymbol GetInlineArrayConversionEquivalentSignatureMethod(BoundConversion conversion, out ImmutableArray<BoundExpression> arguments, out ImmutableArray<RefKind> refKinds)
Binder\ForEachLoopBinder.cs (1)
661if ((convertedCollectionExpression as BoundConversion)?.Operand != (object)collectionExpr)
Binder\RefSafetyAnalysis.cs (5)
817if (arg is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 1205var right = node.Right; 1327case BoundConversion conv: 1352inlineArray: node.Expression is not BoundConversion { Conversion.IsIdentity: true, ExplicitCastInCode: false, Operand: BoundExpression operand } ? node.Expression : operand, 1486or BoundExpressionStatement { Expression: BoundConversion or BoundValuePlaceholder or BoundDynamicCollectionElementInitializer });
BoundTree\BoundCollectionExpression.cs (2)
38/// Returns <see cref="CollectionCreation"/> with any outer <see cref="BoundConversion"/> nodes unwrapped. The 52while (collectionCreation is BoundConversion conversion)
BoundTree\BoundConversion.cs (17)
33(Operand is BoundConversion operandAsConversion && 60Debug.Assert(Operand is not BoundConversion operandAsConversion || operandAsConversion.ConversionGroupOpt != ConversionGroupOpt); 66if (Operand is BoundConversion operandAsConversion && operandAsConversion.ConversionGroupOpt == ConversionGroupOpt) 93Debug.Assert(Operand is not BoundConversion operandAsConversion || 104if (Operand is BoundConversion operandAsConversion && operandAsConversion.ConversionGroupOpt == ConversionGroupOpt) 122Debug.Assert(Operand is BoundConversion operandAsConversion && 132Debug.Assert(Operand is BoundConversion operandAsConversion && 170Debug.Assert(Operand is not BoundConversion operandAsConversion || operandAsConversion.ConversionGroupOpt != ConversionGroupOpt); 177if (Operand is BoundConversion operandAsConversion && operandAsConversion.ConversionGroupOpt == ConversionGroupOpt) 200Debug.Assert(Operand is not BoundConversion operandAsConversion || 210Debug.Assert(Operand is BoundConversion operandAsConversion && 223public void TryGetUnionConversionParts(out BoundConversion? sourceConversion, out BoundConversion? constructor, out BoundConversion? final) 236BoundConversion? current = this; 240current = current.Operand as BoundConversion; 247current = current.Operand as BoundConversion;
BoundTree\BoundExpression.cs (1)
496public BoundConversion UpdateOperand(BoundExpression operand)
BoundTree\BoundExpressionExtensions.cs (2)
255BoundConversion conversionNode = (BoundConversion)boundNode;
BoundTree\BoundNode.cs (12)
365BoundConversion { Operand: BoundCollectionExpression { IsParamsArrayOrCollection: true } }); 450case BoundConversion boundConversion: 460BoundConversion? possiblyUserDefined = boundConversion; 463possiblyUserDefined = possiblyUserDefined.Operand as BoundConversion; 471while (operand is BoundConversion operandAsConversion && operandAsConversion.ConversionGroupOpt == conversionGroupOpt) 487BoundConversion? possiblyUnion = boundConversion; 490possiblyUnion = possiblyUnion.Operand as BoundConversion; 498while (operand is BoundConversion operandAsConversion && operandAsConversion.ConversionGroupOpt == conversionGroupOpt) 514boundConversion = (BoundConversion)boundConversion.Operand; 520BoundConversion next; 523(object)(next = (BoundConversion)boundConversion.Operand).Operand == placeholder || 524(object)((BoundConversion)next.Operand).Operand == placeholder)
BoundTree\BoundTreeVisitors.cs (1)
64return VisitConversion(node as BoundConversion, arg);
BoundTree\Constructors.cs (2)
335public static BoundConversion SynthesizedNonUserDefined(SyntaxNode syntax, BoundExpression operand, Conversion conversion, TypeSymbol type, ConstantValue? constantValueOpt = null) 356public static BoundConversion Synthesized(
CodeGen\EmitConversion.cs (7)
40private void EmitConversionExpression(BoundConversion conversion, bool used) 91private void EmitConversion(BoundConversion conversion) 213private void EmitIdentityConversion(BoundConversion conversion) 243private void EmitNumericConversion(BoundConversion conversion) 256private void EmitImplicitReferenceConversion(BoundConversion conversion) 288private void EmitExplicitReferenceConversion(BoundConversion conversion) 315private void EmitEnumConversion(BoundConversion conversion)
CodeGen\EmitExpression.cs (10)
127EmitConversionExpression((BoundConversion)expression, used); 1310var conversion = (BoundConversion)receiver; 1350if (receiver.Kind == BoundKind.Conversion && ((BoundConversion)receiver).ConversionKind == ConversionKind.Unboxing) 1627var conversion = (BoundConversion)receiver; 2283BoundConversion conv = (BoundConversion)current; 4087var conversion = (BoundConversion)expr;
CodeGen\EmitOperators.cs (1)
375if (comparand is BoundConversion { Type.SpecialType: SpecialType.System_Object, ConversionKind: ConversionKind.Boxing, Operand.Type: TypeParameterSymbol { AllowsRefLikeType: true } } &&
CodeGen\Optimizer.cs (2)
592public override BoundNode VisitConversion(BoundConversion node) 996((BoundConversion)right).ConversionKind.IsPointerConversion())
Compilation\CSharpSemanticModel.cs (17)
1949highestBoundNode is BoundConversion { ConversionKind: ConversionKind.MethodGroup } boundConversion) 2114else if ((highestBoundExpr as BoundConversion)?.Conversion.IsTupleLiteralConversion == true) 2116var tupleLiteralConversion = (BoundConversion)highestBoundExpr; 2142if (highestBoundExpr is BoundConversion { ConversionKind: ConversionKind.SwitchExpression, Conversion: var convertedSwitchConversion }) 2160if (highestBoundExpr is BoundConversion { ConversionKind: ConversionKind.ConditionalExpression }) 2179if (highestBoundExpr is BoundConversion { ConversionKind: ConversionKind.CollectionExpression or ConversionKind.NoConversion, Conversion: var convertedCollectionConversion }) 2185else if (highestBoundExpr is BoundConversion { ConversionKind: ConversionKind.ImplicitNullable, Conversion.UnderlyingConversions: [{ Kind: ConversionKind.CollectionExpression }] } boundConversion) 2206else if (((BoundConversion)highestBoundExpr).Operand.Kind != BoundKind.Conversion) 2221conversion = binder.Conversions.ClassifyConversionFromExpression(boundExpr, convertedType, isChecked: ((BoundConversion)highestBoundExpr).Checked, ref discardedUseSiteInfo); 2253else if (boundExpr is BoundConversion { ConversionKind: ConversionKind.MethodGroup, Conversion: var exprConversion, Type: { TypeKind: TypeKind.FunctionPointer }, SymbolOpt: var symbol }) 3537var conversion = (BoundConversion)boundNode; 3555conversion.Operand is BoundConversion { Conversion.IsUnion: true } unionConversion && 4320var conversion = (BoundConversion)boundNodeForSyntacticParent; 4327else if (conversion.Operand is BoundConversion { ConversionKind: ConversionKind.MethodGroup } nestedMethodGroupConversion)
Compilation\MemberSemanticModel.cs (2)
1051var boundConversion = boundDeconstruction.Right; 1853node = ((BoundConversion)node).Operand;
Compiler\MethodBodySynthesizer.cs (4)
123BoundConversion.Synthesized(syntax, 152BoundConversion.Synthesized(syntax, 399delegateUpdate = BoundConversion.SynthesizedNonUserDefined(syntax, 464delegateUpdate = BoundConversion.SynthesizedNonUserDefined(syntax,
FlowAnalysis\AbstractFlowPass.cs (5)
1750public override BoundNode VisitConversion(BoundConversion node) 1777protected virtual void AfterVisitConversion(BoundConversion node) 2674|| (expr is BoundConversion { ConversionKind: ConversionKind.ExplicitNullable or ConversionKind.ImplicitNullable } conv 3020BoundConversion { Conversion: Conversion conversion, Operand: BoundConditionalAccess ca } when CanPropagateStateWhenNotNull(conversion) => ca, 3128Debug.Assert(innerCondAccess.Receiver is not (BoundConditionalAccess or BoundConversion));
FlowAnalysis\AbstractRegionDataFlowPass.cs (1)
74protected override void AfterVisitConversion(BoundConversion node)
FlowAnalysis\DefiniteAssignment.cs (3)
888BoundConversion boundConversion = (BoundConversion)value; 2837protected override void AfterVisitConversion(BoundConversion node)
FlowAnalysis\NullableWalker.cs (46)
272/// The delegate is invoked by <see cref="VisitConversion(BoundConversion, BoundExpression, Conversion, TypeWithAnnotations, TypeWithState, bool, bool, bool, AssignmentKind, ParameterSymbol, bool, bool, bool, bool, Optional&lt;LocalState&gt;,bool, int, Location, ArrayBuilder&lt;VisitResult&gt;)"/>. 2212var conv = (BoundConversion)node; 2688var conversion = (BoundConversion)expr; 4252while (collectionCreation is BoundConversion conversion) 4305if (node.Conversion is BoundConversion { Conversion: var conversion }) 5223var expression = GetConversionIfApplicable(expressions[i], expressionNoConversion); 5636if (binary.Left is BoundConversion leftConversionNode && leftConversionNode != leftOperand) 5736expr as BoundConversion, 5849expr as BoundConversion, 6003operand = ((BoundConversion)operand).Operand; 6197var conversion = (BoundConversion)possiblyConversion; 6306if ((node.RightOperand as BoundConversion)?.ExplicitCastInCode != false && 6362if (node is BoundConversion boundConversion) 6464Debug.Assert(innerCondAccess.Receiver is not (BoundConditionalAccess or BoundConversion)); 7878TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState.Create(argument.Type, result.RValueType.State), argument as BoundConversion, argumentNoConversion); 7938elements = ((BoundCollectionExpression)((BoundConversion)argument).Operand).UnconvertedCollectionExpression.Elements.CastArray<BoundExpression>(); 8294BoundConversion? conversionOpt, 9116var conversion = (BoundConversion)expr; 9328public override BoundNode? VisitConversion(BoundConversion node) 9589BoundConversion? conversionOpt, 9871private static BoundConversion? GetConversionIfApplicable(BoundExpression? conversionOpt, BoundExpression convertedNode) 9878return conversionOpt == convertedNode ? null : (BoundConversion?)conversionOpt; 9901BoundConversion? conversionOpt, 10116if (useLegacyWarnings && conversionOperand is BoundConversion operandConversion && !operandConversion.ConversionKind.IsUserDefinedConversion()) // Based on behavior of NullableT_NullableStructToClass unit-test we don't need to specially handle Union conversions here 10521BoundConversion? conversionOpt, 10673BoundConversion? conversionOpt, 10711BoundConversion? sourceToParameterConversion = null; 10712BoundConversion? unionConstructionConversion = null; 10843var conversionOpt = conversionExpression as BoundConversion; 10851conversionOpt = conversionOpt.Operand as BoundConversion; 10855private void TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState resultType, BoundConversion? conversionOpt, BoundExpression convertedNode) 10876conversionOpt = conversionOpt.Operand as BoundConversion; 11506var right = node.Right; 11788var conv = (BoundConversion)expr; 11908if (node.OperandConversion is BoundConversion { Conversion: ({ IsUserDefined: true } or { IsUnion: true }) and { Method.ParameterCount: 1 } operandConversion }) 12106node.LeftConversion as BoundConversion ?? node.Left, 12690if (!reportedDiagnostic && !(collectionExpression is BoundConversion { Operand: { IsSuppressed: true } })) 12768if (node.Expression is not BoundConversion { Operand.IsSuppressed: true } && 12805isSuppressed: node.Expression is BoundConversion { Operand.IsSuppressed: true }, 12938node.Operand as BoundConversion,
Generated\BoundNodes.xml.Generated.cs (17)
1893public BoundDeconstructionAssignmentOperator(SyntaxNode syntax, BoundTupleExpression left, BoundConversion right, bool isUsed, TypeSymbol type, bool hasErrors = false) 1908public BoundConversion Right { get; } 1914public BoundDeconstructionAssignmentOperator Update(BoundTupleExpression left, BoundConversion right, bool isUsed, TypeSymbol type) 3035public BoundConversion Update(BoundExpression operand, Conversion conversion, bool isBaseConversion, bool @checked, bool explicitCastInCode, ConstantValue? constantValueOpt, ConversionGroup? conversionGroupOpt, InConversionGroupFlags inConversionGroupFlags, TypeSymbol type) 3039var result = new BoundConversion(this.Syntax, operand, conversion, isBaseConversion, @checked, explicitCastInCode, constantValueOpt, conversionGroupOpt, inConversionGroupFlags, type, this.HasErrors); 9228return VisitConversion((BoundConversion)node, arg); 9635public virtual R VisitConversion(BoundConversion node, A arg) => this.DefaultVisit(node, arg); 9876public virtual BoundNode? VisitConversion(BoundConversion node) => this.DefaultVisit(node); 10313public override BoundNode? VisitConversion(BoundConversion node) 11397BoundConversion right = (BoundConversion)this.Visit(node.Right); 11591public override BoundNode? VisitConversion(BoundConversion node) 13296BoundConversion right = (BoundConversion)this.Visit(node.Right); 13764public override BoundNode? VisitConversion(BoundConversion node) 13767BoundConversion updatedNode; 16152public override TreeDumperNode VisitConversion(BoundConversion node, object? arg) => new TreeDumperNode("conversion", null, new TreeDumperNode[]
Lowering\BoundTreeToDifferentEnclosingContextRewriter.cs (1)
169public override BoundNode? VisitConversion(BoundConversion node)
Lowering\ClosureConversion\ClosureConversion.cs (1)
1402public override BoundNode VisitConversion(BoundConversion conversion)
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (6)
209return VisitConversion((BoundConversion)node); 542var conversion = (BoundConversion)operand; 676var conversion = e as BoundConversion; 694private BoundExpression VisitConversion(BoundConversion node)
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
402!(node is BoundConversion) && 850public override BoundNode VisitConversion(BoundConversion node)
Lowering\DiagnosticsPass_Warnings.cs (19)
143BoundConversion conversion = (BoundConversion)receiver; 166BoundConversion conversion = current as BoundConversion; 288if (!node.Operator.Kind.IsDynamic() && node.LeftConversion is BoundConversion { Conversion: { IsIdentity: false, Exists: true } conversion }) 346return node.Kind == BoundKind.Conversion && ((BoundConversion)node).ExplicitCastInCode; 353var conv = (BoundConversion)node; 430for (BoundConversion conversion = operand as BoundConversion; 432conversion = conversion.Operand as BoundConversion) 578BoundConversion conv = (BoundConversion)operand; 610BoundConversion conv = (BoundConversion)expr; 866var conv = (BoundConversion)node; 890var conversion = (BoundConversion)right;
Lowering\Extensions.cs (4)
58var conversion = (BoundConversion)expr; 105var conversion = (BoundConversion)expr;
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (2)
723var conversion = (BoundConversion)expression;
Lowering\LocalRewriter\LocalRewriter_Call.cs (7)
589BoundConversion conv = (BoundConversion)current; 887if (argument is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 895Debug.Assert(!((BoundConversion)argument).ExplicitCastInCode); 962if (argument is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 968Debug.Assert(!((BoundConversion)argument).ExplicitCastInCode); 1617=> expr is BoundConversion conv && conv.ConversionKind == ConversionKind.AnonymousFunction;
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (4)
828var spreadElementConversion = expressionStatement.Expression is BoundConversion { Conversion: var actualConversion } ? actualConversion : Conversion.Identity; 1143if (spreadElement.IteratorBody is not BoundExpressionStatement expressionStatement || expressionStatement.Expression is BoundConversion { ConversionKind: not ConversionKind.Identity }) 1565var convertedExpression = (BoundConversion?)node.Conversion;
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (2)
1059var conv = (BoundConversion)expression;
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (12)
18public override BoundNode VisitConversion(BoundConversion node) 249var conversion = (BoundConversion)rewrittenNode; 261BoundConversion? oldNodeOpt, 297BoundConversion? oldNodeOpt, 1076case BoundConversion { Conversion: { Kind: ConversionKind.ImplicitNullable }, Operand: var convertedArgument } 1081case BoundConversion { Conversion: { Kind: ConversionKind.ImplicitNullable, UnderlyingConversions: var underlying }, Operand: var convertedArgument } conversion 1187rewrittenOperand = BoundConversion.SynthesizedNonUserDefined(syntax, rewrittenOperand, Conversion.ImplicitEnumeration, rewrittenOperandType); 1201var result = new BoundConversion( 1431return BoundConversion.Synthesized( 1475return BoundConversion.Synthesized( 1637return BoundConversion.Synthesized(syntax, rewrittenOperand, conversion, @checked, explicitCastInCode: explicitCastInCode, conversionGroupOpt: null, InConversionGroupFlags.Unspecified, constantValueOpt, rewrittenType);
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (5)
19var right = node.Right; 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 } 307var tupleConversion = (BoundConversion)right;
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (4)
129(BoundConversion)node.Expression, 142BoundConversion convertedCollection, 1226var boundConversion = (BoundConversion)node.Expression;
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (1)
828else if (unloweredExpr is BoundConversion { Operand: { Type: { SpecialType: SpecialType.System_Int32 } } operand })
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (4)
44if (leftConversion is BoundConversion { Conversion: { IsIdentity: false } }) 50if (leftConversion is not BoundConversion { Conversion: { Exists: true } }) 223var boundConversion = (BoundConversion)expression;
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (3)
289if (argument is BoundConversion { ConversionKind: ConversionKind.Boxing, Type.SpecialType: SpecialType.System_Object, Operand: { Type.SpecialType: SpecialType.System_Char } operand }) 629BoundConversion conv = (BoundConversion)expr;
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (3)
16private BoundExpression RewriteInterpolatedStringConversion(BoundConversion conversion) 240if (arg is BoundConversion { Conversion: { Kind: ConversionKind.InterpolatedStringHandler }, ExplicitCastInCode: false, Operand: var operand }) 251Debug.Assert(arguments.All(arg => arg is not BoundConversion { Conversion: { IsInterpolatedStringHandler: true }, ExplicitCastInCode: false }));
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (18)
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 70var newArgument = new BoundConversion( 89case BoundConversion { Conversion: { Kind: var kind }, Operand: var o } when 104if (expr is BoundConversion { ConversionKind: ConversionKind.ImplicitTuple, Conversion: var conversion } boundConversion) 121var convertedFieldAccess = new BoundConversion( 193case BoundConversion { Conversion: { Kind: ConversionKind.DefaultLiteral } }: // This conversion can be performed lazily, but need not be saved. It is treated as non-side-effecting. 194case BoundConversion { Conversion.IsTupleConversion: true }: // If we were not able to push this conversion down the tree before getting here, it must be performed early, otherwise it won't be properly lowered by this machinery. 196case BoundConversion { Conversion: { Kind: var conversionKind } conversion } when conversionMustBePerformedOnOriginalExpression(conversionKind): 199case BoundConversion { Conversion: { IsUserDefined: true } or { IsUnion: true } } conv when conv.ExplicitCastInCode || enclosingConversionWasExplicit: 202case BoundConversion conv: 407case BoundConversion { Conversion: { IsIdentity: true }, Operand: var o }: 409case BoundConversion { Conversion: { IsNullable: true, UnderlyingConversions: var underlying } conversion, Operand: var o } 442case BoundConversion { Conversion: { IsIdentity: true }, Operand: var o }: 444case BoundConversion { Conversion: { IsNullable: true, UnderlyingConversions: var nested }, Operand: var o } conv when 479BoundExpression MakeBoundConversion(BoundExpression expr, Conversion conversion, TypeWithAnnotations type, BoundConversion enclosing) 615return (expr is BoundConversion conv)
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (1)
769while (expression is BoundConversion conversion)
Lowering\LocalRewriter\LocalRewriter.cs (1)
1132return expr is BoundConversion { Conversion: { IsInterpolatedStringHandler: true }, Type: { IsValueType: true } };
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
204public override BoundNode VisitConversion(BoundConversion node)
Lowering\SpillSequenceSpiller.cs (1)
1258public override BoundNode VisitConversion(BoundConversion node)
Lowering\SyntheticBoundNodeFactory.cs (2)
581expression = BoundConversion.Synthesized(Syntax, expression, conversion, false, explicitCastInCode: false, conversionGroupOpt: null, InConversionGroupFlags.Unspecified, ConstantValue.NotAvailable, CurrentFunction.ReturnType); 1294? BoundConversion.SynthesizedNonUserDefined(syntax, nullLiteral, Conversion.NullToPointer, type)
Operations\CSharpOperationFactory_Methods.cs (2)
39IOperation value = Create(expression is BoundConversion { IsParamsArrayOrCollection: true } conversion ? conversion.Operand : expression); 143if (delegateNode is BoundConversion boundConversion)
Operations\CSharpOperationFactory.cs (12)
89return CreateBoundConversionOperation((BoundConversion)boundNode); 1030private IOperation CreateBoundConversionOperation(BoundConversion boundConversion, bool forceOperandImplicitLiteral = false) 1044boundConversion.TryGetUnionConversionParts(out BoundConversion? sourceConversion, out BoundConversion? unionConversion, out _); 1063if (boundConversion.Operand is BoundConversion operandAsConversion && 1136BoundConversion correctedConversionNode = boundConversion; 1157var nestedConversion = (BoundConversion)boundOperand; 1316while (collectionCreation is BoundConversion conversion) 2063boundForEachStatement.Expression is not BoundConversion { Conversion.IsIdentity: true, ExplicitCastInCode: false, Operand: BoundExpression operand } ? 2440BoundConversion { Operand: BoundLiteral } c => CreateBoundConversionOperation(c, forceOperandImplicitLiteral: true), 2502private IInterpolatedStringHandlerCreationOperation CreateInterpolatedStringHandler(BoundConversion conversion)
Symbols\ConstantValueUtils.cs (2)
99var conversion = (BoundConversion)unconvertedBoundValue;
Symbols\Source\ParameterHelpers.cs (2)
1104var conversion = (BoundConversion)expression;
Symbols\Source\SourceComplexParameterSymbol.cs (1)
408((BoundConversion)convertedExpression).ConversionKind != ConversionKind.DefaultLiteral)