cairo
cairo copied to clipboard
bug: creating an array of structs with no fields
Bug Report
Cairo version:
2.4.3
Also added a test function to corelib and run ./scripts/cairo_test.sh
- the issue still occurs
Current behaviour:
Cairo compilation fails when creating an array of structs with no fields
Related code:
With src/lib.cairo
content:
#[derive(Drop)]
struct Y {}
fn func() {
let y = Y{};
array![y];
}
compilation with scarb build
fails with
thread 'main' panicked at /Users/piotrmagiera/.cargo/git/checkouts/cairo-f086c7e6d4098a68/1c02dc5/crates/cairo-lang-sierra-generator/src/db.rs:194:6:
Got failure while specializing type.: TypeSpecialization { type_id: GenericTypeId("Array"), error: UnsupportedGenericArg }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
This should cause a compilation error instead of a panic.
Any particular reason you need it to actually compile specifically?
@orizi I don't really need it, just accidentally encountered this panic lately
Good - was just making sure - diagnostic will be added.