Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compute class and module hierarchy #561

Merged
merged 2 commits into from
Jun 19, 2024
Merged

Compute class and module hierarchy #561

merged 2 commits into from
Jun 19, 2024

Conversation

Morriar
Copy link
Collaborator

@Morriar Morriar commented Jun 18, 2024

Now that we have a complete model (#557) and a poset (#558) we can compute the full class/module hierarchy.

This will allow deadcode plugins to reason about the whole ancestor chain rather than just the parent class.

Morriar added 2 commits June 18, 2024 14:54
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
@Morriar Morriar added the feature New feature label Jun 18, 2024
@Morriar Morriar self-assigned this Jun 18, 2024
@Morriar Morriar requested a review from a team as a code owner June 18, 2024 18:57
@Morriar Morriar requested review from egiurleo and KaanOzkan June 18, 2024 18:57

assert_equal(
["B", "C"],
model.subtypes(model["A"]).map(&:full_name).sort,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not test the order? Why do we sort?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good question: The order is not relevant at this point since we do not do any kind of linearization (yet).

@Morriar Morriar merged commit 7519699 into at-poset Jun 19, 2024
8 checks passed
@Morriar Morriar deleted the at-class-hierarchy branch June 19, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants