jrandolf opened issue #14853:
When an outer component instantiates an inner one, the instance passed for an inner import isn't re-typed to the inner component's declared import type. If the inner component re-exports that import, the re-export takes its type and attributes from the outer argument:
(component (core module $m (func (export "f") (result i32) i32.const 7)) (core instance $i (instantiate $m)) (func $f (result u32) (canon lift (core func $i "f"))) (instance $n) (instance $arg (export "n" (implements "p:q/r") (instance $n)) (export "extra" (func $f))) (component $inner (import "x" (instance $x (export "n" (implements "x:y/z") (instance)))) (export "y" (instance $x))) (instance $inst (instantiate $inner (with "x" (instance $arg)))) (export "out" (instance $inst "y")) )Wasmtime reports
out/nas implementingp:q/r(the inner component declaredx:y/z), andouthas anextraexport that the inner component never declared and that the host can look up. wasmparser's types for the same component havenimplementingx:y/zand noextra.The argument seems to be pushed as-is in
inline.rs(frame.push_item(arg.clone())), andrecord_exportthen takes nested attributes from the outer type.
alexcrichton added the wasm-proposal:component-model label to Issue #14853.
alexcrichton added the wasm-proposal:component-model-implements label to Issue #14853.
alexcrichton closed issue #14853:
When an outer component instantiates an inner one, the instance passed for an inner import isn't re-typed to the inner component's declared import type. If the inner component re-exports that import, the re-export takes its type and attributes from the outer argument:
(component (core module $m (func (export "f") (result i32) i32.const 7)) (core instance $i (instantiate $m)) (func $f (result u32) (canon lift (core func $i "f"))) (instance $n) (instance $arg (export "n" (implements "p:q/r") (instance $n)) (export "extra" (func $f))) (component $inner (import "x" (instance $x (export "n" (implements "x:y/z") (instance)))) (export "y" (instance $x))) (instance $inst (instantiate $inner (with "x" (instance $arg)))) (export "out" (instance $inst "y")) )Wasmtime reports
out/nas implementingp:q/r(the inner component declaredx:y/z), andouthas anextraexport that the inner component never declared and that the host can look up. wasmparser's types for the same component havenimplementingx:y/zand noextra.The argument seems to be pushed as-is in
inline.rs(frame.push_item(arg.clone())), andrecord_exportthen takes nested attributes from the outer type.
Last updated: Oct 31 2026 at 23:03 UTC