Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify conversion rules for CallerArgumentExpression #5438

Merged
merged 3 commits into from
Nov 17, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions proposals/csharp-10.0/caller-argument-expression.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ There should always be an expression corresponding to the `this` parameter. Even
- Multiple parameters marked with `CallerArgumentExpression` are permitted, as shown above.
- The attribute's namespace will be `System.Runtime.CompilerServices`.
- If `null` or a string that is not a parameter name (e.g. `"notAParameterName"`) is provided, the compiler will pass in an empty string.
- The type of the parameter `CallerArgumentExpressionAttribute` is applied to must have a standard implicit conversion from `string`. This means no user-defined conversions from `string` are allowed, and in practice means the type of such a parameter must be `string`, `object`, or an interface implemented by `string`.
333fred marked this conversation as resolved.
Show resolved Hide resolved

## Drawbacks
[drawbacks]: #drawbacks
Expand Down