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

Use nameof instead of strongly typed string #1896

Merged
merged 4 commits into from Jul 18, 2019

Conversation

@yahiheb
Copy link
Collaborator

commented Jul 12, 2019

No description provided.

@MaxHillebrand
Copy link
Collaborator

left a comment

($"Could not parse {nameof(Height)}.");
prototype to nameof(Prototype).ToLower()

@nopara73

This comment has been minimized.

Copy link
Collaborator

commented Jul 13, 2019

Concept ACK. Can you fix the conflict before review?

@yahiheb

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 13, 2019

@nopara73 Conflicts fixed.

@@ -300,7 +298,7 @@ private OptionValueType ParsePrototype()
string name = Names[i];
if (name.Length == 0)
{
throw new ArgumentException("Empty option names are not supported.", "prototype");
throw new ArgumentException("Empty option names are not supported.", nameof(Prototype).ToLower());

This comment has been minimized.

Copy link
@molnard

molnard Jul 17, 2019

Collaborator

Bacause ArgumentException second parameter is the exact name of param, IMO .ToLower() is unnecessary even if the original Exception worked like that. These texts are written to the user on the console so changing it won't cause any trouble.

This comment has been minimized.

Copy link
@yahiheb

yahiheb Jul 17, 2019

Author Collaborator

In other exception messages "prototype" all lower case was used, that is the only reason I used .ToLower(). I can remove it if you want.

This comment has been minimized.

Copy link
@molnard

molnard Jul 17, 2019

Collaborator

@nopara73 Should we stay with prototype with lower case in ArgumentException? The name of the property is Prototype so that would be the correct one but in the original code it is prototype.
These messages are written to the console to the user.

WalletWasabi/Mono/OptionSet.cs Outdated Show resolved Hide resolved
WalletWasabi/Mono/OptionSet.cs Outdated Show resolved Hide resolved
yahiheb and others added 2 commits Jul 17, 2019

@nopara73 nopara73 merged commit 8d5cf49 into zkSNACKs:master Jul 18, 2019

@yahiheb yahiheb deleted the yahiheb:nameof-interpolation branch Jul 18, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.