Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlighting breaks when casting a variable called type #992

Open
Yokozuna59 opened this issue Sep 24, 2023 · 0 comments
Open

Highlighting breaks when casting a variable called type #992

Yokozuna59 opened this issue Sep 24, 2023 · 0 comments

Comments

@Yokozuna59
Copy link

Yokozuna59 commented Sep 24, 2023

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant