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

Change for issue #373. Multiple declaration with implicit type. #385

Conversation

BrianFreemanAtlanta
Copy link
Contributor

Link to issue(s) this covers
closes issue #373 .

Problem

Current conversion uses var for declarations with multiple variables but C# issues message that multiple declaration requires an explicit type.

Solution

I made a change in SplitVariableDeclarations to requireExplicitType for the first declaration when multiple declarations are involved.

Added test DeclarationStatementTwoVariables to confirm correction. Modified two affected tests after confirming they conform to the same pattern. Changed ForWithBlock and ForWithSingleStatement

  • At least one test covering the code changed
  • All tests pass

@GrahamTheCoder GrahamTheCoder merged commit 2d5a509 into icsharpcode:master Oct 5, 2019
@GrahamTheCoder
Copy link
Member

Looks good to me! I've just moved the logic to be calculated before the loop and thus not depend on span start. I couldn't think of a case where we'd want it to be different for each declarator, and no tests failed by doing so. If there was a particular case you were thinking of, do let me know.

Thanks again for your contribution. Have a look at the "good first issue"s if you're interested in doing more:
https://github.com/icsharpcode/CodeConverter/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22

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

Successfully merging this pull request may close these issues.

2 participants