Skip to content

Remove the ability to directly use strings as labels #4341

Description

@alice-i-cecile

What problem does this solve or what need does it fill?

Following #4219, system function types can be used directly as labels.

This removes the last serious use of strings as labels: for "quick and dirty" implementations.

"Stringly typed" labels are inferior because:

  1. They are not IDE or compiler aware, and so typos are very challenging to detect.
  2. They can clash in very surprising ways between crates.
  3. They cannot be kept private.

What solution would you like?

  1. Remove the ability to use string types as labels.
  2. Update codebase, including examples and tests, to reflect this change.

Additional context

Raised in #4340 by @DJMcNab.

Note that labels that store a string may be useful in some applications for e.g. scripting integration. This is still supported: you just have to newtype your string.

Activity

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

    A-ECSEntities, components, systems, and eventsC-Code-QualityA section of code that is hard to understand or change

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions