Open sandboxFocus

Enum ConversionKind

Describes conversion between types possible during comparison.

Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public enum ConversionKind

Fields

Name Description
Default

Accepts any value that is type-compatible, including boxing conversions, but excluding user-defined implicit operators. This corresponds to the behavior of C# is operator.

Equal

Accepts only the types that are equal, as the comparer that is being used defines equality. Unlike Identical, the names of the elements of a tuple take part, and the nullability of a reference type takes part when the comparer is IncludeNullability.

Identical

Accepts only the types between which the language defines an identity conversion. As in the language, the nullability of a reference type and the names of the elements of a tuple do not take part, so object and object?, and (int A, int B) and (int, int), are accepted.

Implicit

Accepts any value implicitly convertible to the given type, including boxing and user-defined implicit operators. This corresponds to C# value assignability.

ImplicitReference
Reference

Accepts any value that is reference-compatible with the given type i.e. instances of subclasses or interface implementations, but refuses boxing conversions.

TypeDefinition

Accepts any value that extends or implements a type that is of the same type definition as the given type definition.

See Also