Skip to content

wit: Disallow duplicate names between types and functions #835

@peterhuene

Description

@peterhuene

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    witrelated to the `*.wit` text format

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions