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

assert_eq always pass for U256 #4989

Closed
xunilrj opened this issue Aug 21, 2023 · 0 comments · Fixed by #5054
Closed

assert_eq always pass for U256 #4989

xunilrj opened this issue Aug 21, 2023 · 0 comments · Fixed by #5054
Assignees

Comments

@xunilrj
Copy link
Contributor

xunilrj commented Aug 21, 2023

Doing a quick test here I found that this test pass.

#[test]
fn test_pow_u256() {
    let five = U256::from((0, 0, 0, 5));
    let two = U256::from((0, 0, 0, 2));
    assert_eq(five, two);
}

Maybe it is the same problem as #4868 because I am seeing fn eq of U256 body empty at compile_fn. This is returning a const bool undef and wreaking havoc from there.

Originally posted by @xunilrj in #4900 (comment)

@xunilrj xunilrj mentioned this issue Aug 21, 2023
7 tasks
@esdrubal esdrubal self-assigned this Aug 21, 2023
esdrubal added a commit that referenced this issue Aug 30, 2023
## Description

The issue was occurring because `get_items_for_type_and_trait_name` was
comparing an absolute call path to an external relative call path, when
the second should also be absolute.

`compile_fn` now checks if method is trait dummy.

These changes should avoid the silent failures where a dummy method is
used,
instead of the proper implementation.

Closes #4989

## Checklist

- [x] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [x] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [x] I have added tests that prove my fix is effective or that my
feature works.
- [x] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [x] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [x] I have requested a review from the relevant team or maintainers.
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

Successfully merging a pull request may close this issue.

2 participants