Replies: 10 comments
-
What's the downside of directly using the name of the type that declares the member, rather than using the generic type parameter? |
Beta Was this translation helpful? Give feedback.
-
@jnm2 No downsides, it was just spontaneous desire from colleague during some pair programming session. |
Beta Was this translation helpful? Give feedback.
-
Just curious if I was missing something. It's in line with other things you can already do like |
Beta Was this translation helpful? Give feedback.
-
If it provides literally zero benefit, then its not worth the time spent changing it and testing that change. |
Beta Was this translation helpful? Give feedback.
-
@MgSam Yes, you can close this ticket. |
Beta Was this translation helpful? Give feedback.
-
@gafter thought it was worth discussing on csharplang, let's maybe hear what the C# team's perspective would be. |
Beta Was this translation helpful? Give feedback.
-
To me it sounds like this should be supported just for completeness, it reduces duplication of what the compiler already knows on the expense of readability, I find the former where you explicitly spell out the interface more readable. |
Beta Was this translation helpful? Give feedback.
-
I have a string of use cases for I was curious if someone had a similar scenario with type parameters, but either way completeness is not a bad thing. |
Beta Was this translation helpful? Give feedback.
-
Every feature comes with not just the cost of implementing it but the opportunity cost of working on something else, potentially more valuable. Do you believe that this feature is more valuable than something else they could instead be working on? |
Beta Was this translation helpful? Give feedback.
-
There are always two phases: judging whether a feature is good or bad, and judging the feature's priority. It's good to not mix them up. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
@m08pvv commented on Tue Apr 12 2016
Version Used: shipped with VS 2015 Update 2
For this code:
Expected Behavior:
both nameof() should be allowed
Actual Behavior:
nameof() for type parameter is not allowed
@jamesbascle commented on Wed Jul 13 2016
Could do nameof(ISomeInterface.SomeValue). What is the advantage of using T? It seems counter to the way all the other nameof stuff works, where you reference the compile time types, rather than parameters or type parameters.
Beta Was this translation helpful? Give feedback.
All reactions