You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeScript: variance annotations (<out A>, <in E>, <in out T>) are parse errors #3276
TypeScript 4.7 variance annotations on type parameters (<out A>, <in E>, <in out T>, <const in T>) are parse errors in the bundled TypeScript grammar, tree-sitter-typescript v0.23.2 (grammars.ts:386). That is upstream tree-sitter/tree-sitter-typescript#370, which is still open. The grammar repo has had no commit since 2025-01-30.
Expected: each parses clean, with the modifier attached to its type_parameter.
What it costs today
Error recovery is local in small files, so declarations in them are still extracted. Indexing packages/effect/src from Effect-TS/effect 7a87ff9 gives the same 31,478 nodes with and without a grammar that accepts the annotations.
The graph does lose edges. With the fixed grammar, the same index has 8 more references edges. For example, makeEquivalence in Redacted.ts:321 gains its references to Equivalence and Redacted, which sit after export interface Redacted<out A = string> (line 58).
Activity