Skip to content

The version type allows an empty version #9047

Open

Description

@laurmaedje

Description

Writing version() leads to no error. An empty version is nonsensical, so I think it would make sense to forbid this.

Operating system

No response

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Nov 6, 2026
  2. T0mstone commented on Nov 10, 2026

    @T0mstone
    Contributor

    Well, the version is always semantically extended by an infinite list of zeroes, so an empty version is essentially equivalent to version 0, 0.0, 0.0.0, and so on. (In fact they compare as equal.) It's a similar special case to how an empty sum equals zero and an empty product equals one.

    Tho of course the at method (for negative indices) and the conversion to an array/string do expose the exact list of given components.
    And since you can just write version(0), I'm not against forbidding version() either.

  3. added
    foundations
    on Nov 13, 2026
  4. MDLC01 commented on Nov 13, 2026

    @MDLC01
    Collaborator

    Note that currently, empty versions are displayed as the empty string. This should probably be fixed if we decide to allow them.

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

    bugfoundations

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions