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
At the moment it is required to manually import the return type of contract calls for their AbiDecode impl to be available. Otherwise. we return a very misleading error message like
abi SomeAbi {
fn some_method() -> SomeType;
}
...
let abi = Abi(SomeAbi, ....);
abi.some_method();
...
error: Trait "AbiDecode" is not implemented for type "SomeType".
Which means one need to import it like
use SomeLib::SomeType;
The text was updated successfully, but these errors were encountered:
## Description
This PR fixes#5936.
To avoid the error, we are importing all impls for all types in the
contract return, but we are NOT binding the type name. That means that
the return type becomes usable (fields, methods and trait impls), but
one cannot instantiate the type. For that, the type still needs to be
imported manually.
## Checklist
- [ ] I have linked to any relevant issues.
- [ ] 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)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] 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).
- [ ] I have requested a review from the relevant team or maintainers.
At the moment it is required to manually import the return type of contract calls for their
AbiDecode
impl to be available. Otherwise. we return a very misleading error message likeWhich means one need to import it like
The text was updated successfully, but these errors were encountered: