Skip Menu |
Report information
Id: 128844
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: zefram [at] fysh.org
Cc:
AdminCc:

Severity: (no value)
Tag: Bug
Platform: (no value)
Patch Status: (no value)
VM: (no value)



From: Zefram <zefram [...] fysh.org>
Date: Thu, 4 Aug 2016 23:42:15 +0100
To: rakudobug [...] perl.org
Subject: [BUG] faulty error message for calling unknown methods on Scalar
Download (untitled) / with headers
text/plain 737b
Show quoted text
> my $a = 3
3 Show quoted text
> my $b = $a.VAR
3 Show quoted text
> $b.WHAT.say
(Scalar) Show quoted text
> $a.abs
3 Show quoted text
> $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


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org