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

Detect when a test expression is statically true or false but not using the literal values. #38

Open
Lokathor opened this issue Dec 27, 2024 · 0 comments
Labels

Comments

@Lokathor
Copy link
Owner

It would be nice to have a warning or something if a test expression is statically simplified to true or false, but they weren't written using true or false literals. This usually means that there was a typo or something.

// not a warning, they wrote true explicitly
if true {
  do_thing()
}

// warn, because did you mean to test some other register?
if a == a {
  do_thing()
}
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

1 participant