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

Fixes error while using From trait that returns a tuple. #5470

Merged
merged 4 commits into from
Jan 23, 2024

Conversation

esdrubal
Copy link
Contributor

@esdrubal esdrubal commented Jan 15, 2024

Description

Instead of Trait "MyFrom<u256>" is not implemented for type "U". We now get Trait "MyFrom<u256>" is not implemented for type "(_, _, _, _)".

The error is followed by:
Cannot infer type for type parameter "_". Insufficient type information provided. Try annotating its type.

While Rust compiler is able to inference the type in this situation it is non trivial to do it properly hence for now we should probably keep asking for the type to be annotated and create an issue for it.

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).
  • 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.
  • I have requested a review from the relevant team or maintainers.

@esdrubal esdrubal force-pushed the esdrubal/5299_from_returning_tuple branch 4 times, most recently from 99d9837 to 8eb448f Compare January 16, 2024 11:46
@esdrubal esdrubal self-assigned this Jan 16, 2024
@esdrubal esdrubal force-pushed the esdrubal/5299_from_returning_tuple branch from 8eb448f to 832d179 Compare January 17, 2024 11:55
Instead of `Trait "MyFrom<u256>" is not implemented for type "U".`
We now get `Trait "MyFrom<u256>" is not implemented for type "(_, _, _, _)".`

The error is followed by:
`Cannot infer type for type parameter "_". Insufficient type information provided. Try annotating its type.`

While Rust compiler is able to inference the type in this situation
it is non trivial to do it properly hence we should probably keep asking
for the type to be annotated.
@esdrubal esdrubal requested a review from a team January 22, 2024 14:56
@esdrubal esdrubal marked this pull request as ready for review January 22, 2024 14:56
@IGI-111 IGI-111 requested a review from a team January 23, 2024 06:24
@tritao tritao enabled auto-merge (squash) January 23, 2024 11:05
@tritao tritao merged commit c43b57f into master Jan 23, 2024
33 checks passed
@tritao tritao deleted the esdrubal/5299_from_returning_tuple branch January 23, 2024 11:57
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 this pull request may close these issues.

4 participants