You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the current component mode proposal, exports are used to name things, so a component with this interface would export a record interface type named foo and a function type named foo. As duplicate exports are illegal in WebAssembly components, this would fail validation.
Another reason to not allow this is that some language bindings might use a similar naming convention between type identifiers and function identifiers and such a binding generator would need to use an alternative (potentially unwieldy) name to prevent a collision
The text was updated successfully, but these errors were encountered:
Should names be unique across functions, resources, and types?
I'm working on a draft implementation and all three are handled separately at the moment.
I think to accomodate the broadest variety of languages we'll be generating bindings into it's probably best to have everything in the same namespace and forbid any clashes.
alexcrichton
changed the title
Disallow duplicate names between types and functions
wit: Disallow duplicate names between types and functions
Nov 22, 2022
Currently in wit, this is legal:
In the current component mode proposal, exports are used to name things, so a component with this interface would export a record interface type named
foo
and a function type namedfoo
. As duplicate exports are illegal in WebAssembly components, this would fail validation.Another reason to not allow this is that some language bindings might use a similar naming convention between type identifiers and function identifiers and such a binding generator would need to use an alternative (potentially unwieldy) name to prevent a collision
The text was updated successfully, but these errors were encountered: