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

faulty error message for calling unknown methods on Scalar #5535

Open
p6rt opened this issue Aug 4, 2016 · 1 comment
Open

faulty error message for calling unknown methods on Scalar #5535

p6rt opened this issue Aug 4, 2016 · 1 comment
Labels

Comments

@p6rt
Copy link

p6rt commented Aug 4, 2016

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

Searchable as RT128844$

@p6rt
Copy link
Author

p6rt commented Aug 4, 2016

From zefram@fysh.org

my $a = 3
3
my $b = $a.VAR
3
$b.WHAT.say
(Scalar)
$a.abs
3
$b.abs
Method 'abs' not found for invocant of class 'Int'
  in block <unit> at <unknown file> line 1

There is no "abs" method on Scalar, but there is on Int. The error
message is presumably correct in saying that the method was not found,
but is incorrect in identifying the class in which it was not found.
A similar message arises for methods not defined in either class.

Some behaviour in this area previously convinced me that Scalar objects
pass unknown methods through to the value they contain. In the light of
what I see here, I think I was probably mistaken about that. Sorry for
confusion caused by referencing that behaviour in other tickets.

-zefram

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant