Closed reflection-emit closed 7 years ago
Use this instead
public static MethodInfo GetImplicitOrExplicit(this Type type, Type resultType) { var result = resultType.GetMethods(BindingFlags.Static | BindingFlags.Public) .FirstOrDefault(x => (x.Name == "op_Implicit" || x.Name == "op_Explicit") && x.ReturnType == resultType && x.GetParameters()[0].ParameterType == type); if (result == null) return type.GetMethods(BindingFlags.Static | BindingFlags.Public) .FirstOrDefault(x => (x.Name == "op_Implicit" || x.Name == "op_Explicit") && x.ReturnType == resultType && x.GetParameters()[0].ParameterType == type); return result; }
fixed
Use this instead