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
Weirdness with passing named to multi infixes #5073
Comments
From @zoffixznetIn the first example blow, passing a named "foo" argument after a comma generates the "Unexpected named param passed..." warning and the $foo variable inside my multi is empty. Note that "meow" *was* printed, showing my custom sub was indeed called. In the second example, we did not use a comma before the named "foo" argument; we're still getting the "Unexpected param" warning, but now our multi is not called. Expected behaviour for both cases is our defined multi is called and the :foo argument is passed in as the named $foo parameter. <ZoffixWin> m: multi sub infix:<+> (Int:D $a, Int:D $b, :$foo) {say "meow <$foo>"}; say say 42 + 1, :foo<42>; |
From @skidsNot sure the first behavior is a bug, as optional nameds may not be considered in multidispatch, Though, not generating an ambiguous error would be a bug, probably: Using a required named parameter: So this should probably work, but does not: |
The RT System itself - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#127359 (status was 'open')
Searchable as RT127359$
The text was updated successfully, but these errors were encountered: