Skip to content

Conversation

@tlively
Copy link
Member

@tlively tlively commented Oct 24, 2024

TypeMerging works by representing the type definition graph as a partitioned DFA
and then refining the partitions to find mergeable types. #7023 was due to a bug
where the DFA included edges from public types to their children, but did not
necessarily include corresponding states for those children.

One way to fix the bug would have been to traverse the type graph, finding all
reachable public types and creating DFA states for them, but that might be
expensive in cases where there are large graphs of public types.

Instead, fix the problem by removing the edges from public types to their
children entirely. Types reachable from public types are also public and
therefore are not eligible to be merged, so these edges were never necessary for
correctness.

Fixes #7023.

TypeMerging works by representing the type definition graph as a partitioned DFA
and then refining the partitions to find mergeable types. #7023 was due to a bug
where the DFA included edges from public types to their children, but did not
necessarily include corresponding states for those children.

One way to fix the bug would have been to traverse the type graph, finding all
reachable public types and creating DFA states for them, but that might be
expensive in cases where there are large graphs of public types.

Instead, fix the problem by removing the edges from public types to their
children entirely. Types reachable from public types are also public and
therefore are not eligible to be merged, so these edges were never necessary for
correctness.

Fixes #7023.
@tlively tlively requested a review from kripken October 24, 2024 00:04
@tlively tlively merged commit de421db into main Oct 24, 2024
13 checks passed
@tlively tlively deleted the fix-7023 branch October 24, 2024 20:48
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.

"unknown successor value" assertion in DFA::refinePartitions

3 participants