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

type mismatched (E2595) when using mul on a list and an int #122

Open
setop opened this issue Jan 15, 2025 · 0 comments
Open

type mismatched (E2595) when using mul on a list and an int #122

setop opened this issue Jan 15, 2025 · 0 comments

Comments

@setop
Copy link

setop commented Jan 15, 2025

Describe the bug

Building a list by multiplying a list by an expression reduced as an int give a type mismatched (E2595)

When the expression is simply an int, there is no error.

Reproducible Code

L1 = [0] * 3          
L2 = [0] * len(L1)

Expected behavior

No errors, this is legit code.

Screenshots

In helix:

    1  L1 = [0] * 3                                                                                                   
●   2  L2 = [0] * len(L1)                                        the type of `*`::rhs (the 2nd argument) is mismatched
    ~                                                                                               expected: {_: Nat}
                                                                                                        but found: Nat
                                                                                                               (E2595)

even when trying to extract the expression into a variable:

    1  L1 = [0] * 3                                                                                                   
    2  N = len(L1)                                               the type of `*`::rhs (the 2nd argument) is mismatched
●   3  L2 = [0] * N                                                                                 expected: {_: Nat}
    4  L3 = [1] * 6                                 but found: {%v_global_4170: Failure | %v_global_4170 == <failure>}
    ~                                                                                                          (E2595)

Environment

  • OS : Linux Debian 12
  • Version : 0.0.76

Additional context

Great improvement from 0.0.70 to 0.0.76, btw ; thanks for all the work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant