Skip to content

Allow type declarations at package scope - #699

Open
yordis wants to merge 1 commit into
WebAssembly:mainfrom
yordis:yordis/feat-package-scope-types
Open

Allow type declarations at package scope#699
yordis wants to merge 1 commit into
WebAssembly:mainfrom
yordis:yordis/feat-package-scope-types

Conversation

@yordis

@yordis yordis commented Aug 15, 2026

Copy link
Copy Markdown

This PR allows type, record, variant, enum and flags declarations at package scope in WIT, as proposed in #694. Today, sharing a type vocabulary across interfaces requires inventing an interface to hold it, and that container reaches the artifact as an instance import that nothing calls.

resource is deliberately excluded. Resources carry identity rather than structure, so an interface is what gives a resource its identity, and package scope has nothing to offer there. That is why the grammar names a package-typedef-item rather than reusing typedef-item, which already includes resource-item.

Sharing a type vocabulary between interfaces requires inventing an interface
to hold it, and that container reaches the artifact as an import nothing calls.

Refs WebAssembly#694

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
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.

1 participant