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

Fix crystal tool unreachable & co visiting circular hierarchies #15065

Conversation

straight-shoota
Copy link
Member

Resolves #14034

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:tools:unreachable labels Oct 7, 2024
@straight-shoota straight-shoota self-assigned this Oct 7, 2024
@straight-shoota straight-shoota changed the title Fix crystal tool format visiting circular hierarchies Fix crystal tool unreachable visiting circular hierarchies Oct 7, 2024
@straight-shoota straight-shoota added this to the 1.14.0 milestone Oct 7, 2024
@Blacksmoke16
Copy link
Member

Blacksmoke16 commented Oct 7, 2024

Does this also fix the error with the implementations tool from the OP and/or #13879?

@straight-shoota
Copy link
Member Author

Ah thanks for the reminder. That doesn't fix those issues, but it seems to be the same bug.

@straight-shoota
Copy link
Member Author

And IMO the cause for this bug is that AliasType#types? implicitly delegates to aliased_type.types?. This leads to circular hierarchies and I believe it's wrong (though I don't know how this affects other parts of the compiler code).

@straight-shoota
Copy link
Member Author

I added the same fix into TypedDefProcessor which is used by the context, expand and implementations tool.
There are good reasons for a more extensive refactoring, but this is a minimal bug fix for now.

@straight-shoota straight-shoota changed the title Fix crystal tool unreachable visiting circular hierarchies Fix crystal tool unreachable & co visiting circular hierarchies Oct 7, 2024
@straight-shoota straight-shoota merged commit 401eb47 into crystal-lang:master Oct 7, 2024
66 checks passed
@straight-shoota straight-shoota deleted the fix/tool-unreachable-recursive branch October 7, 2024 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:tools:unreachable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

crystal tool unreachable doesn't seem to work with a default Lucky app out of the box
3 participants