Skip to content

Support directly assigning nameof to var#51885

Closed
Rekkonnect wants to merge 1 commit intodotnet:mainfrom
Rekkonnect:nameof-to-var
Closed

Support directly assigning nameof to var#51885
Rekkonnect wants to merge 1 commit intodotnet:mainfrom
Rekkonnect:nameof-to-var

Conversation

@Rekkonnect
Copy link
Contributor

WIP prototype for #4384

Notes:

  • The current implementation adjustment breaks a test case
  • It only supports expressions that contain nameof and return a string, since it uses a hack that adjusts the resulting expression type to string, as it's not possible to bypass the recursive calculation of the resultant type
  • It seems that it would be better to postpone development of this feature until nameof becomes a non-contextual keyword

As a result of the last note, this PR may be closed and discarded completely until that chagne occurs.

CC @333fred

Breaks a test case for currently unknown reasons
@ghost ghost added the Area-Compilers label Mar 15, 2021
@333fred
Copy link
Member

333fred commented Mar 15, 2021

@alfasgd, while I appreciate the enthusiasm, this issue was specifically rejected by LDM, and thus not open for implementation. For reference, only things in the Any Time milestone are open for community contributions: https://github.com/dotnet/csharplang/milestone/14. Because this was rejected, I'm going to close this pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants