Skip to content

Commit d2bdab1

Browse files
committed
Initial review
Review the changes for the feature and make a few small updates.
1 parent 3ad9410 commit d2bdab1

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
@@ -800,13 +800,13 @@ Caller information is only substituted when a function is explicitly invoked in
800800
801801
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.
802802
803-
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:
803+
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:
804804
805805
```csharp
806806
[CallerMemberName, CallerFilePath, CallerLineNumber] object p = ...
807807
```
808808
809-
`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.
809+
`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.
810810
811811
#### 23.5.6.2 The CallerLineNumber attribute
812812
@@ -883,9 +883,9 @@ For an invocation that occurs within a local function or an anonymous function,
883883
884884
#### §callargexpattr The CallerArgumentExpression attribute
885885
886-
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*.
886+
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*.
887887
888-
Except when it is the first parameter in an extension method, the target parameter shall have a *default_argument*.
888+
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.
889889
890890
Consider the following method declaration:
891891

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)