Skip to content

use nameof for CallerArgumentExpression - #58514

Merged
amcasey merged 1 commit into
dotnet:mainfrom
WeihanLi:use-nameof-for-caller-argument-expression
Oct 23, 2024
Merged

amcasey merged 1 commit into
dotnet:mainfrom
WeihanLi:use-nameof-for-caller-argument-expression

Conversation

@WeihanLi

Copy link
Copy Markdown
Contributor

use nameof for CallerArgumentExpression

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

use nameof for CallerArgumentExpression

Description

use nameof for better maintainability

@ghost ghost added the area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions label Oct 19, 2024
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Oct 19, 2024

@amcasey amcasey left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I find it curious that the spec doesn't seem to use nameof in any of its examples, this seems equivalent and more robust.

@amcasey
amcasey merged commit 0cf40ce into dotnet:main Oct 23, 2024
@dotnet-policy-service dotnet-policy-service Bot added this to the 10.0-preview1 milestone Oct 23, 2024
@WeihanLi

WeihanLi commented Oct 23, 2024 •

Copy link
Copy Markdown
Contributor Author

While I find it curious that the spec doesn't seem to use nameof in any of its examples

Think it because the nameof was not available when it's introduced in .NET 6(C# 10), nameof available to use in attributes since C# 11, would try to update the spec samples, thanks

@WeihanLi
WeihanLi deleted the use-nameof-for-caller-argument-expression branch October 23, 2024 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants