Skip to content

Commit f3c17e4

Browse files
committed
Initial review
Review the changes for the feature and make a few small updates.
1 parent 712c666 commit f3c17e4

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

standard/attributes.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -797,13 +797,13 @@ Caller information is only substituted when a function is explicitly invoked in
797797
798798
One exception is query expressions. These are considered syntactic expansions, and if the calls they expand to omit optional parameters with caller-info attributes, caller information will be substituted. The location used is the location of the query clause which the call was generated from.
799799
800-
If more than one caller-info attribute is specified on a given parameter, they are recognized in the following order: `CallerLineNumber`, `CallerFilePath`, `CallerMemberName`. Consider the following parameter declaration:
800+
If more than one caller-info attribute is specified on a given parameter, they are recognized in the following order: `CallerLineNumber`, `CallerFilePath`, `CallerMemberName`, `CallerArgumentExpression`. Consider the following parameter declaration:
801801
802802
```csharp
803803
[CallerMemberName, CallerFilePath, CallerLineNumber] object p = ...
804804
```
805805
806-
`CallerLineNumber` takes precedence, and the other two attributes are ignored. If `CallerLineNumber` were omitted, `CallerFilePath` would take precedence, and `CallerMemberName` would be ignored. The lexical ordering of these attributes is irrelevant.
806+
`CallerLineNumber` takes precedence, and the other three attributes are ignored. If `CallerLineNumber` were omitted, `CallerFilePath` would take precedence, and `CallerMemberName` and `CallerArgumentExpression` would be ignored. The lexical ordering of these attributes is irrelevant.
807807
808808
#### 23.5.6.2 The CallerLineNumber attribute
809809
@@ -847,9 +847,9 @@ For an invocation that occurs within a local function, the name of the method th
847847
848848
#### §callargexpattr The CallerArgumentExpression attribute
849849
850-
The attribute `System.Runtime.CompilerServices.CallerArgumentExpression` is applied to a *target parameter*, and can result in the capture of the source-code text of a sibling parameter’s argument as a string, referred to here as the *captured string*.
850+
The attribute `System.Runtime.CompilerServices.CallerArgumentExpressionAttribute` is applied to a *target parameter*, and can result in the capture of the source-code text of a sibling parameter’s argument as a string, referred to here as the *captured string*.
851851
852-
Except when it is the first parameter in an extension method, the target parameter shall have a *default_argument*.
852+
Except when it is the first parameter in an extension method, the target parameter shall have a *default_argument*. When applied to the first parameter of an extension method, the captured string is the source text of the receiver expression in an extension method invocation. If the method is invoked using static method syntax, the captured string is the argument corresponding to the first parameter.
853853
854854
Consider the following method declaration:
855855

standard/standard-library.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -789,11 +789,11 @@ namespace System.Runtime.CompilerServices
789789
public Type BuilderType { get; }
790790
}
791791

792-
[System.AttributeUsage(System.AttributeTargets.Parameter, AllowMultiple=false,
793-
Inherited=false)]
792+
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false,
793+
Inherited = false)]
794794
public sealed class CallerArgumentExpressionAttribute : Attribute
795795
{
796-
public CallerArgumentExpressionAttribute (string parameterName);
796+
public CallerArgumentExpressionAttribute(string parameterName);
797797
}
798798

799799
[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
@@ -1396,8 +1396,8 @@ The following library types are referenced in this specification. The full names
13961396
- `global::System.Linq.Expressions.Expression<TDelegate>`
13971397
- `global::System.Reflection.MemberInfo`
13981398
- `global::System.Runtime.CompilerServices.AsyncMethodBuilderAttribute`
1399-
- `global::System.Runtime.CompilerServices.CallerFilePathAttribute`
14001399
- `global::System.Runtime.CompilerServices.CallerArgumentExpressionAttribute`
1400+
- `global::System.Runtime.CompilerServices.CallerFilePathAttribute`
14011401
- `global::System.Runtime.CompilerServices.CallerLineNumberAttribute`
14021402
- `global::System.Runtime.CompilerServices.CallerMemberNameAttribute`
14031403
- `global::System.Runtime.CompilerServices.FormattableStringFactory`

0 commit comments

Comments
 (0)