Skip to content

Conversation

@peterhuene
Copy link
Member

This PR ensures that components encoded with wit-component have the
function types from the exports encoded before the instance types for instance
imports.

Previously, if an instance import defined a type it would be inserted
into a map tracking duplicate types and not exported; when the default
interface was later processed with a matching type, the type index was reused
without adding an export for the type.

By encoding export function types first, it guarantees that the default
exported interface has its named types exported.

This commit ensures that components encoded with `wit-component` have the
function types from the exports encoded before the instance types for instance
imports.

Previously, if an instance import defined a type it would be inserted
into a map tracking duplicate types and not exported; when the default
interface was later processed with a matching type, the type index was reused
without adding an export for the type.

By encoding export function types first, it guarantees that the default
exported interface has its named types exported.
@peterhuene peterhuene merged commit b40adda into bytecodealliance:main Aug 3, 2022
@peterhuene peterhuene deleted the fix-type-exports branch August 3, 2022 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants