-
-
Notifications
You must be signed in to change notification settings - Fork 793
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
array comparison is not allowed #2618
Comments
a full implementation of this would have to be a mutual iteration check, (made easier with |
e.g. via ast-substitution, do: t: bool = True
for a, b in zip(x, y):
t = t and a == b edit: maybe a case for t: bool = x == y # = reduce(lambda t, (a, b): t and a == b, zip(x, y), True) |
I think we would use the same strategy as we use for bytes, i.e. hash both inputs and compare the hashes. I'm not sure we really want to get into e.g. |
Depends on context, but this might work nicely. Also as an optimization, just check
Not even sure what this would mean lol |
this behavior was blocked in #2633, so I'm demoting this issue from bug to enhancement |
Version Information
vyper --version
): df54e00What's your issue about?
arrays are syntactically allowed to compare operators, but only the first element gets compared.
here's an example:
this generates the following IR
How can it be fixed?
Probably just block the behavior at the semantic level
The text was updated successfully, but these errors were encountered: