-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Discussion: extend the scope of parameter names to attributes #443
Comments
This would be an incompatible change. Instead of binding to a constant from the enclosing scope, an attribute argument would now bind to a (non-constant) parameter, which would make a currently compiling program an error. |
@gafter Do you mean something like private const string foo = "";
void M(string foo, [AttributeAcceptingString(foo)] string blah) {} would break, because it would bind to the parameter |
@jamesqo this change would not affect your example, because |
Accessing the name of argument names with this version is very inconvenient in comparison to a modification of the nameof expression as described in #373 i would say. (though bringing it in scope in gernal certainly would not hurt) |
Closing in favor of championed issue #373 |
PS: This is different from #373 as it proposes to allow parameters in
nameof
from any method.The text was updated successfully, but these errors were encountered: