Stream: git-wasmtime

Topic: wasmtime / PR #14865 [DO NOT REVIEW] Respect type ascript...


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

jrandolf edited PR #14865.

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

jrandolf edited PR #14865:

Wasmtime ignored the type ascribed to an exported instance, as in (export "a" (instance $i) (instance ...)), and used the type of the definition instead. So exports the ascription hides were still listed in Component::component_type and reachable through get_export_index, and implements/external-id on nested exports came from the definition rather than the ascription. The same thing happened with an instance passed to a nested component whose import declares a narrower type: if the nested component re-exported it, the host saw the caller's instance, extra exports and attributes included.

This views the root component's exports through the types wasmparser validated, which already account for ascriptions and declared import types. record_export now takes an instance's exports, and their attributes, from the instance's type instead of from its definition. The attributes that were carried around next to instance definitions aren't needed anymore, so they're removed.

Some behaviour that embedders can see changes:

Ascriptions on module and component exports aren't applied yet, so component_type() still shows those with their definition's type. This only affects reflection, since the host can't instantiate an exported module or component.

The first commit is the fix. The second adds a test for the nested component case, which the same change fixes.

Closes #14852
Closes #14853


Last updated: Oct 31 2026 at 23:03 UTC