c3c icon indicating copy to clipboard operation
c3c copied to clipboard

Assertion failed when casting argument to enum

Open cbuttner opened this issue 1 year ago • 1 comments

enum Mouse_Button {
  LEFT,
  RIGHT,
  MIDDLE,
}

fn void foo(Mouse_Button button) {
}

fn void main() {
  uint x = 1;
  foo((Mouse_Button)x);
}
Assertion failed: (be_value->type->canonical == type), function llvm_emit_parameter, file llvm_codegen_expr.c, line 5137.

On dev branch.

cbuttner avatar May 16 '24 12:05 cbuttner

Should work now.

lerno avatar May 16 '24 14:05 lerno

Looks fixed.

cbuttner avatar Jun 06 '24 20:06 cbuttner