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 tool implementations to handle gracefully a def with missing location #15273

Conversation

straight-shoota
Copy link
Member

Without this change, crystal tool implementations would crash when a target def has no location.

The example uses an enum type's .new method which is defined by the compiler without a location.

This patch fixes the nil error. The result may still not be terribly useful, but it's better than crashing the program.

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:tools:implementations labels Dec 13, 2024
@straight-shoota straight-shoota self-assigned this Dec 13, 2024
@straight-shoota straight-shoota added this to the 1.15.0 milestone Dec 13, 2024
@straight-shoota straight-shoota merged commit 9183bb0 into crystal-lang:master Dec 15, 2024
69 checks passed
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:implementations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants