Navigation Menu

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 message when using int parameters as subs #5709

Closed
p6rt opened this issue Oct 1, 2016 · 4 comments
Closed

error message when using int parameters as subs #5709

p6rt opened this issue Oct 1, 2016 · 4 comments
Labels
LTA Less Than Awesome; typically an error message that could be better

Comments

@p6rt
Copy link

p6rt commented Oct 1, 2016

Migrated from rt.perl.org#129772 (status was 'resolved')

Searchable as RT129772$

@p6rt
Copy link
Author

p6rt commented Oct 1, 2016

From @zoffixznet

If you accidentally use an `int` variable as a Callable, you get a
helpful error​:

  <Zoffix> m​: my int $i; $i()
  <camelia> rakudo-moar 1f29cb​: OUTPUT«No such method 'CALL-ME' for
invocant of type 'Int'␤ in block <unit> at <tmp> line 1␤␤»

However, that's not the case if the variable is a parameter​:

  <Zoffix> m​: sub (int $i) { $i() }
  <camelia> rakudo-moar 1f29cb​: OUTPUT«===SORRY!===␤callee
expression must be an object␤»

Most heinous issue is the line number/file of the issue is missing
from the error message.

@p6rt
Copy link
Author

p6rt commented Oct 12, 2016

From @jnthn

On Fri Sep 30 21​:17​:55 2016, cpan@​zoffix.com wrote​:

If you accidentally use an `int` variable as a Callable, you get a
helpful error​:

 \<Zoffix> m&#8203;: my int $i; $i\(\)
 \<camelia> rakudo\-moar 1f29cb&#8203;: OUTPUT«No such method 'CALL\-ME' for  

invocant of type 'Int'␤ in block <unit> at <tmp> line 1␤␤»

However, that's not the case if the variable is a parameter​:

 \<Zoffix> m&#8203;: sub \(int $i\) \{ $i\(\) \}
 \<camelia> rakudo\-moar 1f29cb&#8203;: OUTPUT«===SORRY\!===␤callee  

expression must be an object␤»

Most heinous issue is the line number/file of the issue is missing
from the error message.

Now the second gives the same error as the first. Test added in S32-exceptions/misc.t.

@p6rt
Copy link
Author

p6rt commented Oct 12, 2016

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

@p6rt
Copy link
Author

p6rt commented Oct 12, 2016

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Oct 12, 2016
@p6rt p6rt added the LTA Less Than Awesome; typically an error message that could be better label Jan 5, 2020
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
Projects
None yet
Development

No branches or pull requests

1 participant