Skip to content

Conversation

tritao
Copy link
Contributor

@tritao tritao commented Aug 25, 2025

Description

This updates TraitMap::filter_by_type_item_import to scan the trait map for indirect trait impls with generic types matching any of imported item types.

This makes sure cases like an impl of a StorageKey<T> work, when importing T from a given scope.

Fixes #7330.

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.

@tritao tritao self-assigned this Aug 25, 2025
@tritao tritao added the compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen label Aug 25, 2025
Copy link

codspeed-hq bot commented Aug 25, 2025

CodSpeed Performance Report

Merging #7347 will not alter performance

Comparing tritao:fix-import-broken (070e779) with master (65d6520)

Summary

✅ 25 untouched benchmarks

@tritao tritao force-pushed the fix-import-broken branch from fe42aac to 8bcd7f2 Compare August 28, 2025 10:36
@tritao tritao force-pushed the fix-import-broken branch from 8bcd7f2 to 8b90123 Compare August 28, 2025 10:37
@tritao tritao marked this pull request as ready for review August 28, 2025 11:19
@tritao tritao requested a review from a team as a code owner August 28, 2025 11:19
@tritao tritao force-pushed the fix-import-broken branch from 8b90123 to 3b55544 Compare August 28, 2025 11:19
@IGI-111 IGI-111 enabled auto-merge (squash) September 8, 2025 06:15
This updates `TraitMap::filter_by_type_item_import` to scan the trait
map for indirect trait impls with generic types matching any of imported
item types.

This makes sure cases like an impl of a `StorageKey<T>` work, when
importing T from a given scope.

Fixes FuelLabs#7330
@IGI-111 IGI-111 merged commit 6981d3d into FuelLabs:master Sep 8, 2025
41 checks passed
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.

Some implementations still require imports
3 participants