Skip to content

[Custom Descriptors] Fix TypeMerging sibling criteria#7842

Merged
tlively merged 1 commit intomainfrom
type-merging-chain-supers
Aug 19, 2025
Merged

[Custom Descriptors] Fix TypeMerging sibling criteria#7842
tlively merged 1 commit intomainfrom
type-merging-chain-supers

Conversation

@tlively
Copy link
Copy Markdown
Member

@tlively tlively commented Aug 18, 2025

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.

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.
@tlively tlively requested a review from kripken August 18, 2025 23:47
@tlively tlively enabled auto-merge (squash) August 19, 2025 00:21
@tlively tlively merged commit 11d3aef into main Aug 19, 2025
16 checks passed
@tlively tlively deleted the type-merging-chain-supers branch August 19, 2025 00:27
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.
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.

2 participants