Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: non-copyable types are disabled from dictionaries values #4339

Closed
enitrat opened this issue Nov 1, 2023 · 1 comment · Fixed by #4340
Closed

bug: non-copyable types are disabled from dictionaries values #4339

enitrat opened this issue Nov 1, 2023 · 1 comment · Fixed by #4340
Labels
bug Something isn't working

Comments

@enitrat
Copy link
Contributor

enitrat commented Nov 1, 2023

Bug Report

Cairo version:
2.3.1

Current behavior:
Running the following code compiles fine, but running it results in this error:

   Compiling dict_array v0.1.0 (/Users/msaug/cairo_projects/dict_array/Scarb.toml)
thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cairo-lang-sierra-generator-2.3.0/src/db.rs:194:6:
Got failure while specializing type.: TypeSpecialization { type_id: GenericTypeId("Felt252Dict"), error: UnsupportedGenericArg }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Error: `scarb metadata` exited with error

Expected behavior:
The code compiles and runs finefine .

Steps to reproduce:

Related code:

use dict::{felt252_dict_entry_get, felt252_dict_entry_finalize};
fn main() -> felt252 {
    let mut dict: Felt252Dict<Nullable<Array<felt252>>> = Default::default();
    let arr = array![0x1, 0x2, 0x3];

    dict.insert(1, NullableTrait::new(arr));
    let (entry, value) = dict.entry(1);
    let mut val = value.deref();
    *val[0]
}

Other information:

@enitrat enitrat added the bug Something isn't working label Nov 1, 2023
@orizi orizi linked a pull request Nov 1, 2023 that will close this issue
@orizi
Copy link
Collaborator

orizi commented Nov 7, 2023

Solved on 2.4.0-rc0 - will be merged into main upon starknet mainnet release.

@orizi orizi closed this as completed Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants