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

CC0001 wrong suggestion #1014

Open
GeorgeAlexandria opened this issue Dec 11, 2018 · 0 comments
Open

CC0001 wrong suggestion #1014

GeorgeAlexandria opened this issue Dec 11, 2018 · 0 comments

Comments

@GeorgeAlexandria
Copy link

Code Cracker (CC) suggests a wrong applying for "use var instead of":

var objects = new Dictionary<int, object>();

object currentValue = objects.TryGetValue(5, out currentValue)
    ? currentValue
    : null;

After applying suggestion CC generates code with var that contains compile time error CS0841:

...
var currentValue = objects.TryGetValue(5, out currentValue)
    ? currentValue
    : null;

In this case I assume that CC doesn't suggest anything (CC0001) for currentValue.

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

1 participant