-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Support type aliases in fine-grained incremental mode #4394
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
Comments
Here is a test case for it that fails:
|
The challenge here is that type aliases are completely replaced during semantic analysis, and thus we can't easily determine which type aliases were used after the fact. Here are two approaches for resolving this:
The first approach would likely require pretty major changes to mypy, since each |
There is a related issue #4082, but I think these two are independent. The other issue is about having it clear in the symbol table (not via |
Fixes #4394 This covers all common cases and majority of corner cases: *Simple aliases *Generic aliases *Forward references *Nested aliases *Chained aliases * Special forms Note that among tests added some also pass without this addition (probably because some dependencies are added by coincidence). Note that I mainly focus on false negatives, since in my experience while playing with fine-grained daemon, this is the most typical problem.
Fixes python#4394 This covers all common cases and majority of corner cases: *Simple aliases *Generic aliases *Forward references *Nested aliases *Chained aliases * Special forms Note that among tests added some also pass without this addition (probably because some dependencies are added by coincidence). Note that I mainly focus on false negatives, since in my experience while playing with fine-grained daemon, this is the most typical problem.
This includes generic type aliases such as
X = Dict[str, T]
and aliases to all kinds of types.Generating dependencies may be tricky.
The text was updated successfully, but these errors were encountered: