From e187785bce406aec4ed942e67c65db8b6af97e88 Mon Sep 17 00:00:00 2001 From: Rex Jaeschke Date: Tue, 26 Jan 2021 13:37:43 -0500 Subject: [PATCH 1/3] Update expressions.md --- standard/expressions.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/standard/expressions.md b/standard/expressions.md index e0823b247..fbec836df 100644 --- a/standard/expressions.md +++ b/standard/expressions.md @@ -547,7 +547,7 @@ argument_value ; ``` -An *argument_list* consists of one or more *argument*s, separated by commas. Each argument consists of an optional *argument_name* followed by an *argument_value*. An *argument* with an *argument_name* is referred to as a ***named argument***, whereas an *argument* without an *argument_name* is a ***positional argument***. It is an error for a positional argument to appear after a named argument in an *argument_list*. +An *argument_list* consists of one or more *argument*s, separated by commas. Each argument consists of an optional *argument_name* followed by an *argument_value*. An *argument* with an *argument_name* is referred to as a ***named argument***, whereas an *argument* without an *argument_name* is a ***positional argument***. The *argument_value* can take one of the following forms: @@ -581,6 +581,8 @@ The corresponding parameters for function member arguments are established as fo - For properties, when invoking the get accessor there are no arguments. When invoking the set accessor, the expression specified as the right operand of the assignment operator corresponds to the implicit value parameter of the set accessor declaration. - For user-defined unary operators (including conversions), the single operand corresponds to the single parameter of the operator declaration. - For user-defined binary operators, the left operand corresponds to the first parameter, and the right operand corresponds to the second parameter of the operator declaration. +- An unnamed argument corresponds to no parameter when it is after an out-of-position named argument or a named params argument. + > *Note*: This prevents `void M(bool a = true, bool b = true, bool c = true, );` being invoked by `M(c: false, valueB);`. The first argument is used out-of-position (the argument is used in first position, but the parameter named `c` is in third position), so the following arguments should be named. In other words, non-trailing named arguments are only allowed when the name and the position result in finding the same corresponding parameter. *end note* #### 11.6.2.3 Run-time evaluation of argument lists From f85d8d9faa3464bffc216b017914856542a33da3 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 30 Nov 2022 20:26:07 +0000 Subject: [PATCH 2/3] Update standard/expressions.md Co-authored-by: Bill Wagner --- standard/expressions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard/expressions.md b/standard/expressions.md index fbec836df..eef5b7324 100644 --- a/standard/expressions.md +++ b/standard/expressions.md @@ -582,7 +582,7 @@ The corresponding parameters for function member arguments are established as fo - For user-defined unary operators (including conversions), the single operand corresponds to the single parameter of the operator declaration. - For user-defined binary operators, the left operand corresponds to the first parameter, and the right operand corresponds to the second parameter of the operator declaration. - An unnamed argument corresponds to no parameter when it is after an out-of-position named argument or a named params argument. - > *Note*: This prevents `void M(bool a = true, bool b = true, bool c = true, );` being invoked by `M(c: false, valueB);`. The first argument is used out-of-position (the argument is used in first position, but the parameter named `c` is in third position), so the following arguments should be named. In other words, non-trailing named arguments are only allowed when the name and the position result in finding the same corresponding parameter. *end note* + > *Note*: This prevents `void M(bool a = true, bool b = true, bool c = true);` being invoked by `M(c: false, valueB);`. The first argument is used out-of-position (the argument is used in first position, but the parameter named `c` is in third position), so the following arguments should be named. In other words, non-trailing named arguments are only allowed when the name and the position result in finding the same corresponding parameter. *end note* #### 11.6.2.3 Run-time evaluation of argument lists From 63c01034033aec70dd252d6ed3da46570b5a0425 Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Wed, 30 Nov 2022 20:26:14 +0000 Subject: [PATCH 3/3] Update standard/expressions.md --- standard/expressions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard/expressions.md b/standard/expressions.md index eef5b7324..4519355a7 100644 --- a/standard/expressions.md +++ b/standard/expressions.md @@ -581,7 +581,7 @@ The corresponding parameters for function member arguments are established as fo - For properties, when invoking the get accessor there are no arguments. When invoking the set accessor, the expression specified as the right operand of the assignment operator corresponds to the implicit value parameter of the set accessor declaration. - For user-defined unary operators (including conversions), the single operand corresponds to the single parameter of the operator declaration. - For user-defined binary operators, the left operand corresponds to the first parameter, and the right operand corresponds to the second parameter of the operator declaration. -- An unnamed argument corresponds to no parameter when it is after an out-of-position named argument or a named params argument. +- An unnamed argument corresponds to no parameter when it is after an out-of-position named argument or a named argument that corresponds to a parameter array. > *Note*: This prevents `void M(bool a = true, bool b = true, bool c = true);` being invoked by `M(c: false, valueB);`. The first argument is used out-of-position (the argument is used in first position, but the parameter named `c` is in third position), so the following arguments should be named. In other words, non-trailing named arguments are only allowed when the name and the position result in finding the same corresponding parameter. *end note* #### 11.6.2.3 Run-time evaluation of argument lists