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

failed autocast #41

Open
lenawanel opened this issue Jul 8, 2024 · 0 comments
Open

failed autocast #41

lenawanel opened this issue Jul 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@lenawanel
Copy link
Contributor

lenawanel commented Jul 8, 2024

Problem

the function

log2_u64 :: (n: u64) -> u64 {
    n := n;
    i := 0;
    while n != 0 {
        n = n << 1;
        i = i + 1;
    }
    i
}

will panic, saying that there is a mismatch between the operand types of an iadd.
manually casting the last 1 into a u64 removes the panic.

log2_u64 :: (n: u64) -> u64 {
    n := n;
    i := 0;
    while n != 0 {
        n = n << 1;
        i = i + 1 as u64;
    }
    i
}

Steps

No response

Notes

No response

Does this happen on the latest commit?

Yes

What targets are you seeing the problem on?

windows

@lenawanel lenawanel added the bug Something isn't working label Jul 8, 2024
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

No branches or pull requests

1 participant