77 references to ConversionKind
Microsoft.CodeAnalysis.CSharp (77)
Binder\Binder.ValueChecks.cs (5)
615if (conversion.ConversionKind == ConversionKind.Unboxing) 3710Debug.Assert(conversion.ConversionKind != ConversionKind.StackAllocToSpanType, "StackAllocToSpanType unexpected"); 3712if (conversion.ConversionKind == ConversionKind.InterpolatedStringHandler) 4185Debug.Assert(conversion.ConversionKind != ConversionKind.StackAllocToSpanType, "StackAllocToSpanType unexpected"); 4187if (conversion.ConversionKind == ConversionKind.InterpolatedStringHandler)
Binder\Binder_Patterns.cs (4)
687else if ((conversion.ConversionKind == ConversionKind.Boxing || conversion.ConversionKind == ConversionKind.ImplicitReference) 697else if (conversion.ConversionKind == ConversionKind.ImplicitNullToPointer || 698(conversion.ConversionKind == ConversionKind.NoConversion && convertedExpression.Type?.IsErrorType() == true))
Binder\RefSafetyAnalysis.cs (2)
572if (arg is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 842switch (conv.ConversionKind)
BoundTree\BoundExpression.cs (1)
444switch (this.ConversionKind)
CodeGen\EmitConversion.cs (6)
42switch (conversion.ConversionKind) 45throw ExceptionUtilities.UnexpectedValue(conversion.ConversionKind); 93switch (conversion.ConversionKind) 132throw ExceptionUtilities.UnexpectedValue(conversion.ConversionKind); 173throw ExceptionUtilities.UnexpectedValue(conversion.ConversionKind); // Should be handled by caller. 177throw ExceptionUtilities.UnexpectedValue(conversion.ConversionKind);
CodeGen\EmitExpression.cs (6)
1194if (conversion.ConversionKind == ConversionKind.Unboxing) 1233if (receiver.Kind == BoundKind.Conversion && ((BoundConversion)receiver).ConversionKind == ConversionKind.Unboxing) 1498switch (conversion.ConversionKind) 1947Debug.Assert(!conv.ConversionKind.IsUserDefinedConversion()); 1949if (conv.ConversionKind.IsUserDefinedConversion()) 3646var conversionKind = conversion.ConversionKind;
CodeGen\Optimizer.cs (1)
996((BoundConversion)right).ConversionKind.IsPointerConversion())
Compilation\CSharpSemanticModel.cs (7)
2152if (highestBoundExpr is BoundConversion { ConversionKind: ConversionKind.SwitchExpression, Conversion: var convertedSwitchConversion }) 2170if (highestBoundExpr is BoundConversion { ConversionKind: ConversionKind.ConditionalExpression }) 2240else if (boundExpr is BoundConversion { ConversionKind: ConversionKind.MethodGroup, Conversion: var exprConversion, Type: { TypeKind: TypeKind.FunctionPointer }, SymbolOpt: var symbol }) 3518isDynamic = conversion.ConversionKind.IsDynamic(); 3521if ((conversion.ConversionKind == ConversionKind.MethodGroup) && conversion.IsExtensionMethod) 3528else if (conversion.ConversionKind.IsUserDefinedConversion()) 4285Debug.Assert(conversion.ConversionKind == ConversionKind.MethodGroup);
FlowAnalysis\AbstractFlowPass.cs (2)
1633if (node.ConversionKind == ConversionKind.MethodGroup) 2439|| (expr is BoundConversion { ConversionKind: ConversionKind.ExplicitNullable or ConversionKind.ImplicitNullable } conv
FlowAnalysis\DefiniteAssignment.cs (2)
902if (boundConversion.ConversionKind.IsUserDefinedConversion() || 903boundConversion.ConversionKind == ConversionKind.IntPtr)
FlowAnalysis\NullableWalker.cs (3)
5084switch (conversion.ConversionKind) 8089if (useLegacyWarnings && conversionOperand is BoundConversion operandConversion && !operandConversion.ConversionKind.IsUserDefinedConversion()) 9502switch (conv.ConversionKind)
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
280if (node.ConversionKind == ConversionKind.InterpolatedStringHandler)
Lowering\ClosureConversion\ClosureConversion.cs (2)
1378Debug.Assert(conversion.ConversionKind != ConversionKind.MethodGroup); 1379if (conversion.ConversionKind == ConversionKind.AnonymousFunction)
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (5)
470if (!conversion.ConversionKind.IsUserDefinedConversion() && 471conversion.ConversionKind.IsImplicitConversion() && 472conversion.ConversionKind != ConversionKind.NullLiteral && 618switch (node.ConversionKind) 635!TypeSymbol.Equals(strippedOperandType, ((node.ConversionKind == ConversionKind.ExplicitUserDefined) ? conversionInputType : conversionInputType.StrippedType()), TypeCompareKind.ConsiderEverything2);
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
723switch (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)
714if (conversion.ConversionKind == ConversionKind.Boxing)
Lowering\LocalRewriter\LocalRewriter_Call.cs (5)
334switch (conv.ConversionKind) 377Debug.Assert(false, "Unexpected conversion kind" + conv.ConversionKind); 593if (argument is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 666if (argument is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 1137=> expr is BoundConversion conv && conv.ConversionKind == ConversionKind.AnonymousFunction;
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (3)
20switch (node.ConversionKind) 65_inExpressionLambda = _inExpressionLambda || (node.ConversionKind == ConversionKind.AnonymousFunction && !wasInExpressionLambda && rewrittenType.IsExpressionTree()); 245return conversion.ConversionKind == ConversionKind.Identity && !conversion.ExplicitCastInCode;
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (1)
215if (boundConversion.ConversionKind != ConversionKind.Identity)
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
376if (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)
509Debug.Assert(methodArgumentInfo.Arguments.All(arg => arg is not BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler }));
Lowering\SpillSequenceSpiller.cs (1)
1078if (node.ConversionKind == ConversionKind.AnonymousFunction && node.Type.IsExpressionTree())
Operations\CSharpOperationFactory.cs (2)
1015if (boundConversion.ConversionKind == ConversionKind.InterpolatedStringHandler) 1022if (boundConversion.ConversionKind == CSharp.ConversionKind.MethodGroup)
Operations\CSharpOperationFactory_Methods.cs (1)
145if (boundConversion.ConversionKind == ConversionKind.MethodGroup)
Symbols\ConstantValueUtils.cs (1)
101hasDynamicConversion = hasDynamicConversion || conversion.ConversionKind.IsDynamic();
Symbols\Source\SourceComplexParameterSymbol.cs (1)
394((BoundConversion)convertedExpression).ConversionKind != ConversionKind.DefaultLiteral)