Skip to content

Avoiding Name Clashes with WIT Keywords #661

@adrian-javid

Description

@adrian-javid

According to the WIT documentation, an identifier must be proceeded by a single % sign if the identifier would otherwise be a WIT keyword.

Suppose someone makes a user-defined type called struct, and they do not prefix it with % because struct is not a keyword.

Suppose later, in a newer version of WIT, struct becomes a keyword. Then, their WIT code breaks because their user-defined type struct is not prefixed with %.

Perhaps, keywords and primitive types in WIT should be prefixed with some character that is not allowed in user-defined identifiers. That would allow addition of keywords and primitive types in the future without breaking old WIT code that uses those keywords as identifiers. Otherwise, I feel technically incentivized to add % to every user-defined identifier, but that does not feel good.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions