You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A type can implement two different traits that define the same function. A UFCS-style call syntax is then
needed to explicitly disambiguate because calls like x.foo() will raise a compiler error.
Such an error, however, is not raised if the type is wrapped in a generic struct that has two generic impl
blocks, one bound to the first trait, one to the other, as in the following code snippet:
The compilation succeeds and the execution output shows that it is the first generic impl (the one bound
to Cat) that prevails.
To the contrary, Rust refuses the compilation of an analogous snippet.
The text was updated successfully, but these errors were encountered:
While inserting trait implementations into the trait map we now compare
the implementing type_id without matching UnkownGenerics trait
constraints. Matching the trait constraints was causing a missing error.
Fixes#6381
## Description
While inserting trait implementations into the trait map we now compare
the implementing type_id without matching UnkownGenerics trait
constraints. Matching the trait constraints was causing a missing error.
Fixes#6381
## Checklist
- [ ] I have linked to any relevant issues.
- [x] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [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.
Co-authored-by: IGI-111 <[email protected]>
CS-FSSA-015
A type can implement two different traits that define the same function. A UFCS-style call syntax is then
needed to explicitly disambiguate because calls like x.foo() will raise a compiler error.
Such an error, however, is not raised if the type is wrapped in a generic struct that has two generic impl
blocks, one bound to the first trait, one to the other, as in the following code snippet:
The compilation succeeds and the execution output shows that it is the first generic impl (the one bound
to Cat) that prevails.
To the contrary, Rust refuses the compilation of an analogous snippet.
The text was updated successfully, but these errors were encountered: