1 write to Conversion
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
2959this.Conversion = conversion;
101 references to Conversion
Microsoft.CodeAnalysis.CSharp (101)
Binder\Binder.ValueChecks.cs (14)
3606(!conversion.Conversion.IsUserDefined || 3607conversion.Conversion.Method.HasUnsupportedMetadata || 3608conversion.Conversion.Method.RefKind == RefKind.None)); 3971if (conversion.Conversion == Conversion.ImplicitThrow) 3976Debug.Assert(!conversion.Conversion.IsUserDefined || 3977conversion.Conversion.Method.HasUnsupportedMetadata || 3978conversion.Conversion.Method.RefKind == RefKind.None); 4360if (conversion.Conversion.IsInlineArray) 4378if (conversion.Conversion.IsUserDefined) 4380var operatorMethod = conversion.Conversion.Method; 5134if (conversion.Conversion.IsInlineArray) 5156if (conversion.Conversion.IsUserDefined) 5158var operatorMethod = conversion.Conversion.Method; 5521Debug.Assert(conversion.Conversion.IsInlineArray);
Binder\Binder_Attributes.cs (2)
914if (node.Conversion.IsCollectionExpression 915&& node.Conversion.GetCollectionExpressionTypeKind(out _, out _, out _) == CollectionExpressionTypeKind.Array)
Binder\Binder_Expressions.cs (2)
5086case BoundConversion { Conversion.IsIdentity: true, Operand: BoundParameter param }: 5911if (argument is BoundConversion { Conversion.IsInterpolatedStringHandler: true, Operand: var operand })
Binder\Binder_Operators.cs (2)
68conversion = conversion.Update(conversion.Operand, conversion.Conversion, conversion.IsBaseConversion, conversion.Checked, 219else if (final.Conversion.IsExplicit &&
Binder\RefSafetyAnalysis.cs (2)
916VisitDeconstructionArguments(variables, right.Syntax, right.Conversion, right.Operand); 1054inlineArray: node.Expression is not BoundConversion { Conversion.IsIdentity: true, ExplicitCastInCode: false, Operand: BoundExpression operand } ? node.Expression : operand,
BoundTree\BoundExpression.cs (4)
455get { return this.Conversion.Kind; } 460get { return this.Conversion.IsExtensionMethod; } 465get { return this.Conversion.Method; } 480return this.Update(operand: operand, this.Conversion, this.IsBaseConversion, this.Checked, this.ExplicitCastInCode, this.ConstantValueOpt, this.ConversionGroupOpt, this.OriginalUserDefinedConversionsOpt, this.Type);
BoundTree\BoundExpressionExtensions.cs (1)
246return conversionNode.Conversion;
BoundTree\BoundNode.cs (4)
454return boundConversion.Conversion; 457if (!boundConversion.Conversion.IsUserDefined) 462if (boundConversion.Conversion.IsUserDefined) 470return boundConversion.Conversion;
BoundTree\BoundNode_Source.cs (1)
322append($" {conversion.Conversion} ");
Compilation\CSharpSemanticModel.cs (7)
2103else if ((highestBoundExpr as BoundConversion)?.Conversion.IsTupleLiteralConversion == true) 2118conversion = tupleLiteralConversion.Conversion; 2131if (highestBoundExpr is BoundConversion { ConversionKind: ConversionKind.SwitchExpression, Conversion: var convertedSwitchConversion }) 2168if (highestBoundExpr is BoundConversion { ConversionKind: ConversionKind.CollectionExpression or ConversionKind.NoConversion, Conversion: var convertedCollectionConversion }) 2174else if (highestBoundExpr is BoundConversion { ConversionKind: ConversionKind.ImplicitNullable, Conversion.UnderlyingConversions: [{ Kind: ConversionKind.CollectionExpression }] } boundConversion) 2178conversion = boundConversion.Conversion; 2242else if (boundExpr is BoundConversion { ConversionKind: ConversionKind.MethodGroup, Conversion: var exprConversion, Type: { TypeKind: TypeKind.FunctionPointer }, SymbolOpt: var symbol })
Compilation\MemberSemanticModel.cs (2)
1012return new DeconstructionInfo(boundConversion.Conversion); 1030return new DeconstructionInfo(boundDeconstruction.DeconstructionAssignment.Right.Conversion);
FlowAnalysis\AbstractFlowPass.cs (1)
2977BoundConversion { Conversion: Conversion conversion, Operand: BoundConditionalAccess ca } when CanPropagateStateWhenNotNull(conversion) => ca,
FlowAnalysis\DefiniteAssignment.cs (1)
2807if (node.Conversion.IsInlineArray &&
FlowAnalysis\NullableWalker.cs (6)
2036switch (conv.Conversion.Kind) 2493var conversionKind = conversion.Conversion.Kind; 3829if (node.Conversion is BoundConversion { Conversion: var conversion }) 8075return (expr, conversion.Conversion); 10120VisitDeconstructionArguments(variables, right.Conversion, right.Operand, rightResultOpt); 10433if (node.OperandConversion is BoundConversion { Conversion: var operandConversion } && operandConversion.IsUserDefined && operandConversion.Method?.ParameterCount == 1)
Generated\BoundNodes.xml.Generated.cs (5)
2983if (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)) 11242return node.Update(operand, node.Conversion, node.IsBaseConversion, node.Checked, node.ExplicitCastInCode, node.ConstantValueOpt, node.ConversionGroupOpt, node.OriginalUserDefinedConversionsOpt, type); 13273updatedNode = node.Update(operand, node.Conversion, node.IsBaseConversion, node.Checked, node.ExplicitCastInCode, node.ConstantValueOpt, node.ConversionGroupOpt, node.OriginalUserDefinedConversionsOpt, infoAndType.Type!); 13278updatedNode = node.Update(operand, node.Conversion, node.IsBaseConversion, node.Checked, node.ExplicitCastInCode, node.ConstantValueOpt, node.ConversionGroupOpt, node.OriginalUserDefinedConversionsOpt, node.Type); 15626new TreeDumperNode("conversion", node.Conversion, null),
Lowering\ClosureConversion\ClosureConversion.cs (2)
1392Debug.Assert(_inExpressionLambda || conversion.Conversion.MethodSymbol is null); 1404conversion: conversion.Conversion,
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
674conversion.Conversion,
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
791CheckMethodGroup((BoundMethodGroup)node.Operand, node.Conversion.Method, node.IsExtensionMethod, parentIsConversion: true, node.Type); 838if (_inExpressionLambda && node.Conversion.Method is MethodSymbol method && (method.IsAbstract || method.IsVirtual) && method.IsStatic)
Lowering\DiagnosticsPass_Warnings.cs (1)
288if (!node.Operator.Kind.IsDynamic() && node.LeftConversion is BoundConversion { Conversion: { IsIdentity: false, Exists: true } conversion })
Lowering\LocalRewriter\LocalRewriter.cs (1)
1117return expr is BoundConversion { Conversion: { IsInterpolatedStringHandler: true }, Type: { IsValueType: true } };
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
206visitConversion(node.Conversion);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (7)
61case ConversionKind.ImplicitNullable when node.Conversion.UnderlyingConversions[0].Kind is ConversionKind.CollectionExpression: 62var rewrittenCollection = RewriteCollectionExpressionConversion(node.Conversion.UnderlyingConversions[0], (BoundCollectionExpression)node.Operand); 66return RewriteCollectionExpressionConversion(node.Conversion, (BoundCollectionExpression)node.Operand); 79var result = MakeConversionNode(node, node.Syntax, rewrittenOperand, node.Conversion, node.Checked, node.ExplicitCastInCode, node.ConstantValueOpt, rewrittenType); 1007case BoundConversion { Conversion: { Kind: ConversionKind.ImplicitNullable }, Operand: var convertedArgument } 1012case BoundConversion { Conversion: { Kind: ConversionKind.ImplicitNullable, UnderlyingConversions: var underlying }, Operand: var convertedArgument } conversion 1015conversion.Conversion.AssertUnderlyingConversionsChecked();
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (4)
20Debug.Assert(right.Conversion.Kind == ConversionKind.Deconstruction); 22return RewriteDeconstruction(node.Left, right.Conversion, right.Operand, node.IsUsed); 307if ((tupleConversion.Conversion.Kind == ConversionKind.ImplicitTupleLiteral || tupleConversion.Conversion.Kind == ConversionKind.Identity)
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (2)
162var receiver = ConvertReceiverForInvocation(forEachSyntax, rewrittenExpression, getEnumeratorInfo.Method, convertedCollection.Conversion, enumeratorInfo.CollectionType); 1228collectionConversion = boundConversion.Conversion;
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (2)
44if (leftConversion is BoundConversion { Conversion: { IsIdentity: false } }) 50if (leftConversion is not BoundConversion { Conversion: { Exists: true } })
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (2)
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 (15)
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 103if (expr is BoundConversion { ConversionKind: ConversionKind.ImplicitTuple, Conversion: var conversion } boundConversion) 190case BoundConversion { Conversion: { Kind: ConversionKind.DefaultLiteral } }: // This conversion can be performed lazily, but need not be saved. It is treated as non-side-effecting. 191case 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. 193case BoundConversion { Conversion: { Kind: var conversionKind } conversion } when conversionMustBePerformedOnOriginalExpression(conversionKind): 196case BoundConversion { Conversion: { IsUserDefined: true } } conv when 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 441conv.Conversion.AssertUnderlyingConversionsChecked(); 611conversion: conv.Conversion, @checked: conv.Checked, explicitCastInCode: conv.ExplicitCastInCode,
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (1)
610if (!conversion.Conversion.IsIdentity)
Lowering\MethodToClassRewriter.cs (1)
293var conversion = node.Conversion;
Operations\CSharpOperationFactory.cs (4)
1078Conversion conversion = boundConversion.Conversion; 1109conversion = nestedConversion.Conversion; 1978boundForEachStatement.Expression is not BoundConversion { Conversion.IsIdentity: true, ExplicitCastInCode: false, Operand: BoundExpression operand } ? 2419Debug.Assert(conversion.Conversion.IsInterpolatedStringHandler);
Symbols\Source\ParameterHelpers.cs (1)
893return conversion is { Conversion.IsObjectCreation: true, Operand: BoundObjectCreationExpression { WasTargetTyped: true } operand } &&