Better conversion from expression
Given an implicit conversion C1 that converts from an expression E to a type T1, and an implicit conversion C2 that converts from an expression E to a type T2, C1 is a better conversion than C2 if at least one of the following holds: · E has a type S and an identity conversion exists from S to T1 but not from S to T2 · E is not an anonymous function and T1 is a better conversion target than T2 (§7.5.3.5) · E is an anonymous function, T1 is either a delegate type D1 or an expression tree type Expression<D1>, T2 is either a delegate type D2 or an expression tree type Expression<D2> and one of the following holds: o D1 is a better conversion target than D2 o D1 and D2 have identical parameter lists, and one of the following holds: · D1 has a return type Y1, and D2 has a return type Y2, an inferred return type X exists for E in the context of that parameter list (§7.5.2.12), and the conversion from X to Y1 is better than the conversion from X to Y2 · D1 has a return type Y, and D2 is void returning Better conversion from type Given a conversion C1 that converts from a type S to a type T1, and a conversion C2 that converts from a type S to a type T2, C1 is a better conversion than C2 if at least one of the following holds: · An identity conversion exists from S to T1 but not from S to T2 · T1 is a better conversion target than T2 (§7.5.3.5)
|