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

SA1135 throws exception for type keywords #3882

Open
rsking opened this issue Aug 5, 2024 · 5 comments · May be fixed by #3883
Open

SA1135 throws exception for type keywords #3882

rsking opened this issue Aug 5, 2024 · 5 comments · May be fixed by #3883

Comments

@rsking
Copy link

rsking commented Aug 5, 2024

When adding a type alias using a keyword, the analyzer throws AD0001, when inside a namespace

namespace ClassLibrary
{
    using Example = string;
}

and also when using value tuple values

namespace ClassLibrary
{
    using Example = (System.Collections.IList, int);
}
@rsking
Copy link
Author

rsking commented Aug 5, 2024

This does not occur when outside a namespace, but this violates SA1200

@bjornhellander
Copy link
Contributor

What version are you using?

@bjornhellander
Copy link
Contributor

Sorry! I asked because I couldn't reproduce it, but I see it now using the latest beta.

@bjornhellander
Copy link
Contributor

I will have a look.

bjornhellander added a commit to bjornhellander/StyleCopAnalyzers that referenced this issue Aug 5, 2024
bjornhellander added a commit to bjornhellander/StyleCopAnalyzers that referenced this issue Aug 5, 2024
bjornhellander added a commit to bjornhellander/StyleCopAnalyzers that referenced this issue Aug 6, 2024
@runehalfdan
Copy link

We've also encountered this bug, using StyleCop.Analyzers.Unstable 1.2.0.556 (can't use Beta for reasons)

namespace Library;
using Foo = (int A, string B);

Workaround (but names are lost):
using Foo = System.ValueTuple<int, string>;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants