wasm-tools
wasm-tools copied to clipboard
components: Injection of outer aliases doesn't work for core wasm types
This component
(component
(core type $t (func))
(core type (module
(export "" (func (type $t)))
))
)
currently yields:
$ wasm-tools validate foo.wat --features component-model
Error: failed to find type named `$t`
--> foo.wat:4:28
|
4 | (export "" (func (type $t)))
| ^
but I think we should implement automatic injection of aliases.
I initially tried to get this working by modifying these lines to call resolver.resolve_ns which handles outer alias injection but that quickly ran afoul of https://github.com/WebAssembly/component-model/issues/64 where within a module type core outer aliases must be encoded one way but currently they're encoded a different way in wast. I didn't want to deal with all the specifics just yet so I decided to file an issue for this to not forget about it instead of finishing the implementation.