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

Having same var at class level and inside function leads to error #2280

Closed
greenozon opened this issue Jan 21, 2021 · 4 comments
Closed

Having same var at class level and inside function leads to error #2280

greenozon opened this issue Jan 21, 2021 · 4 comments
Labels
Bug Decompiler The decompiler engine itself

Comments

@greenozon
Copy link

Input code

orig code:
image

ILSpy code:
image

as you see 2nd (rightmost) part is missing this.

Details

  • Product in use: ILSpy version 7.0.0.6297-preview2
@greenozon greenozon added Bug Decompiler The decompiler engine itself labels Jan 21, 2021
@siegfriedpammer
Copy link
Member

Can you provide the assembly? I could not reproduce this using a minimal sample. Thanks!

@greenozon
Copy link
Author

sent

@siegfriedpammer
Copy link
Member

This is related to #2267. If you decompile the project using at least C# 7.0, discard assignments are used and the code is compilable. There is one more bug in the DeclareVariables logic, which makes it generate a simple name without all the additional checks present in AssignVariableNames.

@greenozon
Copy link
Author

Thank you for you time/analsys and reply!
For some reason older C#5.0 is a must for that kind of stuff..
anyway, this is easy nut, so no big worries
Feel free to close this issue

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Decompiler The decompiler engine itself
Projects
None yet
Development

No branches or pull requests

2 participants