Skip to content

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

Open
lukewagner wants to merge 1 commit into
mainfrom
fix-outer-alias
Open

Fix Explainer.md/Binary.md definition of outer aliases#657
lukewagner wants to merge 1 commit 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)

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