c3c
c3c copied to clipboard
Compiler assert: Casting bitstruct to short/char
bitstruct Foo : ushort {
bool bar;
}
fn void main() {
ushort foo = (ushort)((Foo) {.bar}) & 1;
}
⚠️ The compiler encountered an unexpected error: "Violated assert: expr->const_expr.const_kind == CONST_INTEGER || expr->const_expr.const_kind == CONST_ENUM".
This should be fixed now, please try it out.
Is this working?
I tried this and it asserts on 0.7.2 but is fixed in 0.7.3, and seems to works like you'd expect.