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
feat(codegen): preserve Python overload input and return relationships #336
The Python extractor records overloads, but TypeScript conversion drops them.
Reproduced on 6b84614 with advanced_types.get_value: IR contains two overloads, while generation emits getValue(key: string | number): Promise<string | number>.
See IROverload and mapFunc. This differs from shipped generic-parameter support in #209 and historical mapper work in #146.
Acceptance criteria:
Preserve supported overloads through IR conversion and generated .ts and .d.ts output.
String and integer calls infer their corresponding declared return types in compile-only tests.
Invalid calls fail typechecking instead of matching an overly broad fallback.
Runtime argument binding and return validation agree with supported overload behavior.
Unsupported or ambiguous cases produce explicit diagnostics.
Preserve positional-only, keyword-only, default-argument, and generic regression coverage.
Coordinate with #335 and implement after its architecture decision. This issue does not approve a wholesale generator rewrite.
Architectural approach:
Preserve overloads in the complete callable contract from #335. Use #344 to verify the selected input-to-return relationship before broader overload implementation. Coordinate through #345.
Generated implementations and declarations retain overloads without a broad fallback. Tests cover correlated input/output types, invalid-call type errors, runtime binding, selected wrong-return rejection, and ambiguity diagnostics. Actual Python extraction tests now cover positional-only parameters with defaults and keyword-only parameters; existing tests cover generics. Python 3.11 and 3.12 run the overload extraction assertions, while 3.10 retains its documented fallback.
Evidence: test/fixtures/python/positional_overloads.py, test/ir_contract.test.ts, test/integration.test.ts, and test/isolated_consumer.conformance.ts.
Verified release evidence:
Implementation #362 and release #354 merged after independent review, green checks, and resolved CodeRabbit findings. Final candidate 0861ebe and merge f6f811d have identical trees.
Final full CI passed, including check:all, scientific 103/103, clean consumer 20/20, real Pyodide/browser 8/8, performance 25/25, and Node/Python/Bun/OS checks. Performance budgets remained unchanged.
Fresh published-consumer run passed 20/20 checks with exact registry versions, isolated imports, and generated calls. It used no local-package fallback.
Activity
bbopen commentedon Sep 20, 2026
Generated implementations and declarations retain overloads without a broad fallback. Tests cover correlated input/output types, invalid-call type errors, runtime binding, selected wrong-return rejection, and ambiguity diagnostics. Actual Python extraction tests now cover positional-only parameters with defaults and keyword-only parameters; existing tests cover generics. Python 3.11 and 3.12 run the overload extraction assertions, while 3.10 retains its documented fallback.
Evidence:
test/fixtures/python/positional_overloads.py,test/ir_contract.test.ts,test/integration.test.ts, andtest/isolated_consumer.conformance.ts.Verified release evidence:
0861ebeand mergef6f811dhave identical trees.The architecture decision records the accepted scope and prototype limits.
Closing with the implemented and verified 0.11 release outcome.