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

nameof usage instead of plain text #1362

Closed
sungam3r opened this issue Dec 29, 2018 · 4 comments
Closed

nameof usage instead of plain text #1362

sungam3r opened this issue Dec 29, 2018 · 4 comments
Milestone

Comments

@sungam3r
Copy link

In the code there are constructions like

	public bool ShowInternalApi {
			get { return ShowApiLevel == ApiVisibility.PublicAndInternal; }
			set {
				if (ShowApiLevel == ApiVisibility.PublicAndInternal) {
					ShowApiLevel = ApiVisibility.PublicOnly;
				} else {
					ShowApiLevel = ApiVisibility.PublicAndInternal;
				}
				OnPropertyChanged("ShowInternalApi");
				OnPropertyChanged("ShowAllApi");
			}
		}

with literal strings mainly for OnPropertyChanged

For safe use and to simplify the search consider to change it everywhere to nameof:

			get { return ShowApiLevel == ApiVisibility.PublicAndInternal; }
			set {
				if (ShowApiLevel == ApiVisibility.PublicAndInternal) {
					ShowApiLevel = ApiVisibility.PublicOnly;
				} else {
					ShowApiLevel = ApiVisibility.PublicAndInternal;
				}
				OnPropertyChanged(nameof(ShowInternalApi));
				OnPropertyChanged(nameof(ShowAllApi));
			}
		}
@sungam3r sungam3r changed the title nameof usage indtead all plain text nameof usage instead of plain text Dec 29, 2018
@siegfriedpammer
Copy link
Member

Currently, there are no plans to introduce nameof expressions in the decompiled output, because things can get quite complicated. For more information on which language features we are focusing on currently, see #829.

@sungam3r
Copy link
Author

@siriak
Copy link
Contributor

siriak commented Dec 29, 2018

I can fix it if no one minds.

@siegfriedpammer
Copy link
Member

@sungam3r Oh sorry, I misunderstood. Normally people ask about decompilation quality, that's why I jumped conclusions.

@siriak Thank you for providing a pull request.

@siegfriedpammer siegfriedpammer added this to the 4.0rc1 milestone Jan 5, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants