Skip to content
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

Using all syntax #3812

Closed
IdkGoodName opened this issue Aug 20, 2020 · 4 comments
Closed

Using all syntax #3812

IdkGoodName opened this issue Aug 20, 2020 · 4 comments

Comments

@IdkGoodName
Copy link

IdkGoodName commented Aug 20, 2020

What about allowing to import/use all of namespaces? E.g., let's say we have this in C.cs

namespace A.B {
    public class C {
        // ...
    }
}

And this in E.cs

namespace A.D {
    public class E {
        // ...
    }
}

Now, we can use

using A.B;
using A.D;

to get both C and E types. However, what about doing

using A.*;

instead?

@Flutterish
Copy link

Flutterish commented Aug 20, 2020

This sounds fine until you create a namespace in A that makes your code do something unexpected. If anything this could be an IDE feature to add all current child namespaces.

@khm1600
Copy link

khm1600 commented Aug 20, 2020

#2653

@PathogenDavid
Copy link

@khm1600 you beat me to it!


Duplicate of #2653

Similar/related proposals:

Allow importing every namespace in referenced assemblies #1708
Proposals for more compact using directive syntax #3590 #1696
Allow automatic importing when there's no conflicting types #3477
Project-wide using directives #3428 (C# 10.0 candidate) #1777

@333fred
Copy link
Member

333fred commented Aug 20, 2020

Closing as a duplicate.

@333fred 333fred closed this as completed Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants