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

error about unknown named parameters: should say what they were passed to #5190

Open
p6rt opened this issue Mar 23, 2016 · 3 comments
Open
Labels
LTA Less Than Awesome; typically an error message that could be better rtestneeded

Comments

@p6rt
Copy link

p6rt commented Mar 23, 2016

Migrated from rt.perl.org#127767 (status was 'new')

Searchable as RT127767$

@p6rt
Copy link
Author

p6rt commented Mar 23, 2016

From @geekosaur

I had intended to send this 2 months ago (whoops) but got buried in inbox...

This from a discussion on p6-users (
http://www.nntp.perl.org/group/perl.perl6.users/2016/01/msg2495.html)​:

On Mon, Jan 25, 2016 at 2​:07 PM, Brandon Allbery <allbery.b@​gmail.com>
wrote​:

On Mon, Jan 25, 2016 at 2​:42 PM, Carl Mäsak <cmasak@​gmail.com> wrote​:

my %h; say 'false' if !%h<a>​:exists;
Unexpected named parameter 'exists' passed

By the way, is it me or would it be a lot more appropriate and helpful if
this error said *what* it was passed to?

As it turns out, while one would naïvely expect :exists to have been
applied to postcircumfix​:<< < > >>, it was in fact applied to prefix​:<!>.
Quite a bit of confusion would have been avoided if the error had said so.

--
brandon s allbery kf8nh sine nomine associates
allbery.b@​gmail.com ballbery@​sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

@p6rt
Copy link
Author

p6rt commented Jul 10, 2016

From @zoffixznet

Still present today on rakudo 89470a​:

<Zoffix> m​: my %h; say 'false' if !%h<a>​:exists;
<camelia> rakudo-moar 89470a​: OUTPUT«Unexpected named parameter 'exists' passed␤ in block <unit> at <tmp> line 1␤␤»

@p6rt p6rt added the LTA Less Than Awesome; typically an error message that could be better label Jan 5, 2020
@usev6
Copy link

usev6 commented Apr 5, 2021

As it turns out, while one would naïvely expect :exists to have been
applied to postcircumfix​:<< < > >>, it was in fact applied to prefix​:<!>.
Quite a bit of confusion would have been avoided if the error had said so.

The error mentions the precedence problem now:

$ ./rakudo-m -e 'my %h; say "false" if !%h<a>:exists;'
Precedence issue with ! and :exists, perhaps you meant :!exists?
  in block <unit> at -e line 1
$ ./rakudo-m -e 'my %h; say "false" if !(%h<a>:exists);'
false

Tagging testneeded. (Should probably be added as a test for Rakudo, since we want to check the error message.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LTA Less Than Awesome; typically an error message that could be better rtestneeded
Projects
None yet
Development

No branches or pull requests

2 participants