nameof(null)
and friends
#8273
-
The capabilities of
The above examples are some that I've had need for. There are others which can be made to "just work" as a way of rounding things out, like |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Arguments in support for this are the same as for |
Beta Was this translation helpful? Give feedback.
-
What I know as the advantages to using
These don't apply to Taking advantages you listed:
I would suggest instead a thing that comes with all these benefits and more: string-based enums (#2849). With string-based enums, you can actually obtain strong typing by restricting what sets of things go together, rather than allowing |
Beta Was this translation helpful? Give feedback.
What I know as the advantages to using
nameof
are the following:These don't apply to
nameof(false)
.Taking advantages you listed:
false
it will also offer strings likeint
and123
.nameof
even if this feature di…