От: | romangr | ||
Дата: | 11.04.19 13:01 | ||
Оценка: | 79 (3) |
O>void static Test()
O>{
O> Test(1L);
O>}
O>void static Test(double value)
O>{
O> Console.WriteLine($"double = {value}");
O>}
O>void static Test(float value)
O>{
O> Console.WriteLine($"float = {value}");
O>}
O>
7.5.3.4 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)
7.5.3.5 Better conversion target
Given two different types T1 and T2, T1 is a better conversion target than T2 if at least one of the following holds:
· An implicit conversion from T1 to T2 exists, and no implicit conversion from T2 to T1 exists