Skip to content

TypeScript explicit_casts: a generic type argument before a keyword (extends B<T> implements C) counts as a <T>value cast #9459

Backlog

Description

@squid-protocol

Found by the SOP-002 gap-cell decoy suite (protocol SOP-002-v1, epic #8863).

Construct: a TypeScript generic type argument followed by a keyword. The explicit_casts angle-bracket branch <\s*[A-Z]\w*\s*>\s*[a-zA-Z_] (meant for the <Type>value cast) matches B<T> implements and Foo<Bar> extends.

Snippets and actual hits (expected 0 each):

  • class A extends B<T> implements C {} -> 1
  • type T = Foo<Bar> extends X ? 1 : 0; -> 1

The cast const n = <Node>obj; fires as it should; interface I extends Base<T> {} correctly reads 0.

Rule: gitgalaxy/standards/language_standards/languages/typescript.py, explicit_casts.

Locked in tests/decoys/test_decoy_typescript.py as xfail(strict=True).

Activity

  1. added
    bug
    on Nov 26, 2026
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions