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 instantiated method signatures in error traces #13580

Merged

Conversation

HertzDevil
Copy link
Contributor

Fixes part of #13566 by including named arguments in the instantiated method signatures that show up in error traces. This PR only touches the traces, not the final error message itself.

Also expands single and double splat arguments. Also uses Call#full_name to prefer T.method over T.class#method for class methods.

Copy link
Member

@straight-shoota straight-shoota left a comment

Choose a reason for hiding this comment

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

I think stringifying the full type signature should be extracted to a helper method. It's a completely separated individual sub task.

I'm also wondering if there could be some generalization applied. This can come later, though.
For example, the stringification of DoubleSplat and named_args is almost identical. Very similar implementations also exist in NamedTuple#to_s and NamedTupleInstanceType#to_s_with_options.

@straight-shoota straight-shoota added this to the 1.9.0 milestone Jun 21, 2023
@straight-shoota straight-shoota merged commit dfb1cdc into crystal-lang:master Jun 22, 2023
50 checks passed
@HertzDevil HertzDevil deleted the bug/error-trace-named-args branch June 26, 2023 10:53
Blacksmoke16 pushed a commit to Blacksmoke16/crystal that referenced this pull request Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants