Stream: git-wasmtime

Topic: wasmtime / issue #14853 Instances passed to nested compon...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 19 2026 at 20:46):

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/n as implementing p:q/r (the inner component declared x:y/z), and out has an extra export that the inner component never declared and that the host can look up. wasmparser's types for the same component have n implementing x:y/z and no extra.

The argument seems to be pushed as-is in inline.rs (frame.push_item(arg.clone())), and record_export then takes nested attributes from the outer type.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 19 2026 at 20:57):

alexcrichton added the wasm-proposal:component-model label to Issue #14853.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 19 2026 at 20:57):

alexcrichton added the wasm-proposal:component-model-implements label to Issue #14853.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 20 2026 at 20:18):

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/n as implementing p:q/r (the inner component declared x:y/z), and out has an extra export that the inner component never declared and that the host can look up. wasmparser's types for the same component have n implementing x:y/z and no extra.

The argument seems to be pushed as-is in inline.rs (frame.push_item(arg.clone())), and record_export then takes nested attributes from the outer type.


Last updated: Oct 31 2026 at 23:03 UTC