Skip to content

Type unions are previewed out of order #59746

Closed
@Nixinova

Description

@Nixinova

🔎 Search Terms

type union vscode preview display out of order digits/numbers

🕗 Version & Regression Information

  • This changed between versions ______ and _______
    This changed in commit or PR _______
    This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
    I was unable to test this on prior versions because this behavior is from the VSCode previewer.

⏯ Playground Link

No response

💻 Code

type digit = '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9'

🙁 Actual behavior

image
Why is 0 between 2 and 3?

🙂 Expected behavior

Preview says type digit = "0" | "1" | "2" | "3" ...

Additional information about the issue

No response

Activity

MartinJohns

MartinJohns commented on Aug 25, 2024

@MartinJohns
Contributor

You forgot to fill out the issue template.

Duplicate of #17944. The order of types in a union is not guaranteed.

Nixinova

Nixinova commented on Aug 25, 2024

@Nixinova
Author

no i didn't? and okay will close as duplicate. still weird that only 0 is out of place though.

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

        Participants

        @MartinJohns@Nixinova

        Issue actions

          Type unions are previewed out of order · Issue #59746 · microsoft/TypeScript