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
[Bug]: TS: a class field's type leaks to every same-named receiver in its file, so A.run binds this.repo.save() to RepoB.save #4294
I have checked the Troubleshooting section in the README
What happened?
Since 18682e8 (#4231, my PR) _ts_receiver_type_table types class fields, but it writes them into the per-file receiver table (name -> Type, first binding wins). That table is keyed by the bare name for the whole file, so a field's type reaches every receiver with that name in the file: with two classes in one file that each have a repo field of a different type, both classes' this.repo take one type, and A.run binds this.repo.save() to RepoB.save. It also types any local that happens to share a field's name.
The graphify-labs bot flagged this on #4231 and the PR had a second commit scoping fields per class, but only the first commit shipped in 0.9.81.
Steps to reproduce
mkdir demo &&cd demo
printf'export class RepoA { save(): void {} }\nexport class RepoB { save(): void {} }\n'> repos.ts
printf'import { RepoA, RepoB } from "./repos";\nexport class A {\n repo: RepoA;\n run(): void { this.repo.save(); }\n}\nexport class B {\n repo: RepoB;\n run(): void { this.repo.save(); }\n}\n'> svc.ts
graphify update . --no-cluster
python -c "import json; g=json.load(open('graphify-out/graph.json')); n={x['id']:x['label'] for x in g['nodes']}; o={e['target']:n[e['source']] for e in g.get('links',g.get('edges',[])) if e['relation']=='method'}; [print(o.get(e['source']), n[e['source']], '->', o.get(e['target']), n[e['target']]) for e in g.get('links', g.get('edges', [])) if e['relation']=='calls']"
Error output or graph output
A .run() -> RepoB .save() # wrong: A.repo is RepoA
B .run() -> RepoB .save()
Expected: `A .run() -> RepoA .save()` and `B .run() -> RepoB .save()`.
Activity
github-actions commentedon Oct 10, 2026
Thanks for opening this issue, @rohit-jsfreaky. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.