Table of Contents 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Notes DownloadECMA-334 C# Language Specification


14 Expressions
14.4 Function members
14.4.2 Overload resolution
Paragraph 11 Overload resolution is a compile-time mechanism for selecting the best function member to invoke given an argument list and a set of candidate function members. 2 Overload resolution selects the function member to invoke in the following distinct contexts within C#:
Paragraph 21 Each of these contexts defines the set of candidate function members and the list of arguments in its own unique way. 2 However, once the candidate function members and the argument list have been identified, the selection of the best function member is the same in all cases: - 3 First, the set of candidate function members is reduced to those function members that are applicable with respect to the given argument list (§14.4.2.1). 4 If this reduced set is empty, a compile-time error occurs.
- 5 Then, given the set of applicable candidate function members, the best function member in that set is located. 6 If the set contains only one function member, then that function member is the best function member. 7 Otherwise, the best function member is the one function member that is better than all other function members with respect to the given argument list, provided that each function member is compared to all other function members using the rules in §14.4.2.2. 8 If there is not exactly one function member that is better than all other function members, then the function member invocation is ambiguous and a compile-time error occurs.
Paragraph 31 The following sections define the exact meanings of the terms applicable function member and better function member. |
Jagger Software Ltd |
Company # 4070126 |
VAT # 762 5213 42 |

