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

SA1009 and C# 7 Tuples #2267

Closed
ghost opened this issue Jan 5, 2017 · 3 comments
Closed

SA1009 and C# 7 Tuples #2267

ghost opened this issue Jan 5, 2017 · 3 comments
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Jan 5, 2017

SA1009 is indicated at the closing brace of tuples inside generics. For example for the following function definition:

internal override async Task<(bool doReplace, string replacement)> TryCorrectPostBody(string postBodyValue)

In my opinion, this use case should be allowed and no SA1009 generated.

@sharwell
Copy link
Member

sharwell commented Jan 5, 2017

Yeah, we need to evaluate all new C# 7 syntax in the context of current rules.

@vweijsters @pdelvo Any thoughts on how to start testing these scenarios? We could create a unit test project that references a version of Roslyn that understands C# 7, or we could use a different version of Roslyn for the main library and the unit tests. Or perhaps we create a new "v2.0" branch where we require such a version of Roslyn, and don't accommodate these features in the 1.x branch at all?

@sharwell
Copy link
Member

sharwell commented Jan 5, 2017

See also #2268

@vweijsters
Copy link
Contributor

I would be in favor of having a branch, as we will probably have to do some major changes to the analyzers, the code fixes, and the unit tests. I haven't checked yet, but I assume that the new language constructs will have new syntax classes as well, and these will not be present in older versions.

I personally am not a big fan of having a lot of #if directives in code, which would probably be needed to accommodate both versions of Roslyn from a single code base.

We may need to maintain two versions of the project in parallel for (quite) some time, I'm not convinced yet that we can merge the code bases for these, but that could change once we've done the work for v2.0.

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

2 participants