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 named arguments in super and previous_def calls #10400

Merged
merged 1 commit into from
Feb 17, 2021

Conversation

HertzDevil
Copy link
Contributor

@HertzDevil HertzDevil commented Feb 15, 2021

Fixes #8895 (including the examples in the comment).

Specifically, this PR

  • No longer considers super / previous_def expansion if a call uses only named arguments but no positional arguments.
  • Drops the bare splat parameter in the expanded call. (This is what triggers the local variable '' part.)
  • Implicitly forwards also the double splat parameter, if one exists.
  • Ensures named parameters in the enclosing def are implicitly forwarded always by their external names, not internal ones.

@straight-shoota straight-shoota added kind:bug A bug in the code. Does not apply to documentation, specs, etc. topic:compiler:semantic labels Feb 15, 2021
Copy link
Member

@asterite asterite left a comment

Choose a reason for hiding this comment

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

Awesome! 💜

@asterite asterite added this to the 1.0.0 milestone Feb 17, 2021
@asterite asterite merged commit 7c5a5f8 into crystal-lang:master Feb 17, 2021
@HertzDevil HertzDevil deleted the bug/super-named-arguments branch February 18, 2021 02:55
toddsundsted added a commit to toddsundsted/mxnet.cr that referenced this pull request Apr 14, 2021
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:compiler:semantic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Calling super without args fails with keyword args
3 participants