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

Passing named args without spaces between them silently fails in some cases #1294

Open
zoffixznet opened this issue Dec 2, 2017 · 2 comments
Labels
parameters/arguments tests needed Issue is generally resolved but tests were not written yet

Comments

@zoffixznet
Copy link
Contributor

If you're passing a named arg, separate it with a comma, and pass two more named args without separating them, things work as expected:

$ perl6 -e 'my $ber = 99; -> $ where .z: :z, :foo:bar($ber) {}(class { method z (:$foo, :$bar) { dd [$foo, $bar ]; True } } )'
[Bool::True, 99]

But if you merely replace the first arg with a positional arg, the named args appear to be silently ignored:

$ perl6 -e 'my $ber = 99; -> $ where .z: 42, :foo:bar($ber) {}(class { method z ($v?, :$foo, :$bar) { dd [$foo, $bar ]; True } } )'
[Bool::True, Any]

$ perl6 -v
This is Rakudo version 2017.10-3-gf40babb built on MoarVM version 2017.10
implementing Perl 6.c.
@JJ
Copy link
Collaborator

JJ commented Jul 22, 2020

This now returns

Array element = [Bool::True, 99]

So I would say it's fixed, right?

@vrurg
Copy link
Member

vrurg commented Jul 22, 2020

It seemingly is. Needs a test, I guess.

@vrurg vrurg added the tests needed Issue is generally resolved but tests were not written yet label Jul 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parameters/arguments tests needed Issue is generally resolved but tests were not written yet
Projects
None yet
Development

No branches or pull requests

3 participants