Skip Menu |
Report information
Id: 72916
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: masak <cmasak [at] gmail.com>
Cc:
AdminCc:

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



Subject: [BUG] Null PMC access when calling a method on the return value of .^add_method in Rakudo
Date: Thu, 18 Feb 2010 01:38:16 +0100
To: rakudobug [...] perl.org
From: Carl Mäsak <cmasak [...] gmail.com>
Download (untitled) / with headers
text/plain 870b
<diakopter> rakudo: Rat.^add_method('lol', method ($what) { say "lol$what" }).lol('cat') <p6eval> rakudo 5d43a3: OUTPUT«Null PMC access in find_method('lol')␤ [...] * masak submits rakudobug <jnthn> fwiw, that's not supposed to work. :-) <jnthn> (shouldn't npmca, though) <masak> bla bla bla Null PMC access bla bla... yes <masak> rakudo: Rat.^add_method('x', method () {}).x <p6eval> rakudo 5d43a3: OUTPUT«Null PMC access in find_method('x') [...] <jnthn> masak: It's just that it's a method written in PIR with no .return <masak> :) * masak reads that as "It's just that it's a [black box]" <jnthn> We either need (a) a blanket solution or (b) to go and find/tweak each method/sub that does that <jnthn> Or to write less in PIR :-) <jnthn> No, it's quite hackable on. :-) <masak> jnthn: hey, I don't tell you the specifics of bug submitting! :P <jnthn> masak: :-P
Download (untitled) / with headers
text/plain 277b
NOM: Still broken. bbkr:nom bbkr$ ./perl6 -e 'Rat.^add_method('lol', method ($what) { say "lol$what" }).lol("cat")' Could not find sub &lol To notice: Somehow it lost Rat context, I mean it does not print something like "Method 'lol' not found for invocant of class 'Rat'".
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 428b
On Tue Sep 13 14:39:36 2011, bbkr wrote: Show quoted text
> NOM: Still broken. > > bbkr:nom bbkr$ ./perl6 -e 'Rat.^add_method('lol', method ($what) { say > "lol$what" }).lol("cat")' > Could not find sub &lol > > To notice: Somehow it lost Rat context, I mean it does not print > something like "Method 'lol' not found for invocant of class 'Rat'". >
now reports: Method 'lol' not found for invocant of class 'Method' -- Will "Coke" Coleda
Download (untitled) / with headers
text/plain 755b
On Tue Oct 04 18:05:24 2011, coke wrote: Show quoted text
> On Tue Sep 13 14:39:36 2011, bbkr wrote:
> > NOM: Still broken. > > > > bbkr:nom bbkr$ ./perl6 -e 'Rat.^add_method('lol', method ($what) { say > > "lol$what" }).lol("cat")' > > Could not find sub &lol > > > > To notice: Somehow it lost Rat context, I mean it does not print > > something like "Method 'lol' not found for invocant of class 'Rat'". > >
> > now reports: > > Method 'lol' not found for invocant of class 'Method'
The thing about "sub" in the previous post is due to a shell quoting fail. The latest is fine - it's not spec'd exactly what is returned, but the Null PMC access is gone and a Method instance is a true value, and a sensible enough thing to return. So, tagging testneeded. /jnthn
On Thu Apr 05 07:17:16 2012, jnthn@jnthn.net wrote: Show quoted text
> On Tue Oct 04 18:05:24 2011, coke wrote:
> > On Tue Sep 13 14:39:36 2011, bbkr wrote:
> > > NOM: Still broken. > > > > > > bbkr:nom bbkr$ ./perl6 -e 'Rat.^add_method('lol', method ($what) {
say Show quoted text
> > > "lol$what" }).lol("cat")' > > > Could not find sub &lol > > > > > > To notice: Somehow it lost Rat context, I mean it does not print > > > something like "Method 'lol' not found for invocant of class
'Rat'". Show quoted text
> > >
> > > > now reports: > > > > Method 'lol' not found for invocant of class 'Method'
> > The thing about "sub" in the previous post is due to a shell quoting > fail. The latest is fine - it's not spec'd exactly what is returned,
but Show quoted text
> the Null PMC access is gone and a Method instance is a true value, and
a Show quoted text
> sensible enough thing to return. So, tagging testneeded. > > /jnthn
19:58 <+dalek> roast: 369d517 | diakopter++ | S12-class/basic.t: 19:58 <+dalek> roast: test RT #72916 19:58 <+dalek> roast: review: https://github.com/perl6/roast/commit/369d517e7a 19:58 < diakopter> resolves ticket.


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