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

Clarify the when to use var coding guideline #3294

Merged
merged 2 commits into from
Mar 16, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/coding-guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ For example the following are correct:
string fruit = null; // can't use "var" because the type isn't known (though you could do (string)null, don't!)
const string expectedName = "name"; // can't use "var" with const
FruitFlavor flavor = fruit.GetFlavor();
var nugetVersion = NuGetVersion.Parse("1.0.0");
var solutionManager = ComponentModel.GetService<ISolutionManager>();
nkolev92 marked this conversation as resolved.
Show resolved Hide resolved
```

The following are incorrect:
Expand Down