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 inconsistent regarding use of aliases #3884

Open
bjornhellander opened this issue Aug 6, 2024 · 2 comments
Open

SA1135 inconsistent regarding use of aliases #3884

bjornhellander opened this issue Aug 6, 2024 · 2 comments

Comments

@bjornhellander
Copy link
Contributor

Consider the following code:

using Tasks = System.Threading.Tasks;

namespace TestStuff
{
    using T1 = Tasks.Task; // No warning here
    using T2 = System.ValueTuple<Tasks.Task, int>; // Warning here
}

SA1135 seems to allow the use of aliases in using directives. Since there is no warning for the use of Tasks.Task when defining T1, I would not expect a warning when defining T2 either.

Tested using version 1.2.0-beta.556

@sharwell
Copy link
Member

What happens if you use Tasks::Task instead?

@bjornhellander
Copy link
Contributor Author

No warnings when using Tasks::Task instead in the original example.

Not in this example either, which also seems weird:

using System;
using Tasks = System.Threading.Tasks;

namespace TestStuff
{
    using T2 = ValueTuple<Tasks::Task, int>; // No warning here because of ValueType not being fully qualified
}

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

2 participants