Closed hitchh1k3r closed 1 month ago
I was trying to expose multiple bit_fields in one type.
Odin: dev-2024-06:a0b1b8d1c OS: Windows 10 Professional (version: 22H2), build 19045.4412 CPU: Intel(R) Core(TM) i7-4771 CPU @ 3.50GHz RAM: 16311 MiB Backend: LLVM 17.0.1
The compiler should not crash.
The compiler crashes with:
[...]\Odin\src\check_expr.cpp(8870): Panic: invalid type: bit_field u8 {feild: u8 | 8 }
The compiler crashes when there is a struct literal assigning a value of an exposed (using) bit_field.
Here is a minimal reproduction:
package main CompositeBitField :: struct { using _ : bit_field u8 { feild : u8 | 8, }, } main :: proc() { var := CompositeBitField{ feild = 1 } }
Interestingly if the struct literal is written: CompositeBitField{ { feild = 1 } } the compiler does not crash.
CompositeBitField{ { feild = 1 } }
Context
I was trying to expose multiple bit_fields in one type.
Odin: dev-2024-06:a0b1b8d1c OS: Windows 10 Professional (version: 22H2), build 19045.4412 CPU: Intel(R) Core(TM) i7-4771 CPU @ 3.50GHz RAM: 16311 MiB Backend: LLVM 17.0.1
Expected Behavior
The compiler should not crash.
Current Behavior
The compiler crashes with:
Failure Information
The compiler crashes when there is a struct literal assigning a value of an exposed (using) bit_field.
Here is a minimal reproduction:
Interestingly if the struct literal is written:
CompositeBitField{ { feild = 1 } }
the compiler does not crash.