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

Papercut with state variable references #1459

Open
rohitkulshreshtha opened this issue Sep 20, 2024 · 0 comments
Open

Papercut with state variable references #1459

rohitkulshreshtha opened this issue Sep 20, 2024 · 0 comments
Labels
hydroflow syntax Hydroflow's custom surface syntax P2 Medium priority

Comments

@rohitkulshreshtha
Copy link
Contributor

It isn't possible to do something like this:

let all_data: &HashMap<...> = (&#namespaces).as_reveal_ref();

It results in the error message:

150 |                 let all_data: &HashMap<Namespace, TableMap<RowValue<Clock>>> = (&#namespaces).as_reveal_ref();
    |                                                                                 ^^^^^^^^^^^                - temporary value is freed at the end of this statement
    |                                                                                 |
    |                                                                                 creates a temporary value which is freed while still in use

The current workaround is

let namespaces = &#namespaces;
let all_data: &HashMap<Namespace, TableMap<RowValue<Clock>>> = namespaces.as_reveal_ref();

A fix would be very nice to have.

@jhellerstein jhellerstein added hydroflow syntax Hydroflow's custom surface syntax P2 Medium priority labels Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hydroflow syntax Hydroflow's custom surface syntax P2 Medium priority
Projects
None yet
Development

No branches or pull requests

2 participants