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

the type in parentheses is parsed as a tuple #1937

Closed
ghost opened this issue Jul 15, 2023 · 1 comment
Closed

the type in parentheses is parsed as a tuple #1937

ghost opened this issue Jul 15, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Jul 15, 2023

Aim

fn main() {
    let s = 1 as (u32) < 2;
}

Expected Behavior

Compiled from source

Bug

error: Only integer and Field types may be casted to
  ┌─ src/main.nr:2:13
  │
2 │     let s = 1 as (u32) < 2;
  │             ----------

Error: Aborting due to 1 previous error

Location:
    crates/nargo_cli/src/cli/mod.rs:71:5

To Reproduce

Installation Method

None

Nargo Version

No response

Additional Context

crates/noirc_frontend/src/hir/type_check/expr.rs:341] (&from, &to) = (
    PolymorphicInteger(
        Maybe(
            TypeVariableId(
                27934,
            ),
            Shared(
                RefCell {
                    value: None,
                },
            ),
        ),
        Shared(
            RefCell {
                value: Unbound(
                    TypeVariableId(
                        27933,
                    ),
                ),
            },
        ),
    ),
    Tuple(
        [
            Integer(
                No(
                    None,
                ),
                Unsigned,
                32,
            ),
        ],
    ),
)

Would you like to submit a PR for this Issue?

No

Support Needs

No response

@ghost ghost added the bug Something isn't working label Jul 15, 2023
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jul 15, 2023
@jfecher
Copy link
Contributor

jfecher commented Jul 18, 2023

Resolved by #1960

@jfecher jfecher closed this as completed Jul 18, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in Noir Jul 18, 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
Archived in project
Development

No branches or pull requests

1 participant