-
Notifications
You must be signed in to change notification settings - Fork 90
14.5.4, "Using static directives": Example needed #199
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
Comments
Quick example - there may be better ones... This compiles: using System.Text;
using static System.Text.Encoding;
public class Test
{
static void Main()
{
Encoding utf8 = UTF8; // Encoding.UTF8 is imported automatically
}
} But this doesn't: using System.Text;
using static System.Text.ASCIIEncoding;
public class Test
{
static void Main()
{
Encoding utf8 = UTF8; // UTF8 isn't declared directly in ASCIIEncoding
}
} |
Eric-inspired note: We can't work out the motivation behind this rule. It would be nice to note it if we can dig it up. @MadsTorgersen, any help here? |
(We suspect that understanding the rule may help come up with a better example, so assigned to Mads.) |
Per Jon's comment that mentioned @MadsTorgersen The rule in question:
I suspect the reason for this rule is that without it, any |
Discussed in June 30th meeting: That decision is to encourage developers to use the canonical names of types being importing in a A downside is that it means moving a |
Added in c5ce449 |
At the very end of this subclause we have the following:
We need someone to provide the example or to argue against doing so.
The text was updated successfully, but these errors were encountered: