wit-bindgen
wit-bindgen copied to clipboard
Disallow duplicate names between types and functions
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