-
Notifications
You must be signed in to change notification settings - Fork 113
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
Tweak Nameof
slightly, add GetNameof()
support to more expressions
#1618
Tweak Nameof
slightly, add GetNameof()
support to more expressions
#1618
Conversation
When attempting to test this I get the following error: |
I'm going to move the eval of a name from the expression emission to the building phase, and if nothing depends on the existence of |
Could be a problem with your RT submodule because the annotations package is referenced there. no idea otherwise. |
Throwing is bad. Unwinding isn't healthy for tracking code errors. I refactored
GetNameof()
to return an optional string, which gets checked in the actualNameof
expression. There we can emit the error.The arguments for
GetNameof
felt unnecessary sincedmObject
was unused,proc
was used only once inLocal
, so I cut the arguments from the method. Let me know if I should keep it.nameof()
is also usable in constant contexts (eg. switch cases), so I added an override forTryAsConstant()
.Also a few l-values didn't have any nameof support, so I added it in this PR.