private static bool HasExplicitNumericConversion(KnownType sourceType, KnownType targetType) { if (sourceType.IsIntrinsicNumericType() && targetType.IsIntrinsicNumericType()) { return(!HasImplicitNumericConversion(sourceType, targetType)); } return(false); }
private static bool HasImplicitNumericConversion(KnownType sourceType, KnownType targetType) { if (sourceType.IsIntrinsicNumericType() && targetType.IsIntrinsicNumericType()) { var sourceIndex = (int)sourceType; var targetIndex = (int)targetType; return(ImplicitNumericConversions[sourceIndex, targetIndex]); } return(false); }