Skip to content

Support equality and inequality between bool operands #714

Closed

Description

@LunaStev

Motivation

Comparing two boolean variables with == or != is rejected by semantic validation. For example, a != b with two bool operands reports binary operator NotEqual is not supported for bool and bool; this was reproduced at O0/O2. Existing regressions in tests/cases/shared/test129.wave cast boolean results to integers to compare them.

Start at infer_binary_type in front/parser/src/verification.rs and comparison lowering in llvm/src/expression/rvalue/binary.rs.

Scope

Accept bool == bool and bool != bool, returning bool. Preserve numeric comparison and cast behavior. Boolean ordering, arithmetic, and mixed bool/integer comparisons are outside this task.

Completion criteria

  • Both operators accept boolean operands and produce the correct result for all four true/false combinations.
  • Cover variables, function results, aliases, and grouped expressions.
  • Evaluate each operand exactly once.
  • Add frontend acceptance tests and a runtime truth table that agrees at O0/O2.

Difficulty: easy.

Activity

  1. added
    enhancement
    good first issue
    needs testing
    on Sep 24, 2026
  2. changed the title [-][Proposal]: Support equality and inequality between bool operands[/-] [+]Support equality and inequality between bool operands[/+] on Sep 24, 2026
  3. garv-sanveria commented on Sep 24, 2026

    @garv-sanveria

    Hello, dev, can you please assign me this issue.

  4. LunaStev commented on Sep 24, 2026

    @LunaStev
    MemberAuthor

    Hello, dev, can you please assign me this issue.

    Yes thanks

  5. added a commit that references this issue on Oct 30, 2026
    7cb2c87
  6. added a commit that references this issue on Nov 13, 2026
    cac5272
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementgood first issueneeds testing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions