Skip to content

resolve type aliases - #6944

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

resolve type aliases#6944
benedikt-bartscher wants to merge 7 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 teaches Var.guess_type to resolve native and backported TypeAliasType annotations, including generic, variadic, and union-nested aliases.

  • Adds type-alias unwrapping and generic-parameter substitution utilities.
  • Re-runs type inference with the resolved annotation.
  • Adds regression coverage under the source-corresponding tests/units/reflex_base/vars/ path.

Confidence Score: 5/5

The PR appears safe to merge because the previous test-location issue is fixed and no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
packages/reflex-base/src/reflex_base/utils/types.py Adds helpers for resolving bare, parameterized, variadic, and union-nested type aliases.
packages/reflex-base/src/reflex_base/vars/base.py Resolves aliases before the existing Var.guess_type dispatch.
tests/units/reflex_base/vars/test_base.py Adds regression tests in the source-corresponding reflex-base test location, resolving the prior review finding.
packages/reflex-base/news/6944.bugfix.md Documents support for resolving type-alias annotations during variable type inference.

Reviews (7): 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 (736afb2) with main (dfb4ef0)

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