Skip to content

Why create-2d is an invalid identifier? #578

Closed

Description

I am declaring a function that creates a two-dimensional texture:

default interface client-experimental-texture {
    create-2d: func() -> string
}

This fails with:

  Caused by:
      invalid character in identifier '2'
           --> wit/client-experimental-texture.wit:2:5
            |
          2 |     create-2d: func() -> string
            |     ^', crates/wasm/build.rs:49:58

WIT spec seems to imply that create-2d is a valid identifier:

Identifiers in WIT documents are required to be valid component identifiers, meaning that they're "kebab cased". This currently is restricted to ascii characters and numbers that are - separated.

Activity

  1. alexcrichton commented on May 16, 2023

    @alexcrichton
    Member

    This is a requirement inhereited from the upstream component model specification (search for "kebab name" there). I think it might be reasonable to update the casing rules to allow this, however. Would you be up for opening an issue on the component model repository for this?

  2. alexcrichton commented on Nov 9, 2023

    @alexcrichton
    Member

    I'm going to close this because I believe the question here has been answered and/or moved upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions