Skip to content

do..while conditions are not type-checked #956

Closed

Description

@jruderman

The type checker ensures that "while" conditions are bools, but it does not do the same for "do..while" conditions.

fn main() { do {} while 1; }

Result:

Assertion failed: (getCondition()->getType()->isIntegerTy(1) && "May only branch on boolean predicates!"), function AssertOK, file Instructions.cpp, line 730.

Expected:

error: mismatched types: expected bool but found int

Activity

  1. added a commit that references this issue on Mar 7, 2023
  2. added 2 commits that reference this issue on Aug 21, 2026
  3. added a commit that references this issue on Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-system

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions