82 references to ConversionKind
Microsoft.CodeAnalysis.CSharp (82)
Binder\Binder.ValueChecks.cs (7)
785if (conversion.ConversionKind == ConversionKind.Unboxing) 4346Debug.Assert(conversion.ConversionKind != ConversionKind.StackAllocToSpanType, "StackAllocToSpanType unexpected"); 4348if (conversion.ConversionKind == ConversionKind.InterpolatedStringHandler) 4353if (conversion.ConversionKind == ConversionKind.CollectionExpression) 5117Debug.Assert(conversion.ConversionKind != ConversionKind.StackAllocToSpanType, "StackAllocToSpanType unexpected"); 5119if (conversion.ConversionKind == ConversionKind.InterpolatedStringHandler) 5124if (conversion.ConversionKind == ConversionKind.CollectionExpression)
Binder\Binder_Patterns.cs (4)
696else if ((conversion.ConversionKind == ConversionKind.Boxing || conversion.ConversionKind == ConversionKind.ImplicitReference) 706else if (conversion.ConversionKind == ConversionKind.ImplicitNullToPointer || 707(conversion.ConversionKind == ConversionKind.NoConversion && convertedExpression.Type?.IsErrorType() == true))
Binder\RefSafetyAnalysis.cs (2)
640if (arg is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 1030switch (conv.ConversionKind)
BoundTree\BoundExpression.cs (1)
493switch (this.ConversionKind)
CodeGen\EmitConversion.cs (6)
42switch (conversion.ConversionKind) 45throw ExceptionUtilities.UnexpectedValue(conversion.ConversionKind); 93switch (conversion.ConversionKind) 132throw ExceptionUtilities.UnexpectedValue(conversion.ConversionKind); 174throw ExceptionUtilities.UnexpectedValue(conversion.ConversionKind); // Should be handled by caller. 178throw ExceptionUtilities.UnexpectedValue(conversion.ConversionKind);
CodeGen\EmitExpression.cs (6)
1234if (conversion.ConversionKind == ConversionKind.Unboxing) 1273if (receiver.Kind == BoundKind.Conversion && ((BoundConversion)receiver).ConversionKind == ConversionKind.Unboxing) 1538switch (conversion.ConversionKind) 2167Debug.Assert(!conv.ConversionKind.IsUserDefinedConversion()); 2169if (conv.ConversionKind.IsUserDefinedConversion()) 3920var conversionKind = conversion.ConversionKind;
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)
997((BoundConversion)right).ConversionKind.IsPointerConversion())
Compilation\CSharpSemanticModel.cs (9)
2131if (highestBoundExpr is BoundConversion { ConversionKind: ConversionKind.SwitchExpression, Conversion: var convertedSwitchConversion }) 2149if (highestBoundExpr is BoundConversion { ConversionKind: ConversionKind.ConditionalExpression }) 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) 2242else if (boundExpr is BoundConversion { ConversionKind: ConversionKind.MethodGroup, Conversion: var exprConversion, Type: { TypeKind: TypeKind.FunctionPointer }, SymbolOpt: var symbol }) 3525isDynamic = conversion.ConversionKind.IsDynamic(); 3528if ((conversion.ConversionKind == ConversionKind.MethodGroup) && conversion.IsExtensionMethod) 3535else if (conversion.ConversionKind.IsUserDefinedConversion()) 4300Debug.Assert(conversion.ConversionKind == ConversionKind.MethodGroup);
FlowAnalysis\AbstractFlowPass.cs (2)
1736if (node.ConversionKind == ConversionKind.MethodGroup) 2631|| (expr is BoundConversion { ConversionKind: ConversionKind.ExplicitNullable or ConversionKind.ImplicitNullable } conv
FlowAnalysis\DefiniteAssignment.cs (2)
932if (boundConversion.ConversionKind.IsUserDefinedConversion() || 933boundConversion.ConversionKind == ConversionKind.IntPtr)
FlowAnalysis\NullableWalker.cs (3)
5530switch (conversion.ConversionKind) 8956if (useLegacyWarnings && conversionOperand is BoundConversion operandConversion && !operandConversion.ConversionKind.IsUserDefinedConversion()) 10386switch (conv.ConversionKind)
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
397if (node.ConversionKind == ConversionKind.InterpolatedStringHandler)
Lowering\ClosureConversion\ClosureConversion.cs (2)
1394Debug.Assert(conversion.ConversionKind != ConversionKind.MethodGroup); 1395if (conversion.ConversionKind == ConversionKind.AnonymousFunction)
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (5)
536if (!conversion.ConversionKind.IsUserDefinedConversion() && 537conversion.ConversionKind.IsImplicitConversion() && 538conversion.ConversionKind != ConversionKind.NullLiteral && 688switch (node.ConversionKind) 705!TypeSymbol.Equals(strippedOperandType, ((node.ConversionKind == ConversionKind.ExplicitUserDefined) ? conversionInputType : conversionInputType.StrippedType()), TypeCompareKind.ConsiderEverything2);
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
788switch (node.ConversionKind)
Lowering\DiagnosticsPass_Warnings.cs (7)
167if (conversion == null || !conversion.ConversionKind.IsImplicitConversion()) 435if (conversion.ConversionKind != ConversionKind.ImplicitNumeric && 436conversion.ConversionKind != ConversionKind.ImplicitConstant) 580if (conv.ConversionKind == ConversionKind.ImplicitNullable) 868if (conv.ConversionKind == ConversionKind.ExplicitNullable || conv.ConversionKind == ConversionKind.ImplicitNullable) 892switch (conversion.ConversionKind)
Lowering\Extensions.cs (2)
59switch (conversion.ConversionKind) 106switch (conversion.ConversionKind)
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (1)
716if (conversion.ConversionKind == ConversionKind.Boxing)
Lowering\LocalRewriter\LocalRewriter_Call.cs (5)
568switch (conv.ConversionKind) 611Debug.Assert(false, "Unexpected conversion kind" + conv.ConversionKind); 836if (argument is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 909if (argument is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 1396=> expr is BoundConversion conv && conv.ConversionKind == ConversionKind.AnonymousFunction;
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (3)
20switch (node.ConversionKind) 72_inExpressionLambda = _inExpressionLambda || (node.ConversionKind == ConversionKind.AnonymousFunction && !wasInExpressionLambda && rewrittenType.IsExpressionTree()); 252return conversion.ConversionKind == ConversionKind.Identity && !conversion.ExplicitCastInCode;
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (1)
224if (boundConversion.ConversionKind != ConversionKind.Identity)
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
618if (conv.ConversionKind == ConversionKind.Boxing)
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (1)
18Debug.Assert(conversion.ConversionKind == ConversionKind.InterpolatedString);
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (1)
103if (expr is BoundConversion { ConversionKind: ConversionKind.ImplicitTuple, Conversion: var conversion } boundConversion)
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (1)
508Debug.Assert(methodArgumentInfo.Arguments.All(arg => arg is not BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler }));
Lowering\SpillSequenceSpiller.cs (1)
1176if (node.ConversionKind == ConversionKind.AnonymousFunction && node.Type.IsExpressionTree())
Operations\CSharpOperationFactory.cs (2)
1021if (boundConversion.ConversionKind == ConversionKind.InterpolatedStringHandler) 1028if (boundConversion.ConversionKind == CSharp.ConversionKind.MethodGroup)
Operations\CSharpOperationFactory_Methods.cs (1)
145if (boundConversion.ConversionKind == ConversionKind.MethodGroup)
Symbols\ConstantValueUtils.cs (1)
100hasDynamicConversion = hasDynamicConversion || conversion.ConversionKind.IsDynamic();
Symbols\Source\SourceComplexParameterSymbol.cs (1)
400((BoundConversion)convertedExpression).ConversionKind != ConversionKind.DefaultLiteral)