Class Conversion
- Namespace
- ICSharpCode.Decompiler.Semantics
- Assembly
- ICSharpCode.Decompiler.dll
Holds information about a conversion between two types.
public abstract class Conversion : IEquatable<Conversion>
- Inheritance
-
Conversion
- Implements
- Inherited Members
Constructors
Conversion()
protected Conversion()
Fields
BoxingConversion
public static readonly Conversion BoxingConversion
Field Value
ExplicitDynamicConversion
public static readonly Conversion ExplicitDynamicConversion
Field Value
ExplicitLiftedNumericConversion
public static readonly Conversion ExplicitLiftedNumericConversion
Field Value
ExplicitNullableConversion
public static readonly Conversion ExplicitNullableConversion
Field Value
ExplicitNumericConversion
public static readonly Conversion ExplicitNumericConversion
Field Value
ExplicitPointerConversion
public static readonly Conversion ExplicitPointerConversion
Field Value
ExplicitReferenceConversion
public static readonly Conversion ExplicitReferenceConversion
Field Value
IdentityConversion
Identity conversion.
public static readonly Conversion IdentityConversion
Field Value
ImplicitConstantExpressionConversion
The numeric conversion of a constant expression.
public static readonly Conversion ImplicitConstantExpressionConversion
Field Value
ImplicitDynamicConversion
public static readonly Conversion ImplicitDynamicConversion
Field Value
ImplicitInterpolatedStringConversion
C# 6 string interpolation expression implicitly being converted to IFormattable or FormattableString.
public static readonly Conversion ImplicitInterpolatedStringConversion
Field Value
ImplicitLiftedNumericConversion
public static readonly Conversion ImplicitLiftedNumericConversion
Field Value
ImplicitNullableConversion
public static readonly Conversion ImplicitNullableConversion
Field Value
ImplicitNumericConversion
public static readonly Conversion ImplicitNumericConversion
Field Value
ImplicitPointerConversion
public static readonly Conversion ImplicitPointerConversion
Field Value
ImplicitReferenceConversion
public static readonly Conversion ImplicitReferenceConversion
Field Value
None
Not a valid conversion.
public static readonly Conversion None
Field Value
NullLiteralConversion
public static readonly Conversion NullLiteralConversion
Field Value
ThrowExpressionConversion
C# 7 throw expression being converted to an arbitrary type.
public static readonly Conversion ThrowExpressionConversion
Field Value
TryCast
C# 'as' cast.
public static readonly Conversion TryCast
Field Value
UnboxingConversion
public static readonly Conversion UnboxingConversion
Field Value
Properties
ConversionAfterUserDefinedOperator
The conversion that is applied to the result of the user-defined conversion operator.
public virtual Conversion ConversionAfterUserDefinedOperator { get; }
Property Value
ConversionBeforeUserDefinedOperator
The conversion that is applied to the input before the user-defined conversion operator is invoked.
public virtual Conversion ConversionBeforeUserDefinedOperator { get; }
Property Value
DelegateCapturesFirstArgument
For method-group conversions, gets whether the conversion captures the first argument.
For instance methods, this property always returns true for C# method-group conversions.
For static methods, this property returns true for method-group conversions of an extension method performed on an instance (eg. Func<int> f = myEnumerable.Single
).
public virtual bool DelegateCapturesFirstArgument { get; }
Property Value
ElementConversions
For a tuple conversion, gets the individual tuple element conversions.
public virtual ImmutableArray<Conversion> ElementConversions { get; }
Property Value
IsAnonymousFunctionConversion
Gets whether this conversion is an anonymous function conversion.
public virtual bool IsAnonymousFunctionConversion { get; }
Property Value
IsBoxingConversion
Gets whether this conversion is a boxing conversion.
public virtual bool IsBoxingConversion { get; }
Property Value
IsConstantExpressionConversion
public virtual bool IsConstantExpressionConversion { get; }
Property Value
IsDynamicConversion
Gets whether the conversion is dynamic.
public virtual bool IsDynamicConversion { get; }
Property Value
IsEnumerationConversion
Gets whether the conversion is an enumeration conversion.
public virtual bool IsEnumerationConversion { get; }
Property Value
IsExplicit
public virtual bool IsExplicit { get; }
Property Value
IsIdentityConversion
public virtual bool IsIdentityConversion { get; }
Property Value
IsImplicit
public virtual bool IsImplicit { get; }
Property Value
IsInterpolatedStringConversion
Gets whether this is an interpolated string conversion to IFormattable or FormattableString.
public virtual bool IsInterpolatedStringConversion { get; }
Property Value
IsLifted
Gets whether this conversion is a lifted version of another conversion.
public virtual bool IsLifted { get; }
Property Value
IsMethodGroupConversion
Gets whether this conversion is a method group conversion.
public virtual bool IsMethodGroupConversion { get; }
Property Value
IsNullLiteralConversion
public virtual bool IsNullLiteralConversion { get; }
Property Value
IsNullableConversion
Gets whether the conversion is a nullable conversion (conversion between a nullable type and the regular type).
public virtual bool IsNullableConversion { get; }
Property Value
IsNumericConversion
public virtual bool IsNumericConversion { get; }
Property Value
IsPointerConversion
Gets whether this conversion is a pointer conversion.
public virtual bool IsPointerConversion { get; }
Property Value
IsReferenceConversion
Gets whether the conversion is a reference conversion.
public virtual bool IsReferenceConversion { get; }
Property Value
IsThrowExpressionConversion
public virtual bool IsThrowExpressionConversion { get; }
Property Value
IsTryCast
Gets whether the conversion is an 'as
' cast.
public virtual bool IsTryCast { get; }
Property Value
IsTupleConversion
Gets whether this conversion is a tuple conversion.
public virtual bool IsTupleConversion { get; }
Property Value
IsUnboxingConversion
Gets whether this conversion is an unboxing conversion.
public virtual bool IsUnboxingConversion { get; }
Property Value
IsUserDefined
Gets whether this conversion is user-defined (op_Implicit or op_Explicit).
public virtual bool IsUserDefined { get; }
Property Value
IsValid
Gets whether the conversion is valid.
public virtual bool IsValid { get; }
Property Value
IsVirtualMethodLookup
For method-group conversions, gets whether to perform a virtual method lookup at runtime.
public virtual bool IsVirtualMethodLookup { get; }
Property Value
Method
Gets the method associated with this conversion. For user-defined conversions, this is the method being called. For method-group conversions, this is the method that was chosen from the group.
public virtual IMethod Method { get; }
Property Value
Methods
EnumerationConversion(bool, bool)
public static Conversion EnumerationConversion(bool isImplicit, bool isLifted)
Parameters
Returns
Equals(Conversion)
public virtual bool Equals(Conversion other)
Parameters
other
Conversion
Returns
Equals(object)
public override sealed bool Equals(object obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()
Returns
InvalidMethodGroupConversion(IMethod, bool, bool)
public static Conversion InvalidMethodGroupConversion(IMethod chosenMethod, bool isVirtualMethodLookup, bool delegateCapturesFirstArgument)
Parameters
Returns
MethodGroupConversion(IMethod, bool, bool)
public static Conversion MethodGroupConversion(IMethod chosenMethod, bool isVirtualMethodLookup, bool delegateCapturesFirstArgument)
Parameters
Returns
TupleConversion(ImmutableArray<Conversion>)
public static Conversion TupleConversion(ImmutableArray<Conversion> conversions)
Parameters
conversions
ImmutableArray<Conversion>
Returns
UserDefinedConversion(IMethod, bool, Conversion, Conversion, bool, bool)
public static Conversion UserDefinedConversion(IMethod operatorMethod, bool isImplicit, Conversion conversionBeforeUserDefinedOperator, Conversion conversionAfterUserDefinedOperator, bool isLifted = false, bool isAmbiguous = false)
Parameters
operatorMethod
IMethodisImplicit
boolconversionBeforeUserDefinedOperator
ConversionconversionAfterUserDefinedOperator
ConversionisLifted
boolisAmbiguous
bool