Skip to content

Fix Explainer.md/Binary.md definition of outer aliases#657

Merged
lukewagner merged 2 commits into
mainfrom
fix-outer-alias
May 27, 2026
Merged

Fix Explainer.md/Binary.md definition of outer aliases#657
lukewagner merged 2 commits into
mainfrom
fix-outer-alias

Conversation

@lukewagner
Copy link
Copy Markdown
Member

This PR intends to address the first issue in this comment, bringing the spec in line with the implementation (and logic).

(cc @zherczeg and @alexcrichton)

@zherczeg
Copy link
Copy Markdown

Thank you for the doc update!

@zherczeg
Copy link
Copy Markdown

Btw, in some cases the explainer refers to "transitive" dependencies. In this case, not just resource types, but types which transitively refer to resources (e.g. a borrow) should be disallowed as well (if I understand this correctly).

E,.g.

   (type $IT (instance (export "sub-res" (type (sub resource)))))
   (import "any:any/anything@1.0.0" (instance $I (type $IT)))
   (alias export $I "sub-res" (type $SUB-RES))
   (type $BORROW (borrow $SUB-RES))
   (component $C (alias outer 1 $BORROW (type)))
   (export "comp" (component $C))

This is the error message of wasm-tools:
error: cannot alias outer type which transitively refers to resources not defined in the current component (at offset 0x56)

@lukewagner
Copy link
Copy Markdown
Member Author

@zherczeg Great point! Added

@zherczeg
Copy link
Copy Markdown

Thank you! LGTM

@lukewagner lukewagner merged commit d03c5ea into main May 27, 2026
2 checks passed
@lukewagner lukewagner deleted the fix-outer-alias branch May 27, 2026 15:26
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.

3 participants