wit-bindgen icon indicating copy to clipboard operation
wit-bindgen copied to clipboard

Disallow duplicate names between types and functions

Open peterhuene opened this issue 4 years ago • 2 comments

Currently in wit, this is legal:

record foo {
}

foo: function(f: foo)

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

peterhuene avatar Feb 26 '22 05:02 peterhuene