jrandolf opened issue #14852:
Wasmtime ignores the type ascription on component exports. For example:
(component (core module $m (func (export "f") (result i32) i32.const 1) (func (export "g") (result i32) i32.const 2)) (core instance $i (instantiate $m)) (func $f (result u32) (canon lift (core func $i "f"))) (func $g (result u32) (canon lift (core func $i "g"))) (instance $inst (export "f" (func $f)) (export "g" (func $g))) (export "hidden" (instance $inst) (instance (export "f" (func (result u32))))) )The ascription hides
g, butcomponent_type()still listsgunderhidden, and the host can look it up withInstance::get_export_index(Some(&hidden), "g")and call it (it returns 2). Attributes that come from the ascription, such as(implements "..")or(external-id "..")on a nested export, are lost as well, and the same item can report different attributes depending on which path it's exported through.It looks like
translate.rsrecords(item, name)for exports and dropsexport.ty, and the root export types are then built from the definition rather than the ascribed type. Guests aren't affected; this is about what the embedder API exposes.
alexcrichton added the wasm-proposal:component-model label to Issue #14852.
alexcrichton closed issue #14852:
Wasmtime ignores the type ascription on component exports. For example:
(component (core module $m (func (export "f") (result i32) i32.const 1) (func (export "g") (result i32) i32.const 2)) (core instance $i (instantiate $m)) (func $f (result u32) (canon lift (core func $i "f"))) (func $g (result u32) (canon lift (core func $i "g"))) (instance $inst (export "f" (func $f)) (export "g" (func $g))) (export "hidden" (instance $inst) (instance (export "f" (func (result u32))))) )The ascription hides
g, butcomponent_type()still listsgunderhidden, and the host can look it up withInstance::get_export_index(Some(&hidden), "g")and call it (it returns 2). Attributes that come from the ascription, such as(implements "..")or(external-id "..")on a nested export, are lost as well, and the same item can report different attributes depending on which path it's exported through.It looks like
translate.rsrecords(item, name)for exports and dropsexport.ty, and the root export types are then built from the definition rather than the ascribed type. Guests aren't affected; this is about what the embedder API exposes.
Last updated: Oct 31 2026 at 23:03 UTC