Skip to content

Conversation

@cston
Copy link
Contributor

@cston cston commented Oct 17, 2019

Add proposal covering the C#8 feature.


A `static` local function may reference `constant` definitions from the enclosing scope.

`nameof()` in a `static` local function cannot reference state from the enclosing scope.
Copy link
Member

@CyrusNajmabadi CyrusNajmabadi Oct 17, 2019

Choose a reason for hiding this comment

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

that seems super strange. why? nameof is just a constant, so it should be fine, right? #Resolved

@jcouv
Copy link
Member

jcouv commented Oct 21, 2019

This doc should probably be under the chsarp8 folder

@BillWagner
Copy link
Member

Once this is merged, I'll update the TOC in docs to include it with the other C# 8 proposals.

@cston
Copy link
Contributor Author

cston commented Oct 22, 2019

@jaredpar, @jcouv, please review.

@cston cston requested a review from MadsTorgersen October 22, 2019 17:42
@cston cston merged commit 1b488e7 into dotnet:master Oct 24, 2019
@cston cston deleted the static-local-functions branch October 24, 2019 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants