Skip to content

resolve type aliases - #6944

Open
benedikt-bartscher wants to merge 6 commits into
reflex-dev:mainfrom
benedikt-bartscher:allow-typevar-resolution
Open

resolve type aliases#6944
benedikt-bartscher wants to merge 6 commits into
reflex-dev:mainfrom
benedikt-bartscher:allow-typevar-resolution

Conversation

@benedikt-bartscher

@benedikt-bartscher benedikt-bartscher commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Review in cubic

@greptile-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds resolution of bare, parameterized, variadic, and union-nested type aliases before Var.guess_type selects a specialized reactive variable.

  • Adds helpers for matching generic and variadic alias parameters.
  • Re-runs type inference using the resolved alias value.
  • Moves and expands alias regression tests under the source-corresponding reflex_base test suite.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/reflex-base/src/reflex_base/utils/types.py Adds recursive TypeAliasType unwrapping and generic parameter substitution, including TypeVarTuple handling.
packages/reflex-base/src/reflex_base/vars/base.py Resolves aliases before existing Var.guess_type dispatch.
tests/units/reflex_base/vars/test_base.py Places alias regression tests at the source-corresponding path requested by the previous review thread and covers bare, generic, variadic, optional, and state-field aliases.
packages/reflex-base/news/6944.bugfix.md Documents the newly supported type-alias forms and prior compilation failure.

Reviews (6): Last reviewed commit: "Merge branch 'main' into allow-typevar-r..." | Re-trigger Greptile

Comment thread tests/units/vars/test_base.py Outdated
@codspeed-hq

codspeed-hq Bot commented Aug 25, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 27 untouched benchmarks
⏩ 8 skipped benchmarks1


Comparing benedikt-bartscher:allow-typevar-resolution (573a14a) with main (d3a17c7)

Open in CodSpeed

Footnotes

  1. 8 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@benedikt-bartscher
benedikt-bartscher marked this pull request as ready for review August 25, 2026 10:33
@benedikt-bartscher
benedikt-bartscher requested a review from a team as a code owner August 25, 2026 10:33

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 4 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/reflex-base/src/reflex_base/utils/types.py

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/reflex-base/src/reflex_base/utils/types.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant