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

LTA error message: unexpected argument #6408

Open
p6rt opened this issue Jul 24, 2017 · 5 comments
Open

LTA error message: unexpected argument #6408

p6rt opened this issue Jul 24, 2017 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Jul 24, 2017

Migrated from rt.perl.org#131789 (status was 'open')

Searchable as RT131789$

@p6rt
Copy link
Author

p6rt commented Jul 24, 2017

From @Juerd

It would be more awesome if "Unexected named argument 'foo' passed" was
supplemented with the name of the function to which it was passed.

  sub xyzzy ($x, :$foo = False) { ... }
  sub bar ($y) { ... }

  xyzzy(
  bar "aoeusnthaoeusnth",
  :foo
  )

If the error message includes the name 'bar', it's obvious that adding
parentheses will fix the problem.
--
Met vriendelijke groet, // Kind regards, // Korajn salutojn,

Juerd Waalboer <juerd@​tnx.nl>
TNX

@p6rt
Copy link
Author

p6rt commented Jul 24, 2017

From @zoffixznet

On Mon, 24 Jul 2017 07​:15​:54 -0700, juerd@​tnx.nl wrote​:

It would be more awesome if "Unexected named argument 'foo' passed" was
supplemented with the name of the function to which it was passed.

sub xyzzy \($x, :$foo = False\) \{ \.\.\. \}
sub bar \($y\) \{ \.\.\. \}

xyzzy\(
    bar "aoeusnthaoeusnth",
    :foo
\)

If the error message includes the name 'bar', it's obvious that adding
parentheses will fix the problem.

But the error for that code does already say `in sub bar`​:

  m​: sub bar {}; bar :42foo
  rakudo-moar 2fb8c7​: OUTPUT​: «Unexpected named argument 'foo' passed␤ in sub bar at <tmp> line 1␤

@p6rt
Copy link
Author

p6rt commented Jul 24, 2017

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jul 24, 2017

From @lizmat

On 24 Jul 2017, at 19​:51, Zoffix Znet via RT <perl6-bugs-followup@​perl.org> wrote​:

On Mon, 24 Jul 2017 07​:15​:54 -0700, juerd@​tnx.nl wrote​:

It would be more awesome if "Unexected named argument 'foo' passed" was
supplemented with the name of the function to which it was passed.

sub xyzzy ($x, :$foo = False) { ... }
sub bar ($y) { ... }

xyzzy(
bar "aoeusnthaoeusnth",
:foo
)

If the error message includes the name 'bar', it's obvious that adding
parentheses will fix the problem.

But the error for that code does already say `in sub bar`​:

m​: sub bar {}; bar :42foo
rakudo-moar 2fb8c7​: OUTPUT​: «Unexpected named argument 'foo' passed␤ in sub bar at <tmp> line 1␤

Well, technically, that’s part of the backtrace, not of the message?

@p6rt
Copy link
Author

p6rt commented Jul 24, 2017

From @Juerd

Zoffix Znet via RT skribis 2017-07-24 10​:51 (-0700)​:

But the error for that code does already say `in sub bar`​:
m​: sub bar {}; bar :42foo
rakudo-moar 2fb8c7​: OUTPUT​: «Unexpected named argument 'foo' passed␤ in sub bar at <tmp> line 1␤

I was catching exceptions and printing them without gist. Sorry!
--
Met vriendelijke groet, // Kind regards, // Korajn salutojn,

Juerd Waalboer <juerd@​tnx.nl>
TNX

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

1 participant