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

SA1200 Using directive should appear within a namespace declaration #3825

Closed
daleao opened this issue Apr 12, 2024 · 4 comments
Closed

SA1200 Using directive should appear within a namespace declaration #3825

daleao opened this issue Apr 12, 2024 · 4 comments

Comments

@daleao
Copy link

daleao commented Apr 12, 2024

Conflicts with CS8914 Error: A global using directive cannot be used in a namespace declaration.

@bjornhellander
Copy link
Contributor

Could you provide an example so your situation is clear?

@daleao
Copy link
Author

daleao commented Apr 12, 2024

This causes SA1200:

global using static Foo.Bar;

namespace Foo;

using System;

class Bar {}

This causes CS8914:

namespace Foo;

global using static Foo.Bar;
using System;

class Bar {}

SA1200 is incorrectly applying to global using statements, which cannot be placed within namespace declarations.

@bjornhellander
Copy link
Contributor

Duplicate of #3404 (still open)

@sharwell
Copy link
Member

Duplicate of #3404

@sharwell sharwell marked this as a duplicate of #3404 Apr 15, 2024
@sharwell sharwell closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants