Skip to content

[TS] Extraction misses bodyless overloads when << or >> appear earlier in file #2230

Description

@squid-protocol

Problem:
GitGalaxy fails to extract pipeable (in fp-ts/pipeable.ts) and createBinder (in typescript_compiler/binder.ts). Both are bodyless TypeScript declarations (e.g. overloads or signatures) that don't end in a semicolon.

Root Cause:
Because they lack a ;, prism.py scans forward for a { or ;. It hits the next declaration's {, realizes it might be a nested type annotation, and scans backwards to check if it's inside (, <, or [. The backward scanner in _slice_by_braces (gitgalaxy/core/detector.py) is completely blind to bitwise operators. When it encounters 1 << 8 earlier in binder.ts or << in pipeable.ts, it sees < at depth 0, sets outer_container = "<", and wrongly concludes the function is just an annotation inside a generic list, dropping it entirely.

To Reproduce:
Run tests/tools/tree_sitter_accuracy_audit.py --lang typescript and observe pipeable and createBinder in _missing_examples.

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

    bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginethreat: false-negativeAccuracy tuning: Engine missed a bypass or vulnerability

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions