1 write to Conversion
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
2848this.Conversion = conversion;
74 references to Conversion
Microsoft.CodeAnalysis.CSharp (73)
Binder\Binder.ValueChecks.cs (1)
3429if (conversion.Conversion == Conversion.ImplicitThrow)
Binder\Binder_Expressions.cs (2)
4295case BoundConversion { Conversion.IsIdentity: true, Operand: BoundParameter param }: 5055if (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 (1)
729VisitDeconstructionArguments(variables, right.Syntax, right.Conversion, right.Operand);
BoundTree\BoundExpression.cs (4)
406get { return this.Conversion.Kind; } 411get { return this.Conversion.IsExtensionMethod; } 416get { return this.Conversion.Method; } 431return this.Update(operand: operand, this.Conversion, this.IsBaseConversion, this.Checked, this.ExplicitCastInCode, this.ConstantValueOpt, this.ConversionGroupOpt, this.OriginalUserDefinedConversionsOpt, this.Type);
BoundTree\BoundExpressionExtensions.cs (1)
228return conversionNode.Conversion;
BoundTree\BoundNode.cs (4)
399return boundConversion.Conversion; 402if (!boundConversion.Conversion.IsUserDefined) 407if (boundConversion.Conversion.IsUserDefined) 415return boundConversion.Conversion;
Compilation\CSharpSemanticModel.cs (4)
2124else if ((highestBoundExpr as BoundConversion)?.Conversion.IsTupleLiteralConversion == true) 2139conversion = tupleLiteralConversion.Conversion; 2152if (highestBoundExpr is BoundConversion { ConversionKind: ConversionKind.SwitchExpression, Conversion: var convertedSwitchConversion }) 2240else if (boundExpr is BoundConversion { ConversionKind: ConversionKind.MethodGroup, Conversion: var exprConversion, Type: { TypeKind: TypeKind.FunctionPointer }, SymbolOpt: var symbol })
Compilation\MemberSemanticModel.cs (2)
1003return new DeconstructionInfo(boundConversion.Conversion); 1021return new DeconstructionInfo(boundDeconstruction.DeconstructionAssignment.Right.Conversion);
FlowAnalysis\AbstractFlowPass.cs (1)
2785BoundConversion { Conversion: Conversion conversion, Operand: BoundConditionalAccess ca } when CanPropagateStateWhenNotNull(conversion) => ca,
FlowAnalysis\NullableWalker.cs (5)
1988switch (conv.Conversion.Kind) 2426var conversionKind = conversion.Conversion.Kind; 7240return (expr, conversion.Conversion); 9233VisitDeconstructionArguments(variables, right.Conversion, right.Operand, rightResultOpt); 9546if (node.OperandConversion is BoundConversion { Conversion: var operandConversion } && operandConversion.IsUserDefined && operandConversion.Method?.ParameterCount == 1)
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)) 10847return node.Update(operand, node.Conversion, node.IsBaseConversion, node.Checked, node.ExplicitCastInCode, node.ConstantValueOpt, node.ConversionGroupOpt, node.OriginalUserDefinedConversionsOpt, type); 12806updatedNode = node.Update(operand, node.Conversion, node.IsBaseConversion, node.Checked, node.ExplicitCastInCode, node.ConstantValueOpt, node.ConversionGroupOpt, node.OriginalUserDefinedConversionsOpt, infoAndType.Type!); 12811updatedNode = node.Update(operand, node.Conversion, node.IsBaseConversion, node.Checked, node.ExplicitCastInCode, node.ConstantValueOpt, node.ConversionGroupOpt, node.OriginalUserDefinedConversionsOpt, node.Type); 15066new TreeDumperNode("conversion", node.Conversion, null),
Lowering\ClosureConversion\ClosureConversion.cs (2)
1376Debug.Assert(_inExpressionLambda || conversion.Conversion.MethodSymbol is null); 1388conversion: conversion.Conversion,
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
604conversion.Conversion,
Lowering\DiagnosticsPass_ExpressionTrees.cs (2)
726CheckMethodGroup((BoundMethodGroup)node.Operand, node.Conversion.Method, node.IsExtensionMethod, parentIsConversion: true, node.Type); 766if (_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)
987return expr is BoundConversion { Conversion: { IsInterpolatedStringHandler: true }, Type: { IsValueType: true } };
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
207visitConversion(node.Conversion);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (4)
72var result = MakeConversionNode(node, node.Syntax, rewrittenOperand, node.Conversion, node.Checked, node.ExplicitCastInCode, node.ConstantValueOpt, rewrittenType); 865case BoundConversion { Conversion: { Kind: ConversionKind.ImplicitNullable }, Operand: var convertedArgument } 870case BoundConversion { Conversion: { Kind: ConversionKind.ImplicitNullable, UnderlyingConversions: var underlying }, Operand: var convertedArgument } conversion 873conversion.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 (1)
1003collectionConversion = boundConversion.Conversion;
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (2)
46if (leftConversion is BoundConversion { Conversion: { IsIdentity: false } }) 52if (leftConversion is not BoundConversion { Conversion: { Exists: true } })
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (2)
389if (arg is BoundConversion { Conversion: { Kind: ConversionKind.InterpolatedStringHandler }, ExplicitCastInCode: false, Operand: var operand }) 400Debug.Assert(arguments.All(arg => arg is not BoundConversion { Conversion: { IsInterpolatedStringHandler: true }, ExplicitCastInCode: false }));
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (14)
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 } }: 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)
603if (!conversion.Conversion.IsIdentity)
Lowering\MethodToClassRewriter.cs (1)
288var conversion = node.Conversion;
Operations\CSharpOperationFactory.cs (3)
1072Conversion conversion = boundConversion.Conversion; 1103conversion = nestedConversion.Conversion; 2302Debug.Assert(conversion.Conversion.IsInterpolatedStringHandler);
Symbols\Source\ParameterHelpers.cs (1)
860return conversion is { Conversion.IsObjectCreation: true, Operand: BoundObjectCreationExpression { WasTargetTyped: true } operand } &&
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\ForEachTests.cs (1)
1225return ((BoundConversion)boundNode.Expression).Conversion;