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

Method parameter names scoping change for nameof #24068

Open
1 task
BillWagner opened this issue May 6, 2021 · 9 comments
Open
1 task

Method parameter names scoping change for nameof #24068

BillWagner opened this issue May 6, 2021 · 9 comments
Assignees
Labels
doc-enhancement Improve the current content [org][type][category] dotnet-csharp/svc lang-reference/subsvc Pri1 High priority, do before Pri2 and Pri3

Comments

@BillWagner
Copy link
Member

BillWagner commented May 6, 2021

Proposal is here: nameof(parameter)

A motivation for this is to enable nameof to name a parameter in an attribute constructor.

Effectively, the nameof(p) could find p as a parameter name to a function defined in the current scope.

Tasks:

  • Update the nameof language reference page to show the new example.
@PRMerger14 PRMerger14 added the Pri3 label May 6, 2021
@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label May 6, 2021
@BillWagner BillWagner added 🏁 Release: .NET 6 Issues and PRs for the .NET 6 release lang-reference/subsvc doc-enhancement Improve the current content [org][type][category] dotnet-csharp/svc labels May 6, 2021
@dotnet-bot dotnet-bot removed the ⌚ Not Triaged Not triaged label May 6, 2021
@BillWagner BillWagner added Pri1 High priority, do before Pri2 and Pri3 and removed Pri3 labels May 6, 2021
@pkulikov
Copy link
Contributor

pkulikov commented May 7, 2021

@BillWagner when is a good time to start submitting PRs for C# 10 changes? (I would say: beginning of September?)

@BillWagner
Copy link
Member Author

@pkulikov

I think we can start once these features are available in a public preview.

I'm converting issues to notes when a feature is merged into the main branch in the roslyn repo. That should give us an idea how soon features will be available to use.

@BillWagner
Copy link
Member Author

The obvious example here is a method where a parameter has the NotNullWhenNotNull attribute.

@BillWagner BillWagner self-assigned this Jun 8, 2021
@BillWagner
Copy link
Member Author

@pkulikov I did assign this to me, but I'm happy to have others work on them. I just don't want to lose them in my queue. 😄

@BillWagner
Copy link
Member Author

@jcouv This doesn't seem to be in .NET 6 preview 5.

The roslyn feature status page shows it as in the main branch, but without a release target. Can you clarify? Is this available yet?

@jcouv
Copy link
Member

jcouv commented Jul 1, 2021

The feature status page says the feature will go straight into main (no feature branch needed since small feature) but is still "in progress".
I still want to get it into C# 10 (will aim for dev17.0p3).

@pkulikov
Copy link
Contributor

@jcouv @BillWagner did this feature end up in C# 10? The roslyn lang feature status says it's in progress.

@jcouv
Copy link
Member

jcouv commented Oct 13, 2021

nameof(parameter) didn't make it into C# 10.

@BillWagner BillWagner removed the 🏁 Release: .NET 6 Issues and PRs for the .NET 6 release label Nov 1, 2021
@BillWagner
Copy link
Member Author

I dropped the .NET 6 release label, and removed this issue from the related projects. I'll leave it open to address when the feature is available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-enhancement Improve the current content [org][type][category] dotnet-csharp/svc lang-reference/subsvc Pri1 High priority, do before Pri2 and Pri3
Projects
None yet
Development

No branches or pull requests

5 participants