Skip to content

Fix crystal tool unreachable & co visiting circular hierarchies#15065

Merged
straight-shoota merged 2 commits intocrystal-lang:masterfrom
straight-shoota:fix/tool-unreachable-recursive
Oct 7, 2024
Merged

Fix crystal tool unreachable & co visiting circular hierarchies#15065
straight-shoota merged 2 commits intocrystal-lang:masterfrom
straight-shoota:fix/tool-unreachable-recursive

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
@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