-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Do not leak UnboundTypes to type checking #4987
Labels
Comments
Update: this doesn't crash anymore, but we still to avoid leaking |
msullivan
added a commit
that referenced
this issue
Mar 17, 2020
ilevkivskyi
added a commit
that referenced
this issue
Nov 24, 2022
Fixes #11855 Fixes #7084 Fixes #10445 Should fix #4987 After thinking about this for some time, it looks like the best way to implement this is by switching type aliases from unbound to bound type variables. Then I can essentially simply share (or copy in one small place, to avoid cyclic imports) all the logic that currently exists for `ParamSpec` and `Concatenate` in `expand_type()` etc. This will also address a big piece of tech debt, and will get some benefits (almost) for free, such as checking bounds/values for alias type variables, and much tighter handling of unbound type variables. Note that in this PR I change logic for emitting some errors, I try to avoid showing multiple errors for the same location/reason. But this is not an essential part of this PR (it is just some test cases would otherwise fail with even more error messages), I can reconsider if there are objections.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes
UnboundType
leaks to type checking, this is not good because it can lead to crashes like this:It would be better to replace all
UnboundType
s withAny
(after an error is reported).The text was updated successfully, but these errors were encountered: