Delete old meet hack from checkmember.py #18662
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The hack to use
meet_types(original_type, itype)
to select a correct element from a union appeared before we added proper handling of unions in various places related tocheckmember.py
. This is error prone, sincemeet_types()
is one of least precise type ops (for good and bad reasons), and results in obscure bugs, see e.g. #15600This hack should not be needed anymore, now we have three-level information available everywhere we needed it:
original_type
- as the name says, a type from which everything started. This is used for error messages and for plugin hooks.self_type
- a specific element of the union is the original type is a union. The name is because this is what will be ultimately used bybind_self()
itype
the actual instance type where we look up the attribute (this will be e.g. a fallback if theself_type
is not an instance)