-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
usize/isize vector comparison within function #4334
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
Comments
Maybe it has something to do with the fact that |
The code that lowers the comparison between two vectors uses |
@FireFox317 I tried with |
You should check first with @andrewrk if that's supposed to work. Check out |
Yes that should coerce. As long as each of the element values coerce and the length matches then the whole vector should. A workaround is |
Only valid when the number of elements match and the types are compatible. Fixes ziglang#4334
on 30 Jan 2020 with zig version 0.5.0+7ebc624a1 pulled and built from master last night.
In the following code, two
@Vector(4, usize)
are compared with == in the test scope with no problem. However if the same comparison is made within a struct fn, the == comparison results in:error: expected type '@Vector(4, u64)', found '@Vector(4, usize)'
It appears that the lhs
@Vector(4, usize)
is being converted to@Vector(4, u64)
when it gets passed into a function. This error is not observed with u64 vector type.The text was updated successfully, but these errors were encountered: