Skip to content

Fix nested TypeForm alias evaluation - #11634

Merged
Rich Chiodo (rchiodo) merged 2 commits into
mainfrom
rchiodo-investigate-typeform-regression
Aug 13, 2026
Merged

Fix nested TypeForm alias evaluation#11634
Rich Chiodo (rchiodo) merged 2 commits into
mainfrom
rchiodo-investigate-typeform-regression

Conversation

@rchiodo

Copy link
Copy Markdown
Collaborator

Summary

  • consult the TypeForm-specific cache for nested generic arguments evaluated in a TypeForm context
  • preserve incomplete-cache generation checks when selecting cached results
  • add regression coverage for PEP 695 aliases used as bounded generic arguments

Fixes #11633

Testing

  • npx jest typeEvaluator8.test --forceExit -t "TypeForm"
  • npm run build (packages/pyright-internal)

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions

This comment has been minimized.

@heejaechang

Heejae Chang (heejaechang) commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

🔒 Automated review in progress — Heejae Chang (@heejaechang) is auto-reviewing this PR.

Comment thread packages/pyright-internal/src/analyzer/typeEvaluator.ts Outdated
@heejaechang Heejae Chang (heejaechang) added the review-auto:changes-requested Automated review: posted blocking findings to address. label Aug 13, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@heejaechang

Copy link
Copy Markdown
Collaborator

A runtime-first evaluation can still reuse the ordinary cache for nested TypeForm arguments, restoring the invalid TypeAliasType diagnostic. This needs a context-specific cache lookup and regression coverage.

@rchiodo

Copy link
Copy Markdown
Collaborator Author

Fixed in f274ace — TypeForm argument evaluation now consults only the context-specific TypeForm cache and reevaluates when that entry is missing, so an ordinary runtime-cache hit cannot short-circuit contextual validation. Runtime-first regression coverage includes nested class aliases, generic aliases, ParamSpec, and TypeVarTuple cases.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved via Review Center.

@heejaechang Heejae Chang (heejaechang) added review-auto:approved Automated review: no blocking findings (approval posted). and removed review-auto:changes-requested Automated review: posted blocking findings to address. labels Aug 13, 2026
@rchiodo
Rich Chiodo (rchiodo) merged commit 0fbac0e into main Aug 13, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.1.412 regression - Type "TypeAliasType" cannot be assigned to type variable when assigning generic with type alias to a TypeForm

2 participants