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

RCS1146 refactoring suggestion results in broken code #42

Closed
IanKemp opened this issue Feb 16, 2017 · 1 comment
Closed

RCS1146 refactoring suggestion results in broken code #42

IanKemp opened this issue Feb 16, 2017 · 1 comment
Assignees
Labels

Comments

@IanKemp
Copy link

IanKemp commented Feb 16, 2017

Given the following code, where Data is a class type with an IDictionary<> named Dictionary defined on it:

return data != null && data.Dictionary.TryGetValue(value, out result) ? result as T : null;

Roslynator 1.2.13 in VS 2017 RC flags this as RCS1146 and applies the following refactoring:

data?.Dictionary.TryGetValue(value, out result == true ? result as T : null

But this causes a syntax error due to the missing right parenthesis after out result, the correct code is:

data?.Dictionary.TryGetValue(value, out result) == true ? result as T : null
@josefpihrt josefpihrt added the Bug label Feb 16, 2017
@josefpihrt josefpihrt self-assigned this Feb 16, 2017
@josefpihrt
Copy link
Collaborator

Thanks for the report @IanKemp !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants