-
-
Notifications
You must be signed in to change notification settings - Fork 3k
[1.16 regression] Internal error: must never apply partial type #19213
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
Labels
Comments
Thanks for the report, bisects to #18847 |
The snippet has obvious typing error, but hard crash is certainly too much... MRE without overload: from typing import TypeVar, Protocol
T = TypeVar('T')
class DbManager(Protocol):
def get(self, key: str) -> T | None:
pass
class Foo:
def __init__(self, db: DbManager) -> None:
self.qux = db.get('qux') Note that |
@sterliakov Essentially the crash happens in the case where the outer (return) type context is used. I used the original example in the test before seeing your comment, but I think it is OK. |
ilevkivskyi
added a commit
that referenced
this issue
Jun 3, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Crash Report
mypy crash with message:
Traceback
To Reproduce
main.py:
run mypy:
Your Environment
mypy.ini
(and other config files):with mypy 1.15.0, I got error:
But with mypy 1.16.0, I got error:
The text was updated successfully, but these errors were encountered: