Skip to content

Improve generation of not equals check#3425

Merged
siegfriedpammer merged 2 commits intoicsharpcode:masterfrom
ElektroKill:fix/issue3423
Mar 22, 2025
Merged

Improve generation of not equals check#3425
siegfriedpammer merged 2 commits intoicsharpcode:masterfrom
ElektroKill:fix/issue3423

Conversation

@ElektroKill
Copy link
Copy Markdown
Contributor

Link to issue(s) this covers:
fixes #3423

Problem

The decompiler would use 0 for the != 0 check even if the type was an enum.

Solution

  • Adjust the code to use ExpressionBuilder.ConvertConstantValue to generate the expression for the 0 constant
  • A pretty test was added to cover the issue

@siegfriedpammer
Copy link
Copy Markdown
Member

Thank you very much for your contribution!

@siegfriedpammer siegfriedpammer merged commit 4ef3581 into icsharpcode:master Mar 22, 2025
5 checks passed
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

Successfully merging this pull request may close these issues.

Enum fails to resolve in != 0 condition

2 participants