mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-21 00:21:30 +00:00
Closes the cross-file return-type propagation gap that left tests like `u = get_user(); u.save()` (where get_user lives in another file) with `u` typed as the function name instead of its return type. The shared finalize pass copies callable bindings (`from x import f` puts `f` in the importer's bindings) but typeBindings stay file-local because they live on `Scope.typeBindings`, not on the index. Mutate post-finalize: - For each module-scope import binding (`origin: 'import'` or `'reexport'`), look up the source file's module-scope typeBinding for the def's simple name. If present (return-annotation source), mirror it under the importer's local alias. Skip when the importer already has its own typeBinding for the name (explicit local always wins). - After propagation, re-run a chain-follow on every scope's typeBindings — pass-4 ran before propagation and missed any chain whose terminal lived in a foreign file. Same algorithm as `followChainedRef` in scope-extractor, but operates on the finalized scopes so propagated entries are visible. Mutating `Scope.typeBindings` is safe — `draftToScope` constructs a plain `new Map(...)`, not a frozen one. Verification: - Flag-off: 191/191 (identical baseline). - Flag-on: 16 fail / 175 pass (was 20/171; +4 — both cross-file return-type tests, plus two related propagation cases). - tsc --noEmit clean. |
||
|---|---|---|
| .. | ||
| augmentation | ||
| embeddings | ||
| graph | ||
| group | ||
| ingestion | ||
| lbug | ||
| search | ||
| tree-sitter | ||
| wiki | ||
| git-staleness.ts | ||
| run-analyze.ts | ||