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

find_method_for_type improvements #6744

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

esdrubal
Copy link
Contributor

@esdrubal esdrubal commented Nov 20, 2024

Description

TraitMap::insert now verifies that type parameters trait constraints are satisfied before throwing a duplicate method error.

find_method_for_type was also changed, so it now checks that trait constraints are satisfied before returning the matched method.

Fixes #6381

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 added the compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen label Nov 20, 2024
@esdrubal esdrubal self-assigned this Nov 20, 2024
@esdrubal esdrubal force-pushed the esdrubal/find_method_for_type_improvements branch 2 times, most recently from 0f9283d to 6785778 Compare November 20, 2024 13:30
Copy link

codspeed-hq bot commented Nov 20, 2024

CodSpeed Performance Report

Merging #6744 will not alter performance

Comparing esdrubal/find_method_for_type_improvements (0cd4843) with master (d8854fa)

Summary

✅ 22 untouched benchmarks

@esdrubal esdrubal force-pushed the esdrubal/find_method_for_type_improvements branch 2 times, most recently from 35bd558 to 9a2c809 Compare November 26, 2024 11:28
@esdrubal esdrubal force-pushed the esdrubal/find_method_for_type_improvements branch from 5b58adc to bb025bf Compare January 16, 2025 10:12
@esdrubal esdrubal force-pushed the esdrubal/find_method_for_type_improvements branch from bb025bf to e50e270 Compare February 13, 2025 17:33
@esdrubal esdrubal marked this pull request as ready for review February 17, 2025 10:06
@esdrubal esdrubal requested a review from a team as a code owner February 17, 2025 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Trait Functions With the Same Name Get Disambiguated Arbitrarily
2 participants