734 references to ConversionKind
Microsoft.CodeAnalysis.CSharp (733)
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_Conversions.cs (8)
143if (conversion.Kind == ConversionKind.FunctionType) 159if (conversion.Kind == ConversionKind.SwitchExpression) 174if (conversion.Kind == ConversionKind.ConditionalExpression) 189if (conversion.Kind == ConversionKind.InterpolatedString) 196if (conversion.Kind == ConversionKind.InterpolatedStringHandler) 270if (conversion.Kind == ConversionKind.DefaultLiteral) 280if (conversion.Kind is ConversionKind.ImplicitReference or ConversionKind.ExplicitReference &&
Binder\Binder_Deconstruct.cs (2)
308Debug.Assert(nestedConversion.Kind == ConversionKind.Deconstruction); 341conversion = new Conversion(ConversionKind.Deconstruction, deconstructMethod, nestedConversions.ToImmutableAndFree());
Binder\Binder_Operators.cs (45)
3271return new BoundIsOperator(node, operand, typeExpression, ConversionKind.NoConversion, resultType, hasErrors: true); 3353ConversionKind conversionKind, 3388ConversionKind conversionKind, 3442case ConversionKind.ImplicitSpan: 3443case ConversionKind.ExplicitSpan: 3444case ConversionKind.NoConversion: 3558case ConversionKind.ImplicitNumeric: 3559case ConversionKind.ExplicitNumeric: 3560case ConversionKind.ImplicitEnumeration: 3562case ConversionKind.ImplicitConstant: 3563case ConversionKind.ImplicitUserDefined: 3564case ConversionKind.ExplicitUserDefined: 3565case ConversionKind.IntPtr: 3566case ConversionKind.ExplicitTuple: 3567case ConversionKind.ImplicitTuple: 3583case ConversionKind.ExplicitEnumeration: 3588goto case ConversionKind.NoConversion; 3593case ConversionKind.ExplicitNullable: 3624case ConversionKind.ImplicitReference: 3627case ConversionKind.ExplicitReference: 3628case ConversionKind.Unboxing: 3635case ConversionKind.Identity: 3642case ConversionKind.Boxing: 3659case ConversionKind.ImplicitNullable: 3672case ConversionKind.ImplicitDynamic: 3673case ConversionKind.ExplicitDynamic: 3674case ConversionKind.ExplicitPointerToInteger: 3675case ConversionKind.ExplicitPointerToPointer: 3676case ConversionKind.ImplicitPointerToVoid: 3677case ConversionKind.ExplicitIntegerToPointer: 3678case ConversionKind.ImplicitNullToPointer: 3679case ConversionKind.AnonymousFunction: 3680case ConversionKind.NullLiteral: 3681case ConversionKind.DefaultLiteral: 3682case ConversionKind.MethodGroup: 3850ConversionKind conversionKind, 3876case ConversionKind.ImplicitReference: 3877case ConversionKind.Boxing: 3878case ConversionKind.ImplicitNullable: 3879case ConversionKind.Identity: 3880case ConversionKind.ExplicitNullable: 3881case ConversionKind.ExplicitReference: 3882case ConversionKind.Unboxing: 3912ConversionKind conversionKind, 3941internal static ConstantValue GetAsOperatorConstantResult(TypeSymbol operandType, TypeSymbol targetType, ConversionKind conversionKind, ConstantValue operandConstantValue)
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\Binder_Statements.cs (4)
1948if (conversion.Kind != ConversionKind.Identity) 2246else if (conversion.Kind == ConversionKind.ExplicitNumeric && sourceConstantValueOpt != null && sourceConstantValueOpt != ConstantValue.Bad && 2674if (conversion.Kind == ConversionKind.Identity) 3161if (conversion.Kind != ConversionKind.Identity)
Binder\ForEachLoopBinder.cs (2)
471if (elementConversionClassification.Kind != ConversionKind.Identity && IterationVariable.RefKind is RefKind.Ref or RefKind.RefReadOnly) 574(collectionConversionClassification.Kind == ConversionKind.ExplicitReference && collectionExpr.Type.SpecialType == SpecialType.System_String));
Binder\RefSafetyAnalysis.cs (4)
640if (arg is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 923Debug.Assert(conversion.Kind == ConversionKind.Deconstruction); 1032case ConversionKind.Identity: 1033case ConversionKind.ImplicitTupleLiteral:
Binder\Semantics\Conversions\Conversion.cs (146)
21private readonly ConversionKind _kind; 135ConversionKind.CollectionExpression, 140ConversionKind kind, 150? ConversionKind.NoConversion 151: isImplicit ? ConversionKind.ImplicitUserDefined : ConversionKind.ExplicitUserDefined; 163internal Conversion(ConversionKind kind, MethodSymbol conversionMethod, bool isExtensionMethod) 173internal Conversion(ConversionKind kind, ImmutableArray<Conversion> nestedConversions) 180internal Conversion(ConversionKind kind, DeconstructMethodInfo deconstructMethodInfo, ImmutableArray<(BoundValuePlaceholder? placeholder, BoundExpression? conversion)> deconstructConversionInfo) 182Debug.Assert(kind == ConversionKind.Deconstruction); 195Debug.Assert(_kind is ConversionKind.MethodGroup or ConversionKind.IntPtr or ConversionKind.ImplicitUserDefined or ConversionKind.ExplicitUserDefined); 215private static void AssertTrivialConversion(ConversionKind kind) 221case ConversionKind.NoConversion: 222case ConversionKind.Identity: 223case ConversionKind.ImplicitConstant: 224case ConversionKind.ImplicitNumeric: 225case ConversionKind.ImplicitReference: 226case ConversionKind.ImplicitEnumeration: 227case ConversionKind.ImplicitThrow: 228case ConversionKind.AnonymousFunction: 229case ConversionKind.Boxing: 230case ConversionKind.NullLiteral: 231case ConversionKind.DefaultLiteral: 232case ConversionKind.ImplicitNullToPointer: 233case ConversionKind.ImplicitPointerToVoid: 234case ConversionKind.ExplicitPointerToPointer: 235case ConversionKind.ExplicitPointerToInteger: 236case ConversionKind.ExplicitIntegerToPointer: 237case ConversionKind.Unboxing: 238case ConversionKind.ExplicitReference: 239case ConversionKind.IntPtr: 240case ConversionKind.ExplicitEnumeration: 241case ConversionKind.ExplicitNumeric: 242case ConversionKind.ImplicitDynamic: 243case ConversionKind.ExplicitDynamic: 244case ConversionKind.InterpolatedString: 245case ConversionKind.InterpolatedStringHandler: 246case ConversionKind.InlineArray: 247case ConversionKind.ImplicitSpan: 248case ConversionKind.ExplicitSpan: 260internal static Conversion GetTrivialConversion(ConversionKind kind) 266internal static Conversion UnsetConversion => new Conversion(ConversionKind.UnsetConversionKind); 267internal static Conversion NoConversion => new Conversion(ConversionKind.NoConversion); 268internal static Conversion Identity => new Conversion(ConversionKind.Identity); 269internal static Conversion ImplicitConstant => new Conversion(ConversionKind.ImplicitConstant); 270internal static Conversion ImplicitNumeric => new Conversion(ConversionKind.ImplicitNumeric); 271internal static Conversion ImplicitReference => new Conversion(ConversionKind.ImplicitReference); 272internal static Conversion ImplicitEnumeration => new Conversion(ConversionKind.ImplicitEnumeration); 273internal static Conversion ImplicitThrow => new Conversion(ConversionKind.ImplicitThrow); 274internal static Conversion ObjectCreation => new Conversion(ConversionKind.ObjectCreation); 275internal static Conversion CollectionExpression => new Conversion(ConversionKind.CollectionExpression); 276internal static Conversion AnonymousFunction => new Conversion(ConversionKind.AnonymousFunction); 277internal static Conversion Boxing => new Conversion(ConversionKind.Boxing); 278internal static Conversion NullLiteral => new Conversion(ConversionKind.NullLiteral); 279internal static Conversion DefaultLiteral => new Conversion(ConversionKind.DefaultLiteral); 280internal static Conversion NullToPointer => new Conversion(ConversionKind.ImplicitNullToPointer); 281internal static Conversion PointerToVoid => new Conversion(ConversionKind.ImplicitPointerToVoid); 282internal static Conversion PointerToPointer => new Conversion(ConversionKind.ExplicitPointerToPointer); 283internal static Conversion PointerToInteger => new Conversion(ConversionKind.ExplicitPointerToInteger); 284internal static Conversion IntegerToPointer => new Conversion(ConversionKind.ExplicitIntegerToPointer); 285internal static Conversion Unboxing => new Conversion(ConversionKind.Unboxing); 286internal static Conversion ExplicitReference => new Conversion(ConversionKind.ExplicitReference); 287internal static Conversion IntPtr => new Conversion(ConversionKind.IntPtr); 288internal static Conversion ExplicitEnumeration => new Conversion(ConversionKind.ExplicitEnumeration); 289internal static Conversion ExplicitNumeric => new Conversion(ConversionKind.ExplicitNumeric); 290internal static Conversion ImplicitDynamic => new Conversion(ConversionKind.ImplicitDynamic); 291internal static Conversion ExplicitDynamic => new Conversion(ConversionKind.ExplicitDynamic); 292internal static Conversion InterpolatedString => new Conversion(ConversionKind.InterpolatedString); 293internal static Conversion InterpolatedStringHandler => new Conversion(ConversionKind.InterpolatedStringHandler); 294internal static Conversion Deconstruction => new Conversion(ConversionKind.Deconstruction); 295internal static Conversion PinnedObjectToPointer => new Conversion(ConversionKind.PinnedObjectToPointer); 296internal static Conversion ImplicitPointer => new Conversion(ConversionKind.ImplicitPointer); 297internal static Conversion FunctionType => new Conversion(ConversionKind.FunctionType); 298internal static Conversion InlineArray => new Conversion(ConversionKind.InlineArray); 299internal static Conversion ImplicitSpan => new Conversion(ConversionKind.ImplicitSpan); 300internal static Conversion ExplicitSpan => new Conversion(ConversionKind.ExplicitSpan); 312internal static readonly Conversion ExplicitNullableWithExplicitEnumerationUnderlying = new Conversion(ConversionKind.ExplicitNullable, ExplicitEnumerationUnderlying); 313internal static readonly Conversion ExplicitNullableWithPointerToIntegerUnderlying = new Conversion(ConversionKind.ExplicitNullable, PointerToIntegerUnderlying); 314internal static readonly Conversion ExplicitNullableWithIdentityUnderlying = new Conversion(ConversionKind.ExplicitNullable, IdentityUnderlying); 315internal static readonly Conversion ExplicitNullableWithImplicitNumericUnderlying = new Conversion(ConversionKind.ExplicitNullable, ImplicitNumericUnderlying); 316internal static readonly Conversion ExplicitNullableWithExplicitNumericUnderlying = new Conversion(ConversionKind.ExplicitNullable, ExplicitNumericUnderlying); 317internal static readonly Conversion ExplicitNullableWithImplicitConstantUnderlying = new Conversion(ConversionKind.ExplicitNullable, ImplicitConstantUnderlying); 319internal static readonly Conversion ImplicitNullableWithExplicitEnumerationUnderlying = new Conversion(ConversionKind.ImplicitNullable, ExplicitEnumerationUnderlying); 320internal static readonly Conversion ImplicitNullableWithPointerToIntegerUnderlying = new Conversion(ConversionKind.ImplicitNullable, PointerToIntegerUnderlying); 321internal static readonly Conversion ImplicitNullableWithIdentityUnderlying = new Conversion(ConversionKind.ImplicitNullable, IdentityUnderlying); 322internal static readonly Conversion ImplicitNullableWithImplicitNumericUnderlying = new Conversion(ConversionKind.ImplicitNullable, ImplicitNumericUnderlying); 323internal static readonly Conversion ImplicitNullableWithExplicitNumericUnderlying = new Conversion(ConversionKind.ImplicitNullable, ExplicitNumericUnderlying); 324internal static readonly Conversion ImplicitNullableWithImplicitConstantUnderlying = new Conversion(ConversionKind.ImplicitNullable, ImplicitConstantUnderlying); 340return new Conversion(ConversionKind.StackAllocToPointerType, ImmutableArray.Create(underlyingConversion)); 345return new Conversion(ConversionKind.StackAllocToSpanType, ImmutableArray.Create(underlyingConversion)); 348internal static Conversion MakeNullableConversion(ConversionKind kind, Conversion nestedConversion) 350Debug.Assert(kind == ConversionKind.ImplicitNullable || kind == ConversionKind.ExplicitNullable); 354ConversionKind.Identity => kind == ConversionKind.ImplicitNullable ? ImplicitNullableWithIdentityUnderlying : ExplicitNullableWithIdentityUnderlying, 355ConversionKind.ImplicitConstant => kind == ConversionKind.ImplicitNullable ? ImplicitNullableWithImplicitConstantUnderlying : ExplicitNullableWithImplicitConstantUnderlying, 356ConversionKind.ImplicitNumeric => kind == ConversionKind.ImplicitNullable ? ImplicitNullableWithImplicitNumericUnderlying : ExplicitNullableWithImplicitNumericUnderlying, 357ConversionKind.ExplicitNumeric => kind == ConversionKind.ImplicitNullable ? ImplicitNullableWithExplicitNumericUnderlying : ExplicitNullableWithExplicitNumericUnderlying, 358ConversionKind.ExplicitEnumeration => kind == ConversionKind.ImplicitNullable ? ImplicitNullableWithExplicitEnumerationUnderlying : ExplicitNullableWithExplicitEnumerationUnderlying, 359ConversionKind.ExplicitPointerToInteger => kind == ConversionKind.ImplicitNullable ? ImplicitNullableWithPointerToIntegerUnderlying : ExplicitNullableWithPointerToIntegerUnderlying, 366return new Conversion(ConversionKind.SwitchExpression, innerConversions); 371return new Conversion(ConversionKind.ConditionalExpression, innerConversions); 374internal ConversionKind Kind 604return Kind != ConversionKind.NoConversion; 647return Kind == ConversionKind.Identity; 658return Kind == ConversionKind.StackAllocToPointerType || Kind == ConversionKind.StackAllocToSpanType; 672return Kind == ConversionKind.ImplicitNumeric || Kind == ConversionKind.ExplicitNumeric; 686return Kind == ConversionKind.ImplicitEnumeration || Kind == ConversionKind.ExplicitEnumeration; 697return Kind == ConversionKind.ImplicitThrow; 708return Kind == ConversionKind.ObjectCreation; 715public bool IsCollectionExpression => Kind == ConversionKind.CollectionExpression; 724return Kind == ConversionKind.SwitchExpression; 735return Kind == ConversionKind.ConditionalExpression; 750return Kind == ConversionKind.InterpolatedString; 761return Kind == ConversionKind.InterpolatedStringHandler; 772return Kind == ConversionKind.InlineArray; 786return Kind == ConversionKind.ImplicitNullable || Kind == ConversionKind.ExplicitNullable; 797return Kind == ConversionKind.ImplicitTupleLiteral || Kind == ConversionKind.ExplicitTupleLiteral; 808return Kind == ConversionKind.ImplicitTuple || Kind == ConversionKind.ExplicitTuple; 822return Kind == ConversionKind.ImplicitReference || Kind == ConversionKind.ExplicitReference; 836return Kind is ConversionKind.ImplicitSpan or ConversionKind.ExplicitSpan; 864return Kind == ConversionKind.Boxing; 878return Kind == ConversionKind.Unboxing; 892return Kind == ConversionKind.NullLiteral; 903return Kind == ConversionKind.DefaultLiteral; 931return Kind == ConversionKind.ImplicitConstant; 945return Kind == ConversionKind.AnonymousFunction; 959return Kind == ConversionKind.MethodGroup; 1005return Kind == ConversionKind.IntPtr; 1061return this.Kind == ConversionKind.NoConversion ? LookupResultKind.Empty : LookupResultKind.Viable;
Binder\Semantics\Conversions\ConversionEasyOut.cs (14)
23const byte IDN = (byte)ConversionKind.Identity; 24const byte IRF = (byte)ConversionKind.ImplicitReference; 25const byte XRF = (byte)ConversionKind.ExplicitReference; 26const byte XNM = (byte)ConversionKind.ExplicitNumeric; 27const byte NOC = (byte)ConversionKind.NoConversion; 28const byte BOX = (byte)ConversionKind.Boxing; 29const byte UNB = (byte)ConversionKind.Unboxing; 30const byte NUM = (byte)ConversionKind.ImplicitNumeric; 31const byte NUL = (byte)ConversionKind.ImplicitNullable; 32const byte XNL = (byte)ConversionKind.ExplicitNullable; 72public static ConversionKind ClassifyConversion(TypeSymbol source, TypeSymbol target) 77return ConversionKind.NoConversion; 82return ConversionKind.NoConversion; 84return (ConversionKind)s_convkind[sourceIndex, targetIndex];
Binder\Semantics\Conversions\ConversionKindExtensions.cs (7)
6using static Microsoft.CodeAnalysis.CSharp.ConversionKind; 12public static bool IsDynamic(this ConversionKind conversionKind) 18public static bool IsImplicitConversion(this ConversionKind conversionKind) 41case ConversionKind.MethodGroup: 42case ConversionKind.FunctionType: 81public static bool IsUserDefinedConversion(this ConversionKind conversionKind) 94public static bool IsPointerConversion(this ConversionKind kind)
Binder\Semantics\Conversions\Conversions.cs (1)
481return new Conversion(ConversionKind.MethodGroup, method, methodGroup.IsExtensionMethodGroup);
Binder\Semantics\Conversions\ConversionsBase.cs (76)
490ConversionKind convKind = ConversionEasyOut.ClassifyConversion(source, target); 491if (convKind != ConversionKind.ImplicitNullable && convKind != ConversionKind.ExplicitNullable) 585private static bool IsStandardImplicitConversionFromType(ConversionKind kind) 589case ConversionKind.Identity: 590case ConversionKind.ImplicitNumeric: 591case ConversionKind.ImplicitNullable: 592case ConversionKind.ImplicitReference: 593case ConversionKind.Boxing: 594case ConversionKind.ImplicitConstant: 595case ConversionKind.ImplicitPointer: 596case ConversionKind.ImplicitPointerToVoid: 597case ConversionKind.ImplicitTuple: 598case ConversionKind.ImplicitSpan: 662{ Kind: ConversionKind.CollectionExpression } => true, 663{ Kind: ConversionKind.ImplicitNullable, UnderlyingConversions: [{ Kind: ConversionKind.CollectionExpression }] } => true, 668static bool isStandardImplicitConversionFromExpression(ConversionKind kind) 677case ConversionKind.NullLiteral: 678case ConversionKind.AnonymousFunction: 679case ConversionKind.MethodGroup: 680case ConversionKind.ImplicitEnumeration: 681case ConversionKind.ImplicitDynamic: 682case ConversionKind.ImplicitNullToPointer: 683case ConversionKind.ImplicitTupleLiteral: 684case ConversionKind.StackAllocToPointerType: 685case ConversionKind.StackAllocToSpanType: 686case ConversionKind.InlineArray: 687case ConversionKind.InterpolatedString: 698Debug.Assert(conversion.Kind == ConversionKind.NoConversion || IsStandardImplicitConversionFromType(conversion.Kind)); 890case ConversionKind.Identity: 893case ConversionKind.ImplicitNumeric: 896case ConversionKind.ImplicitReference: 899case ConversionKind.Boxing: 902case ConversionKind.NoConversion: 905case ConversionKind.ImplicitPointerToVoid: 909case ConversionKind.ImplicitTuple: 915case ConversionKind.ImplicitNullable: 923Conversion.MakeNullableConversion(ConversionKind.ExplicitNullable, underlyingConversion) : 928case ConversionKind.ImplicitSpan: 1014case ConversionKind.ImplicitUserDefined: 1015case ConversionKind.ImplicitDynamic: 1016case ConversionKind.ImplicitTuple: 1017case ConversionKind.ImplicitTupleLiteral: 1018case ConversionKind.ImplicitNullable: 1019case ConversionKind.ConditionalExpression: 1020case ConversionKind.ImplicitSpan: 1176return new Conversion(ConversionKind.ImplicitNullable, ImmutableArray.Create(underlyingConversion)); 1312return new Conversion(ConversionKind.ImplicitNullable, ImmutableArray.Create(underlyingTupleConversion)); 1341return new Conversion(ConversionKind.ExplicitNullable, ImmutableArray.Create(underlyingTupleConversion)); 1896ClassifyImplicitConversionFromType(source.Type, destination.Type, ref discardedUseSiteInfo).Kind != ConversionKind.NoConversion; 1960ConversionKind.ImplicitTupleLiteral, 1977ConversionKind.ImplicitTuple, 2007case ConversionKind.Identity: 2008case ConversionKind.Boxing: 2009case ConversionKind.ImplicitReference: 2010case ConversionKind.ImplicitSpan: 2013case ConversionKind.ImplicitTuple: 2014case ConversionKind.ImplicitTupleLiteral: 2027Debug.Assert(conversion.Kind == ConversionKind.NoConversion); 2034private static ConversionKind GetNumericConversion(TypeSymbol source, TypeSymbol destination) 2041return ConversionKind.UnsetConversionKind; 2048return ConversionKind.UnsetConversionKind; 2051var conversionKind = ConversionEasyOut.ClassifyConversion(source, destination); 2052Debug.Assert(conversionKind is ConversionKind.ImplicitNumeric or ConversionKind.ExplicitNumeric); 2058return GetNumericConversion(source, destination) == ConversionKind.ImplicitNumeric; 2065return GetNumericConversion(source, destination) == ConversionKind.ExplicitNumeric; 2275return new Conversion(ConversionKind.ImplicitNullable, ImmutableArray.Create(tupleConversion)); 2295ConversionKind.ImplicitTupleLiteral, 2313ConversionKind.ExplicitTupleLiteral, 2324ConversionKind kind, 2366ConversionKind.ImplicitTuple, 2385ConversionKind.ExplicitTuple, 2402ConversionKind kind, 2472return new Conversion(ConversionKind.ExplicitNullable, ImmutableArray.Create(tupleConversion));
Binder\Semantics\Conversions\UserDefinedImplicitConversions.cs (44)
609private static bool IsEncompassingImplicitConversionKind(ConversionKind kind) 614case ConversionKind.NoConversion: 618case ConversionKind.ImplicitDynamic: 619case ConversionKind.MethodGroup: 620case ConversionKind.AnonymousFunction: 621case ConversionKind.InterpolatedString: 622case ConversionKind.SwitchExpression: 623case ConversionKind.ConditionalExpression: 624case ConversionKind.ImplicitEnumeration: 625case ConversionKind.StackAllocToPointerType: 626case ConversionKind.StackAllocToSpanType: 627case ConversionKind.InterpolatedStringHandler: 630case ConversionKind.ImplicitUserDefined: 631case ConversionKind.ExplicitUserDefined: 632case ConversionKind.FunctionType: 635case ConversionKind.ExplicitNumeric: 636case ConversionKind.ExplicitEnumeration: 637case ConversionKind.ExplicitNullable: 638case ConversionKind.ExplicitReference: 639case ConversionKind.Unboxing: 640case ConversionKind.ExplicitDynamic: 641case ConversionKind.ExplicitPointerToPointer: 642case ConversionKind.ExplicitPointerToInteger: 643case ConversionKind.ExplicitIntegerToPointer: 644case ConversionKind.IntPtr: 645case ConversionKind.ExplicitTupleLiteral: 646case ConversionKind.ExplicitTuple: 647case ConversionKind.ExplicitSpan: 651case ConversionKind.Identity: 652case ConversionKind.ImplicitNumeric: 653case ConversionKind.ImplicitNullable: 654case ConversionKind.ImplicitReference: 655case ConversionKind.Boxing: 656case ConversionKind.ImplicitConstant: 657case ConversionKind.ImplicitPointerToVoid: 660case ConversionKind.NullLiteral: 661case ConversionKind.ImplicitNullToPointer: 664case ConversionKind.ImplicitTupleLiteral: 665case ConversionKind.ImplicitTuple: 666case ConversionKind.ImplicitThrow: 669case ConversionKind.DefaultLiteral: 672case ConversionKind.ImplicitPointer: 674case ConversionKind.InlineArray: 676case ConversionKind.ImplicitSpan:
Binder\Semantics\OverloadResolution\OverloadResolution.cs (20)
2191if (allSame && Conversions.ClassifyImplicitConversionFromType(type1Normalized, type2Normalized, ref useSiteInfo).Kind != ConversionKind.Identity) 2200if (Conversions.ClassifyImplicitConversionFromType(type1Normalized, type2Normalized, ref useSiteInfo).Kind != ConversionKind.Identity) 2313if (Conversions.ClassifyImplicitConversionFromType(type1Normalized, type2Normalized, ref useSiteInfo).Kind != ConversionKind.Identity) 2590return conversionsOpt.Any(static c => c.Kind == ConversionKind.FunctionType); 2863return conv1.Kind == ConversionKind.Identity ? BetterResult.Left : BetterResult.Neither; 2867return conv2.Kind == ConversionKind.Identity ? BetterResult.Right : BetterResult.Neither; 2919case (ConversionKind.InterpolatedStringHandler, ConversionKind.InterpolatedStringHandler): 2921case (ConversionKind.InterpolatedStringHandler, _): 2923case (_, ConversionKind.InterpolatedStringHandler): 2930case (ConversionKind.FunctionType, ConversionKind.FunctionType): 2932case (_, ConversionKind.FunctionType): 2934case (ConversionKind.FunctionType, _): 2966if (conv1.Kind == ConversionKind.CollectionExpression && 2967conv2.Kind == ConversionKind.CollectionExpression) 2974case (ConversionKind.ImplicitSpan, ConversionKind.ImplicitSpan): 2976case (_, ConversionKind.ImplicitSpan): 2978case (ConversionKind.ImplicitSpan, _):
Binder\SwitchBinder.cs (1)
417Debug.Assert(conversion.Kind == ConversionKind.ImplicitUserDefined);
BoundTree\BoundExpression.cs (7)
453public ConversionKind ConversionKind 495case ConversionKind.Identity: 498case ConversionKind.ImplicitNumeric: 499case ConversionKind.ImplicitEnumeration: 501case ConversionKind.ImplicitReference: 502case ConversionKind.Boxing: 506case ConversionKind.ExplicitNumeric:
CodeGen\EmitConversion.cs (31)
44case ConversionKind.MethodGroup: 46case ConversionKind.ImplicitNullToPointer: 95case ConversionKind.Identity: 98case ConversionKind.ImplicitNumeric: 99case ConversionKind.ExplicitNumeric: 102case ConversionKind.ImplicitReference: 103case ConversionKind.Boxing: 109case ConversionKind.ExplicitReference: 110case ConversionKind.Unboxing: 116case ConversionKind.ImplicitEnumeration: 117case ConversionKind.ExplicitEnumeration: 120case ConversionKind.ImplicitUserDefined: 121case ConversionKind.ExplicitUserDefined: 122case ConversionKind.AnonymousFunction: 123case ConversionKind.MethodGroup: 124case ConversionKind.ImplicitTupleLiteral: 125case ConversionKind.ImplicitTuple: 126case ConversionKind.ExplicitTupleLiteral: 127case ConversionKind.ExplicitTuple: 128case ConversionKind.ImplicitDynamic: 129case ConversionKind.ExplicitDynamic: 130case ConversionKind.ImplicitThrow: 133case ConversionKind.ImplicitPointerToVoid: 134case ConversionKind.ExplicitPointerToPointer: 135case ConversionKind.ImplicitPointer: 137case ConversionKind.ExplicitPointerToInteger: 138case ConversionKind.ExplicitIntegerToPointer: 167case ConversionKind.PinnedObjectToPointer: 173case ConversionKind.ImplicitNullToPointer: 175case ConversionKind.ImplicitNullable: 176case ConversionKind.ExplicitNullable:
CodeGen\EmitExpression.cs (13)
1234if (conversion.ConversionKind == ConversionKind.Unboxing) 1273if (receiver.Kind == BoundKind.Conversion && ((BoundConversion)receiver).ConversionKind == ConversionKind.Unboxing) 1540case ConversionKind.Boxing: 1545case ConversionKind.MethodGroup: 1546case ConversionKind.AnonymousFunction: 1549case ConversionKind.ExplicitReference: 1550case ConversionKind.ImplicitReference: 3920var conversionKind = conversion.ConversionKind; 3921Debug.Assert(conversionKind != ConversionKind.NullLiteral && conversionKind != ConversionKind.DefaultLiteral); 3924conversionKind != ConversionKind.MethodGroup && 3925conversionKind != ConversionKind.NullLiteral && 3926conversionKind != ConversionKind.DefaultLiteral)
CodeGen\EmitOperators.cs (1)
375if (comparand is BoundConversion { Type.SpecialType: SpecialType.System_Object, ConversionKind: ConversionKind.Boxing, Operand.Type: TypeParameterSymbol { AllowsRefLikeType: true } } &&
Compilation\CSharpSemanticModel.cs (14)
2101conversion = new Conversion(ConversionKind.AnonymousFunction, lambda.Symbol, false); 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) 2198if (conversion.Kind == ConversionKind.AnonymousFunction) 2222conversion = new Conversion(ConversionKind.MethodGroup, delegateCreation.MethodOpt, delegateCreation.IsExtensionMethod); 2228conversion = new Conversion(ConversionKind.AnonymousFunction, lambda.Symbol, delegateCreation.IsExtensionMethod); 2234conversion = new Conversion(ConversionKind.AnonymousFunction, lambda.Symbol, delegateCreation.IsExtensionMethod); 2242else if (boundExpr is BoundConversion { ConversionKind: ConversionKind.MethodGroup, Conversion: var exprConversion, Type: { TypeKind: TypeKind.FunctionPointer }, SymbolOpt: var symbol }) 3528if ((conversion.ConversionKind == ConversionKind.MethodGroup) && conversion.IsExtensionMethod) 4300Debug.Assert(conversion.ConversionKind == ConversionKind.MethodGroup);
Compilation\DeconstructionInfo.cs (3)
38return _conversion.Kind == ConversionKind.Deconstruction 51return _conversion.Kind == ConversionKind.Deconstruction 64if (_conversion.Kind != ConversionKind.Deconstruction)
FlowAnalysis\AbstractFlowPass.cs (3)
1736if (node.ConversionKind == ConversionKind.MethodGroup) 2631|| (expr is BoundConversion { ConversionKind: ConversionKind.ExplicitNullable or ConversionKind.ImplicitNullable } conv
FlowAnalysis\DefiniteAssignment.cs (1)
933boundConversion.ConversionKind == ConversionKind.IntPtr)
FlowAnalysis\NullableWalker.cs (87)
2038case ConversionKind.ExplicitNullable: 2057case ConversionKind.ConditionalExpression or ConversionKind.SwitchExpression or ConversionKind.ObjectCreation when 2060case ConversionKind.Identity: 2061case ConversionKind.DefaultLiteral: 2062case ConversionKind.ImplicitReference: 2063case ConversionKind.ImplicitTupleLiteral: 2064case ConversionKind.Boxing: 2493var conversionKind = conversion.Conversion.Kind; 2494return (conversionKind == ConversionKind.DefaultLiteral || conversionKind == ConversionKind.NullLiteral) && 2722Debug.Assert(conversion.Kind is ConversionKind.Identity or ConversionKind.ImplicitReference); 5532case ConversionKind.ImplicitReference: 5533case ConversionKind.ExplicitReference: 7368if (conversion is { IsValid: true, Kind: ConversionKind.ImplicitUserDefined }) 8535Debug.Assert(conversion.Kind == ConversionKind.ImplicitTuple || conversion.Kind == ConversionKind.ExplicitTuple); 8558case ConversionKind.Identity: 8559case ConversionKind.NullLiteral: 8560case ConversionKind.DefaultLiteral: 8561case ConversionKind.ImplicitReference: 8562case ConversionKind.ExplicitReference: 8563case ConversionKind.Boxing: 8564case ConversionKind.Unboxing: 8567case ConversionKind.ImplicitTupleLiteral: 8568case ConversionKind.ExplicitTupleLiteral: 8569case ConversionKind.ImplicitTuple: 8570case ConversionKind.ExplicitTuple: 8584case ConversionKind.ImplicitNullable: 8585case ConversionKind.ExplicitNullable: 8601case ConversionKind.ImplicitUserDefined: 8602case ConversionKind.ExplicitUserDefined: 8812conversion = Conversion.MakeNullableConversion(ConversionKind.ImplicitNullable, Conversion.Identity); 8842case ConversionKind.MethodGroup: 8872case ConversionKind.AnonymousFunction: 8889case ConversionKind.FunctionType: 8893case ConversionKind.InterpolatedString: 8897case ConversionKind.InterpolatedStringHandler: 8902case ConversionKind.ObjectCreation: 8903case ConversionKind.CollectionExpression: 8904case ConversionKind.SwitchExpression: 8905case ConversionKind.ConditionalExpression: 8909case ConversionKind.ExplicitUserDefined: 8910case ConversionKind.ImplicitUserDefined: 8913case ConversionKind.ExplicitDynamic: 8914case ConversionKind.ImplicitDynamic: 8918case ConversionKind.Boxing: 8922case ConversionKind.Unboxing: 8938case ConversionKind.ImplicitThrow: 8942case ConversionKind.NoConversion: 8946case ConversionKind.NullLiteral: 8947case ConversionKind.DefaultLiteral: 8949goto case ConversionKind.Identity; 8951case ConversionKind.Identity: 8973goto case ConversionKind.ImplicitTuple; 8975goto case ConversionKind.ImplicitReference; 8977case ConversionKind.ImplicitReference: 8978case ConversionKind.ExplicitReference: 8989case ConversionKind.ImplicitNullable: 9015case ConversionKind.ExplicitNullable: 9031goto case ConversionKind.ImplicitNullable; 9033case ConversionKind.ImplicitTuple: 9034case ConversionKind.ImplicitTupleLiteral: 9035case ConversionKind.ExplicitTupleLiteral: 9036case ConversionKind.ExplicitTuple: 9042case ConversionKind.ImplicitTuple: 9043case ConversionKind.ExplicitTuple: 9066case ConversionKind.Deconstruction: 9071case ConversionKind.ExplicitEnumeration: 9075case ConversionKind.InlineArray: 9083case ConversionKind.ImplicitSpan: 9084case ConversionKind.ExplicitSpan: 9087var previousKind = conversion.Kind; 9347Debug.Assert(conversion.Kind == ConversionKind.ExplicitUserDefined || conversion.Kind == ConversionKind.ImplicitUserDefined); 10136Debug.Assert(conversion.Kind == ConversionKind.Deconstruction); 10316underlyingConversion.Kind == ConversionKind.ImplicitNullable && 10391case ConversionKind.Identity: 10392case ConversionKind.ImplicitTupleLiteral: 10921(conversion.Kind == ConversionKind.ExplicitReference && resultType.SpecialType == SpecialType.System_String)) 11126if (conversion.Kind == ConversionKind.NoConversion) 11548case ConversionKind.Identity: 11549case ConversionKind.ImplicitReference: 11550case ConversionKind.Boxing: 11551case ConversionKind.ImplicitNullable:
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
397if (node.ConversionKind == ConversionKind.InterpolatedStringHandler)
FlowAnalysis\NullableWalker_Patterns.cs (6)
466case ConversionKind.Identity: 467case ConversionKind.ImplicitReference: 470case ConversionKind.ExplicitNullable when AreNullableAndUnderlyingTypes(inputType, e.Type, out _): 765ConversionKind.Identity => true, 766ConversionKind.ImplicitReference => true, 767ConversionKind.Boxing => true,
Generated\BoundNodes.xml.Generated.cs (3)
2847public BoundIsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, ConversionKind conversionKind, TypeSymbol type, bool hasErrors = false) 2863public ConversionKind ConversionKind { get; } 2868public BoundIsOperator Update(BoundExpression operand, BoundTypeExpression targetType, ConversionKind conversionKind, TypeSymbol type)
Lowering\ClosureConversion\ClosureConversion.cs (2)
1394Debug.Assert(conversion.ConversionKind != ConversionKind.MethodGroup); 1395if (conversion.ConversionKind == ConversionKind.AnonymousFunction)
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (13)
538conversion.ConversionKind != ConversionKind.NullLiteral && 621var kind = _bound.Compilation.Conversions.ClassifyConversionFromType(oldType, newType, isChecked: false, ref useSiteInfo).Kind; 627case ConversionKind.Identity: 629case ConversionKind.ExplicitNumeric: 690case ConversionKind.MethodGroup: 695case ConversionKind.ExplicitUserDefined: 696case ConversionKind.ImplicitUserDefined: 697case ConversionKind.IntPtr: 705!TypeSymbol.Equals(strippedOperandType, ((node.ConversionKind == ConversionKind.ExplicitUserDefined) ? conversionInputType : conversionInputType.StrippedType()), TypeCompareKind.ConsiderEverything2); 718case ConversionKind.ImplicitReference: 719case ConversionKind.Identity: 724case ConversionKind.ImplicitNullable: 737case ConversionKind.NullLiteral:
Lowering\DiagnosticsPass_ExpressionTrees.cs (10)
790case ConversionKind.MethodGroup: 795case ConversionKind.AnonymousFunction: 804case ConversionKind.ImplicitDynamic: 805case ConversionKind.ExplicitDynamic: 812case ConversionKind.ExplicitTuple: 813case ConversionKind.ExplicitTupleLiteral: 814case ConversionKind.ImplicitTuple: 815case ConversionKind.ImplicitTupleLiteral: 822case ConversionKind.InlineArray: 829case ConversionKind.InterpolatedStringHandler:
Lowering\DiagnosticsPass_Warnings.cs (8)
435if (conversion.ConversionKind != ConversionKind.ImplicitNumeric && 436conversion.ConversionKind != ConversionKind.ImplicitConstant) 580if (conv.ConversionKind == ConversionKind.ImplicitNullable) 868if (conv.ConversionKind == ConversionKind.ExplicitNullable || conv.ConversionKind == ConversionKind.ImplicitNullable) 894case ConversionKind.Deconstruction: 895case ConversionKind.ImplicitTupleLiteral: 896case ConversionKind.Identity:
Lowering\Extensions.cs (7)
61case ConversionKind.ImplicitNullable: 62case ConversionKind.ExplicitNullable: 66case ConversionKind.ImplicitEnumeration: 108case ConversionKind.NullLiteral: 112case ConversionKind.DefaultLiteral: 115case ConversionKind.ImplicitNullable: 116case ConversionKind.ExplicitNullable:
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (1)
215case ConversionKind.MethodGroup:
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (2)
218if (conversion.Kind == ConversionKind.ExplicitNullable && 485(conv.IsIdentity || conv.Kind == ConversionKind.ImplicitReference || conv.IsBoxing) &&
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (1)
716if (conversion.ConversionKind == ConversionKind.Boxing)
Lowering\LocalRewriter\LocalRewriter_Call.cs (30)
570case ConversionKind.AnonymousFunction: 571case ConversionKind.ImplicitConstant: 572case ConversionKind.MethodGroup: 573case ConversionKind.NullLiteral: 574case ConversionKind.DefaultLiteral: 577case ConversionKind.Boxing: 578case ConversionKind.ImplicitDynamic: 579case ConversionKind.ExplicitDynamic: 580case ConversionKind.ExplicitEnumeration: 581case ConversionKind.ExplicitNullable: 582case ConversionKind.ExplicitNumeric: 583case ConversionKind.ExplicitReference: 584case ConversionKind.Identity: 585case ConversionKind.ImplicitEnumeration: 586case ConversionKind.ImplicitNullable: 587case ConversionKind.ImplicitNumeric: 588case ConversionKind.ImplicitReference: 589case ConversionKind.Unboxing: 590case ConversionKind.ExplicitPointerToInteger: 591case ConversionKind.ExplicitPointerToPointer: 592case ConversionKind.ImplicitPointerToVoid: 593case ConversionKind.ImplicitNullToPointer: 594case ConversionKind.ExplicitIntegerToPointer: 598case ConversionKind.ExplicitUserDefined: 599case ConversionKind.ImplicitUserDefined: 602case ConversionKind.IntPtr: 603case ConversionKind.ImplicitThrow: 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_CollectionExpression.cs (5)
33Debug.Assert(conversion.Kind == ConversionKind.CollectionExpression); 204if (conversion.Kind is not (ConversionKind.Identity or ConversionKind.ImplicitReference)) 211return conversion.Kind is ConversionKind.Identity or ConversionKind.ImplicitReference;
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (60)
22case ConversionKind.InterpolatedString: 24case ConversionKind.InterpolatedStringHandler: 37case ConversionKind.SwitchExpression: 41case ConversionKind.ConditionalExpression: 45case ConversionKind.ObjectCreation: 61case ConversionKind.ImplicitNullable when node.Conversion.UnderlyingConversions[0].Kind is ConversionKind.CollectionExpression: 65case ConversionKind.CollectionExpression: 72_inExpressionLambda = _inExpressionLambda || (node.ConversionKind == ConversionKind.AnonymousFunction && !wasInExpressionLambda && rewrittenType.IsExpressionTree()); 252return conversion.ConversionKind == ConversionKind.Identity && !conversion.ExplicitCastInCode; 319case ConversionKind.Identity: 352case ConversionKind.ExplicitUserDefined: 353case ConversionKind.ImplicitUserDefined: 361case ConversionKind.IntPtr: 365case ConversionKind.ImplicitNullable: 366case ConversionKind.ExplicitNullable: 375case ConversionKind.Boxing: 399case ConversionKind.NullLiteral: 400case ConversionKind.DefaultLiteral: 408case ConversionKind.ImplicitReference: 409case ConversionKind.ExplicitReference: 417case ConversionKind.ImplicitConstant: 424goto case ConversionKind.ImplicitNumeric; 426case ConversionKind.ImplicitNumeric: 427case ConversionKind.ExplicitNumeric: 440case ConversionKind.ImplicitTupleLiteral: 441case ConversionKind.ExplicitTupleLiteral: 450case ConversionKind.ImplicitThrow: 457case ConversionKind.ImplicitEnumeration: 486goto case ConversionKind.ExplicitEnumeration; 488case ConversionKind.ExplicitEnumeration: 533case ConversionKind.ImplicitDynamic: 534case ConversionKind.ExplicitDynamic: 538return _dynamicFactory.MakeDynamicConversion(rewrittenOperand, explicitCastInCode || conversion.Kind == ConversionKind.ExplicitDynamic, conversion.IsArrayIndex, @checked, rewrittenType).ToExpression(); 540case ConversionKind.ImplicitTuple: 541case ConversionKind.ExplicitTuple: 550case ConversionKind.MethodGroup when oldNodeOpt is { Type: { TypeKind: TypeKind.FunctionPointer } funcPtrType }: 561case ConversionKind.MethodGroup: 594case ConversionKind.InlineArray: 617case ConversionKind.ImplicitSpan: 618case ConversionKind.ExplicitSpan: 649Debug.Assert(conversion.Kind is ConversionKind.ImplicitSpan); 681Debug.Assert(conversion.Kind is ConversionKind.ImplicitSpan); 700Debug.Assert(conversion.Kind is ConversionKind.ImplicitSpan); 1007case BoundConversion { Conversion: { Kind: ConversionKind.ImplicitNullable }, Operand: var convertedArgument } 1012case BoundConversion { Conversion: { Kind: ConversionKind.ImplicitNullable, UnderlyingConversions: var underlying }, Operand: var convertedArgument } conversion 1013when underlying.Length == 1 && underlying[0].Kind == ConversionKind.ImplicitTuple && !convertedArgument.Type!.IsNullableType(): 1131var conversionKind = conversion.Kind.IsImplicitConversion() ? ConversionKind.ImplicitUserDefined : ConversionKind.ExplicitUserDefined; 1737ConversionKind conversionKind = isImplicit ? ConversionKind.ImplicitUserDefined : ConversionKind.ExplicitUserDefined; 1756case ConversionKind.ExplicitUserDefined: 1757case ConversionKind.ImplicitUserDefined: 1788case ConversionKind.IntPtr: 1800case ConversionKind.ImplicitNumeric: 1801case ConversionKind.ExplicitNumeric: 1815case ConversionKind.ImplicitEnumeration: 1816case ConversionKind.ExplicitEnumeration:
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (4)
20Debug.Assert(right.Conversion.Kind == ConversionKind.Deconstruction); 219Debug.Assert(conversion.Kind == ConversionKind.Deconstruction); 307if ((tupleConversion.Conversion.Kind == ConversionKind.ImplicitTupleLiteral || tupleConversion.Conversion.Kind == ConversionKind.Identity)
Lowering\LocalRewriter\LocalRewriter_IsOperator.cs (1)
30ConversionKind conversionKind,
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (4)
92BoundNode.GetConversion(leftConversion, leftPlaceholder) is { Kind: ConversionKind.Identity or ConversionKind.ImplicitReference }) 99if (BoundNode.GetConversion(leftConversion, leftPlaceholder) is { IsIdentity: true } or { Kind: ConversionKind.ExplicitNullable }) 224if (boundConversion.ConversionKind != ConversionKind.Identity)
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
618if (conv.ConversionKind == ConversionKind.Boxing)
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (2)
18Debug.Assert(conversion.ConversionKind == ConversionKind.InterpolatedString); 240if (arg is BoundConversion { Conversion: { Kind: ConversionKind.InterpolatedStringHandler }, ExplicitCastInCode: false, Operand: var operand })
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (16)
49case BoundConversion { Conversion: { Kind: ConversionKind.Identity }, Operand: var o }: 51case BoundConversion { Conversion: { Kind: ConversionKind.ImplicitTupleLiteral }, Operand: var o }: 89(kind == ConversionKind.ImplicitNullable || kind == ConversionKind.ExplicitNullable) && 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. 211var conversion = Conversion.MakeNullableConversion(ConversionKind.ImplicitNullable, Conversion.Identity); 224bool conversionMustBePerformedOnOriginalExpression(ConversionKind kind) 230case ConversionKind.AnonymousFunction: // a lambda cannot be saved without a target type 231case ConversionKind.MethodGroup: // similarly for a method group 232case ConversionKind.InterpolatedString: // an interpolated string must be saved in interpolated form 233case ConversionKind.SwitchExpression: // a switch expression must have its arms converted 234case ConversionKind.StackAllocToPointerType: // a stack alloc is not well-defined without an enclosing conversion 235case ConversionKind.ConditionalExpression: // a conditional expression must have its alternatives converted 236case ConversionKind.StackAllocToSpanType: 237case ConversionKind.ObjectCreation:
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())
Lowering\SyntheticBoundNodeFactory.cs (4)
558Debug.Assert(conversion.Kind != ConversionKind.NoConversion); 559if (conversion.Kind != ConversionKind.Identity) 1501if (conversion.Kind == ConversionKind.ImplicitReference && arg.IsLiteralNull()) 1507if (conversion.Kind == ConversionKind.ExplicitNullable &&
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\Source\SourceComplexParameterSymbol.cs (1)
400((BoundConversion)convertedExpression).ConversionKind != ConversionKind.DefaultLiteral)
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (1)
1367return conversions.ClassifyImplicitConversionFromType(sourceType, targetType, ref discardedUseSiteInfo).Kind != ConversionKind.NoConversion;
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
FunctionPointerUtilities.cs (1)
185var expectedConversionKind = (expectedType, expectedConvertedType, expectedSymbol) switch