-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Trait constraints issues with Eq
for custom types
#3326
Labels
bug
Something isn't working
compiler: frontend
Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
P: critical
Should be looked at before anything else
Comments
mohammadfawaz
added
bug
Something isn't working
P: critical
Should be looked at before anything else
compiler: frontend
Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
labels
Nov 8, 2022
Seems the same issue as #3351 When I disable inlining it is also using an empty implementation of eq.
|
This was referenced Nov 17, 2022
esdrubal
added a commit
to esdrubal/sway
that referenced
this issue
Nov 18, 2022
When constraint is used in generic functions the trait name does not contain any prefixes this was causing get_methods_for_type_and_trait_name to return no methods to be used. Closes FuelLabs#3326
esdrubal
added a commit
to esdrubal/sway
that referenced
this issue
Nov 18, 2022
When constraint is used in generic functions the trait name does not contain any prefixes this was causing get_methods_for_type_and_trait_name to return no methods to be used. Closes FuelLabs#3326
esdrubal
added a commit
to esdrubal/sway
that referenced
this issue
Nov 24, 2022
When constraint is used in generic functions the trait name does not contain any prefixes this was causing get_methods_for_type_and_trait_name to return no methods to be used. Closes FuelLabs#3326
tritao
pushed a commit
that referenced
this issue
Dec 8, 2022
The issue was caused by constraints used in generic functions having trait name that does not contain any prefixes. This was causing `get_methods_for_type_and_trait_name` to return no methods to be used. This PR changes `get_methods_for_type_and_trait_name` so when a `trait_name` without prefixes is provided it still tries to match using the suffixes. Closes #3326 Co-authored-by: Mohammad Fawaz <mohammadfawaz89@gmail.com> Co-authored-by: Emily Herbert <17410721+emilyaherbert@users.noreply.github.com>
sdankel
pushed a commit
that referenced
this issue
Dec 14, 2022
The issue was caused by constraints used in generic functions having trait name that does not contain any prefixes. This was causing `get_methods_for_type_and_trait_name` to return no methods to be used. This PR changes `get_methods_for_type_and_trait_name` so when a `trait_name` without prefixes is provided it still tries to match using the suffixes. Closes #3326 Co-authored-by: Mohammad Fawaz <mohammadfawaz89@gmail.com> Co-authored-by: Emily Herbert <17410721+emilyaherbert@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Something isn't working
compiler: frontend
Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
P: critical
Should be looked at before anything else
Code:
This compiles but reverts. When I change
test_none_ok_or(true, Error::BoolError(true));
totest_none_ok_or(true, Error::BoolError(0));
for example, the test does not revert.In
test_none_ok_or
, if I logdefault
ande
, I get the same value so the issue is with the comparisondefault == e
which evaluates tofalse
for some reason, even thoughEq
is implemented correctly. In fact, even if I change the implementation ofEq
forError
to just bereturn true
, the test still reverts 🤔In fact, I don't think we're using the custom definition of
Eq
forError
at all! If I log some value ineq
, I don't get anyLog
receipts backThe text was updated successfully, but these errors were encountered: