Skip to content

Conversation

@ilevkivskyi
Copy link
Member

Fixes #4772

This also allows to remove all but one _no_parallel test suffixes. I decided to keep the last one (caused by an existing inconsistent behaviour in partial plugin) for now.

I am still fascinated by how non-trivial this seemingly simple fix is. The key idea is to split the error tuple generation in two phases: first phase can produce relative error locations (as symbol full names) and those are serialized to cache. We then resolve relative locations in the second phase (which may potentially require re-parsing some ASTs that were already discarded, I cache these globally per-run). Couple missing things in the PR:

  • Only AST nodes that are also SymbolNode are supported (so e.g. assignments are not yet supported).
  • Using relative locations in blocker errors is not supported (they use a different code path).

Both are fine for now, since neither of two cases are actually used, we can support those later when/if needed.

@github-actions

This comment has been minimized.

@ilevkivskyi
Copy link
Member Author

Oh, hm, the primer shows an actual problem in my logic. I need to recurse into compound statements when searching for defs. Probably not hard to do. I will update the PR today/tomorrow.

@ilevkivskyi
Copy link
Member Author

OK, hopefully this should be fixed now. Also opened #20640 as a follow-up for functools.partial problem.

@github-actions
Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"<function> defined here" notes omitted when function is loaded from cache

1 participant