Skip to content

Highlighting breaks when casting a variable called type #992

Description

JavaScript and TypeScript Nightly version: v5.3.20230923

Hi there, an issue occurs when both using <> and as casting.

Code

Using <> casting with newline after <:

export function main() {
  const type = ``;
  const variable = <
  'dog' | 'cat'>type;

  return;
}

The remaining lines Highlights weirdly, or even stops:

current behavior expected behavior
image image

Using as casting with already declared variable:

export function main() {
  const type = ``;
  let variable = ``;
  variable = type as 'dog' | 'cat';
  return;
}
current behavior expected behavior
image image

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