Skip to content

Parsing error: failed to parse a rust type: Unexpected token when parsing type: on an array whose size is an associated constant #272

@phimuemue

Description

@phimuemue

I tried to use typeshare in my repo (see https://github.com/phimuemue/openschafkopf/blob/typeshare_error/main/src/subcommands/websocket/mod.rs, look for #[typeshare]).

Running typeshare in the directory openschafkopf/main using

typeshare . --lang typescript --output-file ../websocket_types.ts

results in this:

Parsing error: "failed to parse a rust type: Unexpected token when parsing type: `[String ; EPlayerIndex :: SIZE]`. This is an internal error, please ping a typeshare developer to resolve this problem." in file "./src/subcommands/websocket/mod.rs"

It seems that an array whose size is given by an associated constant (in this case EPlayerIndex::SIZE) is not recognized by typeshare.

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