FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Highlighting breaks when casting a variable called `type` · Issue #992 · microsoft/TypeScript-TmLanguage · GitHub

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

Using as casting with already declared variable:

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

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


    Back | FazBrowse Home | New Git URL