fix(memo): preserve runtime typing for unannotated params#6659
fix(memo): preserve runtime typing for unannotated params#6659harsh21234i wants to merge 3 commits into
Conversation
Greptile SummaryThis PR fixes a regression introduced in 0.9.4 where
Confidence Score: 5/5Safe to merge; the change is self-contained and well-tested, with no impact on annotated params or non-memo code paths. The core mechanism — seeding a captured dict reference before the No files require special attention; both changed files are straightforward. Important Files Changed
Reviews (3): Last reviewed commit: "add runtime var type assertion" | Re-trigger Greptile |
Merging this PR will not alter performance
Comparing Footnotes
|
Summary
Fixes #6631.
@rx.memocomponent bodies with unannotated parameters were regressing toVar[Any]in 0.9.4, which caused downstreamUntypedVarErrorfailures when the memo bodytried to access object fields or call var methods.
This change preserves the legacy behavior for missing annotations by seeding the memo body with the first call’s runtime value type before the component is
materialized. That keeps the deprecation warning in place, but avoids the confusing compile-time failure for existing call sites.
Testing
uv run pytest -o addopts='' tests/units/components/test_memo.py -q