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
avrabe added a commit that referenced this pull request Mar 18, 2026
fix: propagate resource type aliases in resource import map (#31)

fix: resolve instance alias arguments in propagate_outer_wiring

When a composed component uses alias export to create an instance alias,
propagate_outer_wiring now correctly resolves the alias to find the
source sub-component. Previously only direct Instance entries were mapped;
alias-created instances silently failed.

Changes instance_infos from Vec to HashMap keyed by absolute instance
index, and handles InstanceExportAlias by chasing the alias chain.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
avrabe added a commit that referenced this pull request Mar 18, 2026
* fix: resolve instance alias arguments in propagate_outer_wiring

When a composed component uses `alias export $inst "..." (instance)`,
propagate_outer_wiring now correctly resolves the alias to find the
source sub-component. Previously only direct Instance entries were
mapped; alias-created instances silently failed, causing import
resolution to fall back to "first non-self match" by name.

Changes instance_infos from Vec to HashMap keyed by absolute instance
index, and handles InstanceExportAlias by chasing the alias chain.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: resolve imported resource types in resource position lookup (#32)

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

fix: resolve instance alias arguments in propagate_outer_wiring

When a composed component uses alias export to create an instance alias,
propagate_outer_wiring now correctly resolves the alias to find the
source sub-component. Previously only direct Instance entries were mapped;
alias-created instances silently failed.

Changes instance_infos from Vec to HashMap keyed by absolute instance
index, and handles InstanceExportAlias by chasing the alias chain.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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