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

named-def( $key => 15 ) Too many positionals passed; expected 0 arguments but got 1 #65

Closed
electricface opened this issue Jul 25, 2015 · 1 comment

Comments

@electricface
Copy link

sub named-def(:$def = 5 ){
    say $def 
}

my $key = 'def'
named-def( $key => 15 )
Too many positionals passed; expected 0 arguments but got 1

perl6 -v
This is perl6 version 2015.07.1 built on MoarVM version 2015.07

@vendethiel
Copy link
Member

This is correct. You're passing a Pair to the function call (the dynamic key does that). You can use | to pass a hash as named parameters (fn(|%args)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants