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

Using-declaration should not trigger RemoveUnusedValues #33464

Closed
jcouv opened this issue Feb 17, 2019 · 3 comments
Closed

Using-declaration should not trigger RemoveUnusedValues #33464

jcouv opened this issue Feb 17, 2019 · 3 comments
Assignees
Milestone

Comments

@jcouv
Copy link
Member

jcouv commented Feb 17, 2019

I suspect this is a compiler issue, as the AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer relies on the control flow graph to determine how variables are used.

image

image

FYI @mavasani

@jcouv jcouv added this to the 16.1 milestone Feb 17, 2019
@mavasani
Copy link
Contributor

Thanks @jcouv. This seems to be same as dotnet/csharplang#2235 (comment). Current IOperation tree and ControlFlowGraph have no special operation node for using declaration, it is just an Operation.None node wrapping the variable declaration. This leads to all CFG and IOperation clients that attempt to analyze reads and writes to see a variable declaration, whose underlying declared local is never referenced. I believe this issue will get fixed once we implement IOperation and CFG support for this feature.

@chsienki
Copy link
Contributor

We have an open issue on this #32100 which should fix once implemented.

@jcouv
Copy link
Member Author

jcouv commented Feb 19, 2019

Closed as dupe of #32100. Copied scenario details over there

mavasani added a commit to mavasani/roslyn that referenced this issue Jun 25, 2019
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

3 participants