You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Wow, this was quite a ride. Indirect dependencies were always supported
kind of on best effort. This PR puts them on some principled foundation.
It fixes three crashes and three stale types reported. All tests are
quite weird/obscure, they are designed to expose the flaws in current
logic (plus one test that passes on master, but it covers important
corner case, so I add it just in case ). A short summary of various
fixes (in arbitrary order):
* Update many outdated comments and docstrings
* Missing transitive dependency is now considered stale
* Handle transitive generic bases in indirection visitor
* Handle chained alias targets in indirection visitor
* Always record original aliases during semantic analysis
* Replace ad-hoc `module_refs` logic in type checker with more
principled one during semantic analysis
* Delete `qualified_tvars` as a concept, they are not needed since long
ago
* Remove ad-hoc handling for `TypeInfo`s from `build.py`
* Support symbols with setter type different from getter type
In general the logic should be more simple/straightforward now:
* Get all symbols we try to access in a module and record the modules
they were defined in (note this automatically handles problem with
possible excessive `get_proper_type()` calls).
* Get all types in a type map, for each type _transitively_ find all
named types in them (thus aggregating all interfaces the type depends
on)
Note since this makes the algorithm correct, it may also make it slower
(most notably because we must visit generic bases). I tried to offset
this by couple optimizations, hopefully performance impact will be
minimal. On my machine slow down is ~0.6%
0 commit comments