E3030

E3030 — An operator applied to operand types it is not defined on — % on a shaped tensor or on a bool. Refused here because the alternative is worse in both directions: the flat emitter would decline and fall back to a path that cannot lower it either, and an i1 operand would reach arith.remsi and verify.

What the compiler reports

E3030 … at 6:17 … `!` takes a bool or an integer, got f32

The fragments the test suite holds the compiler to. An ellipsis marks text the test does not constrain; the emitted message also carries a source location.

A program that triggers it

fn main() -> i32 {
  let f : f32 = 1.5;
  let g : f32 = !f;
  return 0;
}

// A float has no bitwise complement, and Rust has no `!` on one. It used to type as a `bool`.

From tests/frontend/fail/not_on_a_float.vx, which asserts this diagnostic on every commit.

Related