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 replace_decls issue with nested and multiple types. #4889

Merged
merged 4 commits into from
Aug 2, 2023

Conversation

esdrubal
Copy link
Contributor

@esdrubal esdrubal commented Jul 31, 2023

Description

When a single method uses multiple trait implementation errors are thrown by the compiler similar issue occurs when a method requires a trait implementation and then calls another method that requires another implementation of the same trait.

This PR fixes both issues by filtering traits to be replaced by the arguments type used and trait method self type, and by gathering decl mapping of nested methods.

Fixes #4852

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 self-assigned this Jul 31, 2023
@esdrubal esdrubal 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 Jul 31, 2023
@esdrubal esdrubal force-pushed the esdrubal/4852_fix_replace_decls branch from 27a84cc to 75c979a Compare July 31, 2023 14:46
@esdrubal esdrubal requested a review from a team July 31, 2023 15:24
xunilrj
xunilrj previously approved these changes Aug 2, 2023
@anton-trunov
Copy link
Contributor

Looks like there are some merge conflicts to be fixed

When a single method uses multiple trait implementation errors are thrown
by the compiler similar issue occurs when a method requires a trait implementation
and then calls another method that requires another implementaion of the same trait.

This PR fixes both issues by filtering traits to be replaced by the arguments
type used and trait method self type, and by gathering decl mapping of nested methods.

Fixes #4852
@esdrubal esdrubal force-pushed the esdrubal/4852_fix_replace_decls branch from 1763dab to 05f3b42 Compare August 2, 2023 10:13
@esdrubal esdrubal requested a review from a team August 2, 2023 16:06
@IGI-111 IGI-111 merged commit 1799db8 into master Aug 2, 2023
@IGI-111 IGI-111 deleted the esdrubal/4852_fix_replace_decls branch August 2, 2023 16:42
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compile errors with generic traits used with different types.
4 participants