Skip to content

fix: propagate resource type aliases in resource import map#31

Merged
avrabe merged 2 commits intomainfrom
fix/resource-type-alias-propagation
Mar 16, 2026
Merged

fix: propagate resource type aliases in resource import map#31
avrabe merged 2 commits intomainfrom
fix/resource-type-alias-propagation

Conversation

@avrabe
Copy link
Contributor

@avrabe avrabe commented Mar 16, 2026

Summary

  • Adds Step 6 to build_resource_type_to_import that propagates resource map entries through ExportAlias type chains
  • When a function's param type references Borrow(24) but the canonical ResourceRep uses type 25 (where 24 is ExportAlias(25)), the map now includes both type IDs
  • Partially fixes resource detection in 3-component chains (resource_floats still needs fallback path work for bare exports)

Test plan

  • 73 tests pass, 0 failures
  • Pre-commit hooks pass

🤖 Generated with Claude Code

avrabe and others added 2 commits March 16, 2026 07:00
Component function parameters may reference a resource via an
ExportAlias (e.g., Borrow(24) where type 24 is ExportAlias(25)),
while canonical ResourceRep/ResourceNew entries use the target type.
The resource map now includes both alias source and target IDs so
resolve_resource_positions can find imports for either type ID.

This partially fixes resource detection in 3-component chains where
the intermediate component's type system has aliased resource types.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@avrabe avrabe merged commit ce0bafb into main Mar 16, 2026
3 checks passed
@avrabe avrabe deleted the fix/resource-type-alias-propagation branch March 16, 2026 07:13
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.

1 participant