Skip to content

Add unions and overloads - #766

Draft
bvisness wants to merge 14 commits into
WebAssembly:mainfrom
bvisness:union
Draft

bvisness wants to merge 14 commits into
WebAssembly:mainfrom
bvisness:union

Conversation

@bvisness

@bvisness bvisness commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Adds support for union (a variant of variant) and function overloading. The design of unions is mostly unchanged from what @eqrion originally proposed (maybe modulo some of the mapping from types to distinguishable kinds). The design of overloads changed a bit to have optional suffixes of the form #foo, which can be applied to any function (except getters and setters).

A couple TODOs still:

  • Update JS API explainer
  • Internally debate the necessity of default overloads for another 24 hours (I think they're a good idea for API evolution, e.g. adding foo#bar to an interface that already has a func foo)

Resolves #724, resolves #742.

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.

Function overloading to support common web APIs Anonymous union as a specialization of variant to support common web APIs

2 participants