Skip to content

feat: Strict custom enum type support. #182

@palmmc

Description

@palmmc

Description

Serenity does not currently support strict ("real") enum support. By this, I refer to an enum type that meets the following qualifications:

  1. Registered as a new param type in commands (e.g. /setblock <block: BlockId> vs current /setblock <block: string>.
  2. Validates from a list of string options.

Not having strict enum support creates one critical issue with the command system:
If you have two overloads that use different enums, for example:

/test <foo: "foo"> <bar: "bar">
/test <test: "hello" | "world>

The client will always choose the second enum. This is because all CustomEnums use the string symbol, which offers no client differentiation between "foo" and "hello" | "world".

Without this feature, overloads will never function as expected, making the command system a lot less versatile and useful.

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