Skip to content

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

@Lokathor

Description

@Lokathor

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()
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions