-
Notifications
You must be signed in to change notification settings - Fork 509
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
SA1008 triggered by typle return types on a method (c# version 7) #2308
Comments
Hi, thanks for reporting this. StyleCop Analyzers is not fully C# 7 compatible yet at the moment unfortunately. We are tracking work for this in #2268 |
…thod (c# version 7) - Fixed
Fixed: |
Running into the same issue. Would be nice to drop a new beta sometime soon. |
I'm also running into it. I'm working around it by using correct spacing and then putting a SuppressMessage attribute above it.
VS 2017 suggests #pragma warning default SA1008 and #pragma warning restore SA1008 directives before and after the offending line. But I prefer SuppressMessage because it only takes a single line, and it contains the justification for why it's there (i.e., letting me know it's a temporary workaround). Once StyleCop.Analyzers is updated, I can search for and remove these SuppressMessage usages easily. |
Why do you think this is closed? I'm using v1.0.2 and getting this warning on this line of code (generated from Roslyn):
|
@gammafour It's closed because it was fixed in 1.1.0 Beta 2 😄 |
This is still a problem when deconstructing a tuple both in the var and the =
|
@c9952594 We have a test covering that case specifically. I suspect you are using an older version. Lines 772 to 812 in 7ae1443
|
Thank you. That was a fast reply! After looking I'm using .net core 3.1 so C# 8.0 (compiler version 3.7.0-6.20459.4). |
This test class is derived from SA1008CSharp7UnitTests, which is in turn derived from SA1008UnitTests. Each version can add new tests, but retains the tests for previous versions. |
Cheers. I can see that now so the latest version should work. Thank you very much. |
The following method triggers SA1008
the only way to avoid the rule is thus:
which is clearly incorrect.
if the return type is a tuple, then a space should be inserted.
The text was updated successfully, but these errors were encountered: