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
We shouldn't call join during semantic analysis, since the MROs of classes may be incomplete and other things may be inconsistent, potentially resulting in crashes.
We can't use type joins safely during semantic analysis, since MROs may be incomplete :-(
One potential way to fix this would be to postpone all joins to a new, fourth semantic analysis pass. That sounds risky though, so for the 0.510 release we could just use Any here as the fallback as a temporary workaround.
This has happened so many times that I've been considering asserting during joins and other type operations that need MROs that they aren't called during semantic analysis, at least when running tests.
The text was updated successfully, but these errors were encountered:
MROs may not be populated yet during semantic analysis, so the join
may crash when we have a forward reference within a named tuple.
See #3316 for additional context. Fixes#3315.
Note that as a side effect, the fallback type of named tuples is now has
an `Any` item type.
Move join to happen after semantic analysis to avoid crash due to
incomplete MRO in TypeInfo. The implementation uses a new semantic
analysis 'patch' phase.
Fixes#3319. Fixes#2489. Fixes#3316.
We shouldn't call join during semantic analysis, since the MROs of classes may be incomplete and other things may be inconsistent, potentially resulting in crashes.
This comment has additional context: https://github.com/python/mypy/pull/3305/files#r114751204
Quote:
The text was updated successfully, but these errors were encountered: