Replies: 2 comments
-
This is very valid from refactor point of view. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'd say for me it's split 60/40 whether I'm renaming the whole group or a single method. It really has to do with the refactor I'm doing and what the callers are. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently the
nameof
lacks the ability to disambiguate overloads which makes it fragile when used to capture a method name. When using refactoring tools in Visual Studio it's impossible to determine which overloadnameof
would apply to so the IDE leaves thenameof
operator alone as long as there are any other methods with that same name.I propose supporting additional syntax with
nameof
to allow it to disambiguate which overloaded method to which it applies. This would fix the refactoring fragility above as well as open the doors to other operators which would require such disambiguation, e.g.methodof
orinfoof
.The proposal is that for a method group you can optionally add a parenthesis-enclosed comma-separated list of types following the identifier. This list of types would be used to disambiguate potential overloads of that method group by exact binding.
Beta Was this translation helpful? Give feedback.
All reactions