-
Notifications
You must be signed in to change notification settings - Fork 180
not expand TypeAlias in reveal_type #1437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Can you elaborate on your proposed fix? I don't think this PR addresses the root cause of #1219 - the type aliases are expanded in |
|
I'll import this and see how we can merge it with my in-progress implementation. I'd also like to run it on mypy primer and see what the delta is. |
|
@yangdanny97 has imported this pull request. If you are a Meta employee, you can view this in D86712118. |

part of #1219.
Added TypeAlias::body_type/runtime_value and used them across the solver so we can keep alias names for printing while still acting on their underlying types when needed (attribute access, class bases, isinstance/issubclass, subset checks). Scoped type aliases still behave as TypeAliasType at runtime; legacy aliases now behave like the types they wrap.
Refined isinstance handling so union aliases (e.g., X = B | C) are accepted as class info, and ensured scoped aliases still error.
Allowed type-alias bases when they’re legacy aliases and kept the explicit error for scoped aliases.