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

as_field and from_field are not implemented in the interpreter #6828

Closed
asterite opened this issue Dec 16, 2024 · 0 comments · Fixed by #6829
Closed

as_field and from_field are not implemented in the interpreter #6828

asterite opened this issue Dec 16, 2024 · 0 comments · Fixed by #6829
Assignees
Labels
bug Something isn't working

Comments

@asterite
Copy link
Collaborator

Aim

This code:

pub global x: U128 = U128::from_integer(1);

fn main() {}

and this code:

pub global x: Field = U128::from_hex("0x0").to_integer();

fn main() {}

Expected Behavior

The above snippets should compile.

Bug

They fail respectively with these errors:

error: Comptime evaluation for builtin function 'as_field' is currently unimplemented
    ┌─ std/uint128.nr:143:17
    │
143 │         let f = crate::as_field(i);
    │                 ------------------

and

error: Comptime evaluation for builtin function 'as_field' is currently unimplemented
    ┌─ std/lib.nr:102:23
    │
102 │     crate::from_field(crate::as_field(x) + crate::as_field(y))
    │                       ------------------

This is because we now interpret globals.

To Reproduce

Workaround

None

Workaround Description

No response

Additional Context

No response

Project Impact

None

Blocker Context

No response

Nargo Version

No response

NoirJS Version

No response

Proving Backend Tooling & Version

No response

Would you like to submit a PR for this Issue?

None

Support Needs

No response

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
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant