83 references to ConversionKind
Microsoft.CodeAnalysis.CSharp (83)
Binder\Binder.ValueChecks.cs (7)
762
if (conversion.
ConversionKind
== ConversionKind.Unboxing)
4322
Debug.Assert(conversion.
ConversionKind
!= ConversionKind.StackAllocToSpanType, "StackAllocToSpanType unexpected");
4324
if (conversion.
ConversionKind
== ConversionKind.InterpolatedStringHandler)
4329
if (conversion.
ConversionKind
== ConversionKind.CollectionExpression)
5099
Debug.Assert(conversion.
ConversionKind
!= ConversionKind.StackAllocToSpanType, "StackAllocToSpanType unexpected");
5101
if (conversion.
ConversionKind
== ConversionKind.InterpolatedStringHandler)
5106
if (conversion.
ConversionKind
== ConversionKind.CollectionExpression)
Binder\Binder_Patterns.cs (4)
696
else if ((conversion.
ConversionKind
== ConversionKind.Boxing || conversion.
ConversionKind
== ConversionKind.ImplicitReference)
706
else if (conversion.
ConversionKind
== ConversionKind.ImplicitNullToPointer ||
707
(conversion.
ConversionKind
== ConversionKind.NoConversion && convertedExpression.Type?.IsErrorType() == true))
Binder\RefSafetyAnalysis.cs (2)
665
if (arg is BoundConversion {
ConversionKind
: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion)
1055
switch (conv.
ConversionKind
)
BoundTree\BoundExpression.cs (1)
493
switch (this.
ConversionKind
)
CodeGen\EmitConversion.cs (6)
42
switch (conversion.
ConversionKind
)
45
throw ExceptionUtilities.UnexpectedValue(conversion.
ConversionKind
);
93
switch (conversion.
ConversionKind
)
132
throw ExceptionUtilities.UnexpectedValue(conversion.
ConversionKind
);
174
throw ExceptionUtilities.UnexpectedValue(conversion.
ConversionKind
); // Should be handled by caller.
178
throw ExceptionUtilities.UnexpectedValue(conversion.
ConversionKind
);
CodeGen\EmitExpression.cs (6)
1234
if (conversion.
ConversionKind
== ConversionKind.Unboxing)
1273
if (receiver.Kind == BoundKind.Conversion && ((BoundConversion)receiver).
ConversionKind
== ConversionKind.Unboxing)
1538
switch (conversion.
ConversionKind
)
2167
Debug.Assert(!conv.
ConversionKind
.IsUserDefinedConversion());
2169
if (conv.
ConversionKind
.IsUserDefinedConversion())
3920
var conversionKind = conversion.
ConversionKind
;
CodeGen\EmitOperators.cs (1)
375
if (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 (10)
2131
if (highestBoundExpr is BoundConversion {
ConversionKind
: ConversionKind.SwitchExpression, Conversion: var convertedSwitchConversion })
2149
if (highestBoundExpr is BoundConversion {
ConversionKind
: ConversionKind.ConditionalExpression })
2168
if (highestBoundExpr is BoundConversion {
ConversionKind
: ConversionKind.CollectionExpression or ConversionKind.NoConversion, Conversion: var convertedCollectionConversion })
2174
else if (highestBoundExpr is BoundConversion {
ConversionKind
: ConversionKind.ImplicitNullable, Conversion.UnderlyingConversions: [{ Kind: ConversionKind.CollectionExpression }] } boundConversion)
2242
else if (boundExpr is BoundConversion {
ConversionKind
: ConversionKind.MethodGroup, Conversion: var exprConversion, Type: { TypeKind: TypeKind.FunctionPointer }, SymbolOpt: var symbol })
3525
isDynamic = conversion.
ConversionKind
.IsDynamic();
3528
if ((conversion.
ConversionKind
== ConversionKind.MethodGroup) && conversion.IsExtensionMethod)
3535
else if (conversion.
ConversionKind
.IsUserDefinedConversion())
4298
if (conversion.
ConversionKind
== ConversionKind.MethodGroup)
4302
else if (conversion.Operand is BoundConversion {
ConversionKind
: ConversionKind.MethodGroup } nestedMethodGroupConversion)
FlowAnalysis\AbstractFlowPass.cs (2)
1736
if (node.
ConversionKind
== ConversionKind.MethodGroup)
2635
|| (expr is BoundConversion {
ConversionKind
: ConversionKind.ExplicitNullable or ConversionKind.ImplicitNullable } conv
FlowAnalysis\DefiniteAssignment.cs (2)
932
if (boundConversion.
ConversionKind
.IsUserDefinedConversion() ||
933
boundConversion.
ConversionKind
== ConversionKind.IntPtr)
FlowAnalysis\NullableWalker.cs (3)
5591
switch (conversion.
ConversionKind
)
9017
if (useLegacyWarnings && conversionOperand is BoundConversion operandConversion && !operandConversion.
ConversionKind
.IsUserDefinedConversion())
10447
switch (conv.
ConversionKind
)
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
397
if (node.
ConversionKind
== ConversionKind.InterpolatedStringHandler)
Lowering\ClosureConversion\ClosureConversion.cs (2)
1394
Debug.Assert(conversion.
ConversionKind
!= ConversionKind.MethodGroup);
1395
if (conversion.
ConversionKind
== ConversionKind.AnonymousFunction)
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (5)
536
if (!conversion.
ConversionKind
.IsUserDefinedConversion() &&
537
conversion.
ConversionKind
.IsImplicitConversion() &&
538
conversion.
ConversionKind
!= ConversionKind.NullLiteral &&
688
switch (node.
ConversionKind
)
705
!TypeSymbol.Equals(strippedOperandType, ((node.
ConversionKind
== ConversionKind.ExplicitUserDefined) ? conversionInputType : conversionInputType.StrippedType()), TypeCompareKind.ConsiderEverything2);
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
788
switch (node.
ConversionKind
)
Lowering\DiagnosticsPass_Warnings.cs (7)
167
if (conversion == null || !conversion.
ConversionKind
.IsImplicitConversion())
435
if (conversion.
ConversionKind
!= ConversionKind.ImplicitNumeric &&
436
conversion.
ConversionKind
!= ConversionKind.ImplicitConstant)
580
if (conv.
ConversionKind
== ConversionKind.ImplicitNullable)
868
if (conv.
ConversionKind
== ConversionKind.ExplicitNullable || conv.
ConversionKind
== ConversionKind.ImplicitNullable)
892
switch (conversion.
ConversionKind
)
Lowering\Extensions.cs (2)
59
switch (conversion.
ConversionKind
)
106
switch (conversion.
ConversionKind
)
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (1)
716
if (conversion.
ConversionKind
== ConversionKind.Boxing)
Lowering\LocalRewriter\LocalRewriter_Call.cs (5)
567
switch (conv.
ConversionKind
)
610
Debug.Assert(false, "Unexpected conversion kind" + conv.
ConversionKind
);
835
if (argument is BoundConversion {
ConversionKind
: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion)
908
if (argument is BoundConversion {
ConversionKind
: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion)
1395
=> expr is BoundConversion conv && conv.
ConversionKind
== ConversionKind.AnonymousFunction;
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (3)
20
switch (node.
ConversionKind
)
72
_inExpressionLambda = _inExpressionLambda || (node.
ConversionKind
== ConversionKind.AnonymousFunction && !wasInExpressionLambda && rewrittenType.IsExpressionTree());
252
return conversion.
ConversionKind
== ConversionKind.Identity && !conversion.ExplicitCastInCode;
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (1)
224
if (boundConversion.
ConversionKind
!= ConversionKind.Identity)
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
618
if (conv.
ConversionKind
== ConversionKind.Boxing)
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (1)
18
Debug.Assert(conversion.
ConversionKind
== ConversionKind.InterpolatedString);
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (1)
103
if (expr is BoundConversion {
ConversionKind
: ConversionKind.ImplicitTuple, Conversion: var conversion } boundConversion)
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (1)
508
Debug.Assert(methodArgumentInfo.Arguments.All(arg => arg is not BoundConversion {
ConversionKind
: ConversionKind.InterpolatedStringHandler }));
Lowering\SpillSequenceSpiller.cs (1)
1176
if (node.
ConversionKind
== ConversionKind.AnonymousFunction && node.Type.IsExpressionTree())
Operations\CSharpOperationFactory.cs (2)
1021
if (boundConversion.
ConversionKind
== ConversionKind.InterpolatedStringHandler)
1028
if (boundConversion.
ConversionKind
== CSharp.ConversionKind.MethodGroup)
Operations\CSharpOperationFactory_Methods.cs (1)
145
if (boundConversion.
ConversionKind
== ConversionKind.MethodGroup)
Symbols\ConstantValueUtils.cs (1)
100
hasDynamicConversion = hasDynamicConversion || conversion.
ConversionKind
.IsDynamic();
Symbols\Source\SourceComplexParameterSymbol.cs (1)
401
((BoundConversion)convertedExpression).
ConversionKind
!= ConversionKind.DefaultLiteral)