You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Validation text around outer aliases may be incomplete #771
I believe the intention is that outer aliases that cross a component boundary must be substitutable inline, so that nested components can be unbundled. In Binary.md it applies the resource check only to the type sort, but a component's type can also outer-alias a resource, so an outer alias of an imported component can't always be unbundled. I think this is valid via the currently documented rules (and accepted via wasm-tools):
Great question. I think your first and second examples shouldn't validate, and thus the first example fails validation before it even gets to the definition of $N. In particular, I think the rule we need is: componenttypes should follow the same "no outer alias of resource types" rule as componentdefinitions, and thus attempting to define the component type used to import c should fail validation (even before getting to the import definition). The rationale I think is: a component definition could not possibly match the type of c, given that any candidate component definition is not able to refer to r (b/c they're not allowed to outer alias resource types). Incidentally, this directly contradicts the example on line 976 of Text.md atm and several WAST tests in test/, so this would be a spec/test change.
Makes sense to me yeah, and that's easy enough to implement and AFAIK this won't break much in practice since importing components or declaring component types like this is likely pretty rare
Activity
lukewagner commentedon Nov 19, 2026
Great question. I think your first and second examples shouldn't validate, and thus the first example fails validation before it even gets to the definition of
$N. In particular, I think the rule we need is:componenttypes should follow the same "no outer alias of resource types" rule ascomponentdefinitions, and thus attempting to define thecomponenttype used to importcshould fail validation (even before getting to theimportdefinition). The rationale I think is: acomponentdefinition could not possibly match the type ofc, given that any candidatecomponentdefinition is not able to refer tor(b/c they're not allowed to outer alias resource types). Incidentally, this directly contradicts the example on line 976 of Text.md atm and several WAST tests intest/, so this would be a spec/test change.alexcrichton commentedon Nov 20, 2026
Makes sense to me yeah, and that's easy enough to implement and AFAIK this won't break much in practice since importing components or declaring component types like this is likely pretty rare
Disallow aliases crossing component type boundaries too
Disallow aliases crossing component type boundaries too (bytecodealli…
lukewagner commentedon Dec 1, 2026
Ok, (finally) written up in #776.