Skip to content

TypeScript union members in a function return value highlighted inconsistently #1051

Description

JavaScript and TypeScript Nightly version: 5.9.20250330

When returning a union from a function in TypeScript, the first member of the union is rendered inconsistently.

export function myFunction():
  | null
  | null
  | null {
  return null;
}

The first | is rendered as mtk5 while the other ones are rendered as mtk1. This is an issue for color themes where both are rendered differently (e.g. the default Monokai theme). Similarily, the first null value is rendered as mtk17 while the other ones are rendered as mtk16.

Image

This might be the same bug as #997. #1043 and #1041 also seem related.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions