[Custom Descriptors] Fix TypeMerging sibling criteria#7842
Merged
Conversation
When merging sibling types, we must first partition the types by their supertypes and shapes. With custom descriptors, we consider full descriptor chains as single units to be merged. We had updated the shape partitioning to account for this, but not the supertype partitioning. As a result, we were incorrectly merging chains with different descriptor supertypes as long as the base described types had no supertype. Fix the bug by partitioning not just on the base described type's supertype, but the sequence of all supertypes in the chain.
kripken
approved these changes
Aug 19, 2025
tlively
added a commit
that referenced
this pull request
Oct 3, 2025
Now that we have stricter validation for descriptor types, descriptor chains can only be subtypes of other descriptor chains if the base described type of the subtype chain is a subtype of the base described type of the supertype chain. We had previously handled more complicated cases where the base described type in the supertype chain could be a supertype of an arbitrary type in the subtype chain and where a subtype chain could even have several supertype chains. Simplify TypeMerging by reverting #7842 and #7764 now that we no longer need to handle these more complicated cases.
tlively
added a commit
that referenced
this pull request
Oct 3, 2025
Now that we have stricter validation for descriptor types, descriptor chains can only be subtypes of other descriptor chains if the base described type of the subtype chain is a subtype of the base described type of the supertype chain. We had previously handled more complicated cases where the base described type in the supertype chain could be a supertype of an arbitrary type in the subtype chain and where a subtype chain could even have several supertype chains. Simplify TypeMerging by reverting #7842 and #7764 now that we no longer need to handle these more complicated cases.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When merging sibling types, we must first partition the types by their
supertypes and shapes. With custom descriptors, we consider full
descriptor chains as single units to be merged. We had updated the shape
partitioning to account for this, but not the supertype partitioning. As
a result, we were incorrectly merging chains with different descriptor
supertypes as long as the base described types had no supertype.
Fix the bug by partitioning not just on the base described type's
supertype, but the sequence of all supertypes in the chain.