For non-primitive types, you can map and check if the op_Implicit method op_Implicit for any type that supports conversion. IL does not actually support true operator overloading, so this is a pure C # notation for recognizing operator overloads. This method will also be marked as IsSpecialName if it was created from an operator overload definition in C #.
For primitive types (for example, Int32 and Int64), the simplest option is hard coding of various cases, since the conversion is performed using the primitive IL operation code and not through the method. However, there are only a few primitive types, so it’s easy to create a method that checks all the possibilities for each primitive type.
One-way note, since your example mentions specific types of values, note that the existence of an implicit “conversion” (in C #) does not mean that all “throws” will work. The C # cast (T)x operation may also mean "unbox value from x to enter T". If x contains a nested Int32 package and you try (Int64) x, this will fail at run time, although you can implicitly "convert" Int32 to Int64. See Eric Lippert for more information on why unpacking works this way.
source share